|
5 | 5 | <h1 align="center">Agentic RAG for Dummies</h1> |
6 | 6 |
|
7 | 7 | <p align="center"> |
8 | | - <strong>Build a production-ready Agentic RAG system with LangGraph, conversation memory, and human-in-the-loop query clarification</strong> |
| 8 | + <strong>Build a modular Agentic RAG system with LangGraph, conversation memory, and human-in-the-loop query clarification</strong> |
9 | 9 | </p> |
10 | 10 |
|
11 | 11 | <p align="center"> |
|
46 | 46 |
|
47 | 47 | ## Overview |
48 | 48 |
|
49 | | -This repository demonstrates how to build an **Agentic RAG (Retrieval-Augmented Generation)** system using LangGraph with minimal code. Most RAG tutorials show basic concepts but lack production readiness — this repo bridges that gap by providing **both learning materials and deployable code**. |
| 49 | +This repository demonstrates how to build an **Agentic RAG (Retrieval-Augmented Generation)** system using LangGraph with minimal code. Most RAG tutorials show basic concepts but lack guidance on building modular, agent-driven systems — this project bridges that gap by providing **both learning materials and an extensible architecture**. |
50 | 50 |
|
51 | 51 | ### What's inside |
52 | 52 |
|
53 | 53 | | Feature | Description | |
54 | 54 | |---|---| |
55 | | -| 💬 **Conversation Memory** | Maintains context across questions for natural dialogue | |
56 | 55 | | 🔍 **Hierarchical Indexing** | Search small chunks for precision, retrieve large Parent chunks for context | |
| 56 | +| 💬 **Conversation Memory** | Maintains context across questions for natural dialogue | |
57 | 57 | | 🔄 **Query Clarification** | Rewrites ambiguous queries or pauses to ask the user for details | |
58 | 58 | | 🤖 **Agent Orchestration** | LangGraph coordinates the full retrieval and reasoning workflow | |
59 | 59 | | 🔀 **Multi-Agent Map-Reduce** | Decomposes complex queries into parallel sub-queries | |
@@ -505,7 +505,7 @@ llm_with_tools = llm.bind_tools([search_child_chunks, retrieve_parent_chunks]) |
505 | 505 |
|
506 | 506 | ### Step 6: Define System Prompts |
507 | 507 |
|
508 | | -Define the system prompts for conversation summarization, query rewriting, RAG agent reasoning, context compression, fallback response, and answer aggregation. |
| 508 | +Define the system prompts for conversation summarization, query rewriting, agent orchestration, context compression, fallback response, and answer aggregation. |
509 | 509 |
|
510 | 510 | <details> |
511 | 511 | <summary>Conversation Summary Prompt</summary> |
@@ -1023,8 +1023,7 @@ def collect_answer(state: AgentState): |
1023 | 1023 | - **Parallel execution** via `Send` API spawns independent agent subgraphs for each sub-question simultaneously |
1024 | 1024 | - **Context compression** keeps the agent's working memory lean across long retrieval loops, preventing redundant fetches |
1025 | 1025 | - **Fallback response** ensures graceful degradation — the agent always returns something useful even when the budget runs out |
1026 | | -- **Answer collection & aggregation** extracts clean final answers from tool-calling conversations and merges them into a single coherent response |
1027 | | - |
| 1026 | +- **Answer collection & aggregation** extracts clean final answers from agents and aggregates them into a single coherent response |
1028 | 1027 | --- |
1029 | 1028 |
|
1030 | 1029 | ### Step 10: Build the LangGraph Graphs |
@@ -1139,7 +1138,7 @@ demo.launch(theme=gr.themes.Citrus()) |
1139 | 1138 |
|
1140 | 1139 | ## Modular Architecture |
1141 | 1140 |
|
1142 | | -The app (`project/` folder) is organized into modular components — each independently swappable without breaking the system: |
| 1141 | +The app (`project/` folder) is organized into modular components — each independently swappable without breaking the system. |
1143 | 1142 |
|
1144 | 1143 | ### 📂 Project Structure |
1145 | 1144 | ``` |
@@ -1199,7 +1198,7 @@ Open the local URL (e.g., `http://127.0.0.1:7860`) to start chatting. |
1199 | 1198 |
|
1200 | 1199 | ### Option 3: Docker Deployment |
1201 | 1200 |
|
1202 | | -See [`project/README.md`](./project/README.md) for full Docker instructions and system requirements. |
| 1201 | +See [`project/README.md`](./project/README.md#Docker-Deployment) for full Docker instructions and system requirements. |
1203 | 1202 |
|
1204 | 1203 | ### Example Conversations |
1205 | 1204 |
|
@@ -1236,4 +1235,4 @@ Agent: [Retrieves and answers with specific information] |
1236 | 1235 | | **Temperature & Consistency** | - Responses inconsistent or overly creative<br>- Responses too rigid or repetitive | - Set temperature to `0` for factual, consistent output<br>- Slightly increase temperature for summarization or analysis tasks | |
1237 | 1236 | | **Embedding Model Quality** | - Poor semantic search<br>- Weak performance on domain-specific or multilingual docs | - Use higher-quality or domain-specific embeddings<br>- Re-index all documents after changing embeddings | |
1238 | 1237 |
|
1239 | | -> 💡 **For additional troubleshooting tips** see the [README Troubleshooting](./project/README.md#troubleshooting). |
| 1238 | +> 💡 **For additional troubleshooting tips** see the [README Troubleshooting](./project/README.md#troubleshooting). |
0 commit comments