← All questions
RAGMedium· Advanced RAG· Prompt Engineering· Modular RAG

Your pipeline retrieves all three fee components correc...

Before introducing complex modular frameworks, diagnose where the failure occurs. Because all three fee components are successfully retrieved, retrieval functions as expected; the failure lies entirely in context execution during generation.

If the fee components exist within a single retrieved chunk (or standard retrieved context), the simplest, lowest-latency fix is a targeted prompt instruction forcing the model to explicitly sum the components prior to outputting the final response. This requires zero pipeline architecture changes and adds zero latency. You should only adopt modular or agentic RAG (e.g., query decomposition modules) if the fee components reside across distinct documents that cannot be retrieved together using a single initial query.

Code playground (Python)