Skip to content
Middle+0 views

Why did you use different models for RAG and the agent instead of one shared model?

Practice

AI answer

RAG and an agent have different requirements. In RAG, the model usually generates an answer based on the retrieved context, so source fidelity, the ability to handle long contexts, reliability, and cost across a large number of queries are important. An agent also needs reliable planning, tool selection, and correct handling of tool results; this may require a more capable model, even if it is more expensive or slower.

Using two models makes it possible to balance quality, latency, and cost at each stage. However, this is not a required architecture: if one model meets the requirements of both use cases, it can be used for both. The decision should be validated through evaluation on representative tasks and by considering the system’s total cost.