Common Flow Patterns

Modular RAG systems are flexible enough to support multiple interaction patterns between modules. These allow more powerful and intelligent workflows.


✅ Common Flow Patterns:

FlowPatternDescription
LinearClassic RAG: query → retrieve → generate
Rewrite-Retrieve-ReadQuery is rewritten before retrievalretrieval is optimized for better inputs
Demonstrate-Search-Predict (DSP)Uses few-shot examples and routinglogic for tailored retrieval
Iterative Retrieve-ReadThe model retrieves multiple rounds beforegeneration
Self-RAGThe model decides whether to retrieve or not at all
Generate-ReadThe LLM generates hypothetical answers, then retrievesdocuments to support them

Advantages of Modular RAG

  • Flexibility: Modules can be customized for different use cases.

  • Adaptability: System can decide its own execution flow.

  • Maintainability: Easier to debug or improve specific modules.

  • Scalability: Handles more data sources, tasks, and formats.