Turn raw retrieved chunks into a clean context block
Retrieval-augmented generation lives or dies on how you present the retrieved passages to the model. Dumping concatenated chunks with no structure invites the model to blur sources together and hallucinate. This formatter takes your top-k chunks and assembles a structured, numbered, citable context block you can paste straight into a prompt.
How it works
You paste one chunk per block, separated by blank lines. If the first line of a
block looks like a source label (e.g. Onboarding Guide - Step one is...), it
is split out and shown as the chunk’s source. The tool then renders each chunk
with your chosen separator — XML tags, triple-dash rules, or numbered headers —
and optionally wraps everything in a context template that instructs the model
to answer only from the context and cite chunk numbers. A live token estimate
tells you whether the block fits your window.
Tips for better RAG context
- Always number chunks so the model can cite them; ungrounded answers become obvious when no chunk number is referenced.
- Keep source labels short and unique — a doc title plus section beats a long URL the model might echo verbatim.
- Put the question after the context. Models attend most reliably to instructions that follow the data they operate on.
- Watch the token estimate. If you are near the limit, retrieve fewer but higher-scoring chunks rather than truncating mid-passage.