Problem
The LAMB completion pipeline does not generate inline citations (e.g. [N] references) in its answers, even when retrieved Knowledge Store context is used. The model is never instructed to cite, and the retrieved context is concatenated as raw text with no per-chunk numbering.
Concretely, in the Knowledge Store RAG path:
knowledge_store_rag.py and query_rewriting_ks_rag.py build the context string and the sources list in two separate, uncorrelated loops, so there is no stable number linking a context chunk to its source.
- The
kvcache_augment prompt processor injects an ## Available Sources list only when a prompt_template is set, never tells the model to cite, and reads source.get("similarity") while Knowledge Store sources carry score — so the relevance value always renders as 0.000. In the no-prompt_template fallback branch the sources block is dropped entirely.
As a consequence there is no citation signal in answers (and, separately, downstream evaluation has no citation faithfulness to measure).
Expected
When a Knowledge Store RAG assistant answers using retrieved context, the answer should contain inline [N] markers that line up with a numbered sources list whose links resolve via LAMB's permalink proxy.
Scope
Knowledge Store path only (knowledge_store_rag, query_rewriting_ks_rag, shared kvcache_augment PPS). The legacy simple_rag/simple_augment path is left unchanged for backward compatibility.
Problem
The LAMB completion pipeline does not generate inline citations (e.g.
[N]references) in its answers, even when retrieved Knowledge Store context is used. The model is never instructed to cite, and the retrieved context is concatenated as raw text with no per-chunk numbering.Concretely, in the Knowledge Store RAG path:
knowledge_store_rag.pyandquery_rewriting_ks_rag.pybuild the context string and thesourceslist in two separate, uncorrelated loops, so there is no stable number linking a context chunk to its source.kvcache_augmentprompt processor injects an## Available Sourceslist only when aprompt_templateis set, never tells the model to cite, and readssource.get("similarity")while Knowledge Store sources carryscore— so the relevance value always renders as0.000. In the no-prompt_templatefallback branch the sources block is dropped entirely.As a consequence there is no citation signal in answers (and, separately, downstream evaluation has no citation faithfulness to measure).
Expected
When a Knowledge Store RAG assistant answers using retrieved context, the answer should contain inline
[N]markers that line up with a numbered sources list whose links resolve via LAMB's permalink proxy.Scope
Knowledge Store path only (
knowledge_store_rag,query_rewriting_ks_rag, sharedkvcache_augmentPPS). The legacysimple_rag/simple_augmentpath is left unchanged for backward compatibility.