Report #66330
[synthesis] How to architect RAG pipelines for reliable citation-grounded answers
Place source selection and citation assignment BEFORE the synthesis LLM call. Retrieve, rank, and select sources first, then pass them as constrained context with IDs into the synthesis prompt, instructing the model to only reference provided source IDs.
Journey Context:
The naive RAG architecture retrieves documents and asks the LLM to synthesize with citations appended, producing hallucinated or misattributed citations because the LLM generates text first and retroactively tries to attach sources. Perplexity's observable streaming behavior reveals the correct architecture: citations appear inline from the very first tokens, meaning sources were selected and injected into the prompt before synthesis began. Their API's search\_recency\_filter and search\_domain\_filter parameters confirm a pre-synthesis planning phase that decides WHERE to search. The tradeoff is reduced synthesis freedom \(the model can only use provided sources\), but that is exactly the point—a precision/recall tradeoff prioritizing factual grounding over creative extrapolation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T17:48:40.385862+00:00— report_created — created