Your team has built a retrieval-augmented generation (RAG) pilot. RAG means the AI looks up your documents before it answers. In the demo it works. In daily use, answers come slowly, and sometimes they miss the point.
Most teams blame the search step or the model. Often the problem sits in between. It is how the retrieved text is put together before the model reads it. We call this context composition.
Why context composition slows RAG down
After the search step, the system holds several pieces of text. These pieces must be joined into one block, called the context. The model reads this block and writes the answer.
Many pilots do this in a simple way. They paste the pieces together in the order the search returned them. That is fine for a demo with ten documents. It is not fine for thousands of real documents and many users at once.
A longer context takes the model longer to read. It also costs more to run. And extra text that does not help the answer can push the useful facts out of focus.
Why it is harder in production than in a demo
In a demo, you ask one question and wait a few seconds. Nobody minds. In production, a support agent or a finance analyst asks many questions a day. A slow answer breaks their flow, and they stop using the tool.
Real documents are also messy. They have repeated sections, old versions and long tables. The same fact may appear in five places. If you pass all five to the model, you pay for the repeats and add noise.
Order matters too. Research on language models (LLMs) has found that they often pay more attention to the start and the end of the text they are given. Facts buried in the middle are easier to miss. So the same pieces, in a different order, can give a different answer.
Three fixes worth testing
1. Trim the context
Keep the sentences that carry the answer. Drop repeats and filler. A shorter context is faster to read and cheaper to run. The risk is cutting something that mattered, so you must test trimmed answers against full ones.
2. Choose the order on purpose
Put the pieces that set the topic near the start. Put the piece that best answers the question near the end. Keep weaker material in the middle. This costs almost nothing to try, because it only changes how you assemble the text.
3. Remove duplicates before the model sees them
If two pieces say the same thing, send one. This is simple, and it often gives the quickest gain on document-heavy workflows.
None of these needs a new model or a new database. They change the step in between. That makes them a good first move before you spend on bigger changes.
How we approach it
We do not treat this as a lab exercise. Our forward-deployed engineers work inside your team, on your real documents and your real questions. We start by measuring where time goes in your own pipeline: search, context assembly or the model. Then we fix the biggest delay first.
We test each change against a set of questions that your own experts have checked. If a shorter context lowers answer quality, we see it before users do. We also keep a human in the loop for answers where confidence is low.
When the work is done, we hand it over. Your engineers get the test set, the tuning notes and the monitoring, so they can keep improving the system without us. You can see how we run this on our process page, and read more about our RAG systems work.
An example from our work
One example from our work: RAG search for a national statistics ministry: questions in Hindi, English and Kannada, by voice or text, with citations that link to the exact source page. 490+ legacy statistical tables indexed and queryable in plain language.
Systems like this show why context matters. Users want a fast answer and a citation they can check. Both depend on sending the model the right text, and only the right text.
What this means for a business leader
- Ask where the time goes. Ask your team to show how long search, context assembly and the model each take.
- Try cheap fixes first. Trimming, reordering and removing duplicates need no new model.
- Insist on a test set. Speed gains mean little if answer quality drops. Have your own experts check a fixed set of questions.
- Plan the handover. Your team should be able to run and tune the system after the vendor leaves.
Next step
If your team has slow or inaccurate RAG answers in pilot but not in production, book a discovery call.
Saksham Gupta
Founder & CEO, EduBildSaksham Gupta is the founder and CEO of EduBild, which embeds forward-deployed AI engineers with enterprise teams to ship production AI. Ex-Daimler AG; KIT Germany.



