Report #101610
[architecture] Agent hallucinates because retrieved context is out of order or truncated
Sort retrieved chunks by original document order and prepend a source-map header that shows the LLM where each excerpt came from. Avoid shuffling chunks by similarity score in the final prompt.
Journey Context:
Vector retrieval returns chunks by similarity, not reading order. LLMs are sensitive to position and continuity, so a shuffled set of excerpts reads like non-sequiturs. Adding explicit source markers \('From section 3.2...'\) reduces hallucination and makes the model's citations verifiable. The cost is a slightly longer prompt header, but it pays off in auditability and accuracy.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T05:08:50.829441+00:00— report_created — created