agentic-rag-for-dummies
AgentFreeA modular Agentic RAG built with LangGraph — learn Retrieval-Augmented Generation Agents in minutes.
Capabilities13 decomposed
hierarchical parent-child document chunking with dual-embedding indexing
Medium confidenceSplits PDF documents into small child chunks (512 tokens) nested within larger parent chunks (2048 tokens), then indexes both layers separately using dense embeddings (sentence-transformers) and sparse BM25 embeddings via FastEmbedSparse. At retrieval time, the system fetches child chunks for precision but returns their parent context for completeness, solving the precision-vs-context tradeoff inherent in flat RAG systems. This two-tier indexing strategy is orchestrated through a DocumentChunker and VectorDatabaseManager that maintains parent-child relationships in Qdrant.
Implements explicit parent-child chunk relationships with dual-embedding (dense + sparse BM25) indexing in a single Qdrant instance, rather than maintaining separate indices or flattening chunks. The VectorDatabaseManager and ParentStoreManager classes coordinate retrieval to return child chunks for ranking but parent context for generation, a pattern not standard in LangChain's default RecursiveCharacterTextSplitter.
Outperforms naive chunking strategies by reducing context loss (vs flat chunks) and retrieval latency (vs separate vector stores) while maintaining both semantic and keyword search capabilities in one index.
agentic multi-turn query reasoning with langgraph state machine
Medium confidenceOrchestrates a multi-node LangGraph workflow where an LLM-powered agent reasons about user queries, decides whether to retrieve documents, clarifies ambiguous questions via human-in-the-loop prompts, and iteratively refines search strategies based on retrieval results. The graph implements conditional routing (via graph.add_conditional_edges) to branch between retrieval, clarification, and response generation nodes. State is maintained across turns in a TypedDict that tracks conversation history, retrieved documents, and agent decisions, enabling the agent to learn from previous retrieval failures and adjust its approach.
Uses LangGraph's graph.add_conditional_edges() to implement branching logic where an LLM node decides routing (retrieve vs clarify vs respond) based on query analysis, rather than hard-coded rule-based routing. The state machine pattern with TypedDict enables stateful reasoning across conversation turns, allowing the agent to learn from retrieval failures and adjust strategy dynamically.
Provides more flexible agent reasoning than rule-based RAG pipelines by letting the LLM decide when retrieval is needed, and more transparent than black-box agent frameworks by exposing the graph structure for debugging and customization.
document indexing pipeline with batch processing and incremental updates
Medium confidenceProcesses PDF documents through a multi-stage pipeline: PDF-to-text conversion (with smart routing), hierarchical chunking (parent-child), embedding generation (dense + sparse), and storage in Qdrant. The DocumentManager orchestrates this pipeline, supporting batch indexing of multiple documents and incremental updates (adding new documents without re-indexing existing ones). The pipeline is modular, enabling custom PDF processing strategies or embedding models to be swapped without changing the core indexing logic.
Implements document indexing as a modular pipeline (PDF conversion → chunking → embedding → storage) with support for incremental updates, rather than requiring full re-indexing on each document addition. The DocumentManager class abstracts pipeline orchestration, enabling custom strategies to be plugged in without changing core logic.
More efficient than re-indexing all documents on each update and more flexible than monolithic indexing scripts; the modular design enables easy customization for different document types and embedding strategies.
vector database abstraction with qdrant backend and parent-child relationship management
Medium confidenceAbstracts vector database operations (insert, search, delete) behind a VectorDatabaseManager class that handles both dense and sparse vector storage in Qdrant. The manager maintains parent-child chunk relationships using Qdrant's metadata filtering, enabling retrieval of child chunks while returning parent context. Supports both in-process (local) and remote Qdrant instances, enabling development on local machines and production on cloud deployments without code changes.
Implements VectorDatabaseManager as an abstraction layer that handles both dense and sparse vectors, parent-child relationships, and supports both in-process and remote Qdrant instances. The abstraction enables swapping vector database backends (in theory) without changing agent code, though current implementation is Qdrant-specific.
More flexible than direct Qdrant client usage and more maintainable than scattered vector database calls throughout the codebase; the abstraction layer enables easier testing and backend swapping.
notebook-based tutorial with interactive cells for learning rag concepts
Medium confidenceProvides a Jupyter notebook that walks through RAG concepts step-by-step: document loading, chunking, embedding, retrieval, and agent workflows. Each cell is self-contained and executable, enabling learners to understand concepts incrementally and experiment with parameters (chunk sizes, embedding models, LLM providers). The notebook includes visualizations of the indexing pipeline and agent graph, making abstract concepts concrete. This is distinct from the production modular system, serving as an educational tool rather than a deployment artifact.
Provides an interactive Jupyter notebook that teaches RAG concepts through executable cells, distinct from the production modular system. The notebook includes visualizations of the indexing pipeline and agent graph, making abstract concepts concrete and enabling experimentation with parameters.
More accessible than reading documentation and more hands-on than static tutorials; enables learners to modify code and see results immediately, accelerating understanding of RAG concepts.
human-in-the-loop clarification prompting for ambiguous queries
Medium confidenceImplements a dedicated agent node that detects ambiguous or under-specified user queries and generates clarification prompts asking the user to provide additional context (e.g., 'Which department's budget are you asking about?'). The clarification node is triggered via conditional routing when the agent's reasoning indicates insufficient query specificity. User responses are appended to the conversation state and the query is re-processed with the clarified context, enabling iterative refinement without requiring the user to restart the conversation.
Embeds clarification as a first-class agent node in the LangGraph workflow, triggered by conditional routing, rather than implementing it as a pre-processing step or external validation layer. The clarified context is merged back into the conversation state, enabling the agent to learn from the clarification in subsequent reasoning steps.
More user-friendly than silent retrieval failures and more efficient than always retrieving multiple interpretations; clarification is integrated into the agent loop rather than bolted on as a separate validation step.
multi-strategy pdf-to-text conversion with smart routing
Medium confidenceImplements three PDF processing strategies (simple text extraction via PyMuPDF4LLM, OCR+table detection for medium-complexity PDFs, and vision-language model analysis for complex layouts) with automatic routing based on PDF characteristics. The DocumentManager analyzes PDF structure (text density, table presence, image complexity) and selects the appropriate strategy, falling back to simpler methods if advanced processing fails. This avoids unnecessary computation (vision models are expensive) while ensuring complex PDFs are handled correctly.
Implements adaptive PDF processing with three-tier strategy selection (simple extraction → OCR+tables → vision models) based on PDF analysis, rather than requiring users to specify strategy upfront or always using the most expensive approach. The DocumentManager class encapsulates routing logic, enabling cost-aware processing without manual intervention.
More cost-effective than always using vision models and more robust than simple text extraction; the smart routing avoids both unnecessary expense and processing failures by matching strategy to PDF complexity.
two-stage retrieval with dense-sparse hybrid search
Medium confidenceCombines dense vector embeddings (sentence-transformers) and sparse BM25 embeddings (FastEmbedSparse) in a two-stage retrieval pipeline: first, both dense and sparse searches are executed in parallel against Qdrant, then results are merged using reciprocal rank fusion (RRF) to balance semantic relevance and keyword matching. This hybrid approach retrieves child chunks for ranking but returns parent chunks for generation, addressing both semantic gaps (where BM25 fails) and keyword-specific queries (where dense embeddings alone miss exact matches).
Implements parallel dense+sparse search with reciprocal rank fusion (RRF) merging in a single Qdrant query, rather than maintaining separate indices or sequentially executing searches. The VectorDatabaseManager class abstracts the hybrid search logic, enabling transparent switching between retrieval strategies without changing the agent code.
Outperforms pure dense retrieval on keyword-heavy queries and pure BM25 on semantic queries; the hybrid approach captures both signal types in a single retrieval pass, reducing latency vs sequential search strategies.
conversation memory management with multi-turn context preservation
Medium confidenceMaintains conversation history in the LangGraph state (TypedDict with messages list) across multiple turns, enabling the agent to reference previous queries, clarifications, and retrieved documents when answering new questions. The state includes full message history with roles (user/assistant) and metadata (retrieved documents, agent decisions), allowing the LLM to generate contextually aware responses that acknowledge prior context. Conversation state is passed to every agent node, enabling consistent reasoning across turns without requiring external memory systems.
Implements conversation memory as part of the LangGraph state machine (TypedDict), making it a first-class citizen in the workflow rather than a separate concern. Every agent node has access to full conversation history, enabling consistent reasoning without external memory systems or retrieval-augmented context injection.
Simpler than external memory systems (no database dependency) but less scalable; suitable for single-user or small-team deployments where in-memory state is acceptable.
schema-based tool calling with multi-provider llm support
Medium confidenceDefines retrieval tools as Pydantic schemas (e.g., RetrievalTool with query and filters parameters) and exposes them to the LLM via function-calling APIs. The system abstracts provider-specific function-calling implementations (OpenAI, Anthropic, Ollama) behind a unified LangChain interface, enabling the agent to invoke retrieval tools without knowing the underlying LLM provider. Tool schemas include descriptions and parameter constraints, allowing the LLM to understand when and how to use retrieval.
Abstracts function-calling across multiple LLM providers (OpenAI, Anthropic, Ollama) using LangChain's unified tool interface, enabling single-codebase support for different providers. Tool schemas are defined as Pydantic models, providing type safety and automatic validation without provider-specific boilerplate.
More flexible than provider-specific implementations and more type-safe than string-based tool definitions; enables easy provider switching without agent code changes.
gradio web ui with streaming response generation
Medium confidenceProvides a Gradio-based chat interface that streams agent responses token-by-token to the user, displaying retrieved documents and agent reasoning steps in real-time. The UI integrates with the LangGraph agent, passing user messages to the graph and rendering outputs (responses, clarification prompts, document citations) as they are generated. Streaming is implemented via LangChain's streaming callbacks, reducing perceived latency by showing partial responses while the LLM is still generating.
Integrates Gradio with LangGraph streaming callbacks to display token-by-token response generation and retrieved documents in real-time, rather than rendering only after full generation completes. The UI is tightly coupled to the agent graph, enabling transparent display of agent reasoning and retrieval steps.
Faster perceived response time than non-streaming UIs and simpler to deploy than custom React/Vue frontends; suitable for prototyping but not production-scale deployments.
configuration-driven system setup with environment-based provider selection
Medium confidenceCentralizes system configuration (LLM provider, model names, chunk sizes, vector database settings) in a configuration module that reads from environment variables and YAML files. This enables switching between Ollama, OpenAI, Anthropic, and Google Gemini by changing a single environment variable (LLM_PROVIDER) without modifying code. Configuration is loaded at startup and passed through the application, enabling runtime provider switching and easy customization for different deployment scenarios (local development vs cloud production).
Implements configuration as a centralized module that abstracts provider selection and parameter tuning, enabling single-variable switching between LLM providers (Ollama, OpenAI, Anthropic, Gemini) without code changes. Configuration is loaded at startup and passed through dependency injection, avoiding scattered configuration logic.
More flexible than hard-coded settings and simpler than complex configuration frameworks; suitable for small-to-medium deployments where environment-based configuration is sufficient.
token-aware context compression with conversation pruning
Medium confidenceUses tiktoken to count tokens in conversation history and automatically prunes old messages when approaching the LLM's context window limit. The system tracks token usage across retrieved documents, conversation history, and system prompts, and removes oldest messages (while preserving recent context) to stay within budget. This enables long conversations without exceeding context limits or requiring manual truncation, though it may lose distant conversation context.
Implements automatic context pruning based on token counting (tiktoken) rather than message count, enabling precise control over context window usage. Pruning removes oldest messages while preserving recent context, maintaining conversation coherence for follow-up questions.
More precise than fixed-message-count pruning and more efficient than always including full history; enables longer conversations within fixed context budgets without manual intervention.
Capabilities are decomposed by AI analysis. Each maps to specific user intents and improves with match feedback.
Related Artifactssharing capabilities
Artifacts that share capabilities with agentic-rag-for-dummies, ranked by overlap. Discovered automatically through the match graph.
bRAG-langchain
Everything you need to know to build your own RAG application
LlamaIndex Starter
LlamaIndex starter pack for common RAG use cases.
LlamaIndex
A data framework for building LLM applications over external data.
LangChain RAG Template
LangChain reference RAG implementation from scratch.
langchain4j-aideepin
基于AI的工作效率提升工具(聊天、绘画、知识库、工作流、 MCP服务市场、语音输入输出、长期记忆) | Ai-based productivity tools (Chat,Draw,RAG,Workflow,MCP marketplace, ASR,TTS, Long-term memory etc)
resona
Semantic embeddings and vector search - find concepts that resonate
Best For
- ✓teams building production RAG systems where context loss causes answer quality degradation
- ✓developers working with long-form documents (research papers, technical specs, legal contracts) where isolated chunks lack meaning
- ✓developers building conversational AI agents that need reasoning capabilities beyond simple retrieval
- ✓teams deploying RAG systems where query ambiguity is common and user clarification improves accuracy
- ✓teams building document management systems with RAG capabilities
- ✓organizations with growing document collections that need incremental indexing
- ✓teams building production RAG systems that may need to scale to cloud deployments
- ✓developers wanting to experiment with different vector databases without rewriting retrieval logic
Known Limitations
- ⚠Requires maintaining parent-child relationships in vector store, adding ~15-20% storage overhead vs flat chunking
- ⚠Parent chunk retrieval adds ~50-100ms latency per query due to secondary lookup after child chunk retrieval
- ⚠Chunk size tuning (512/2048 tokens) is dataset-specific; no automatic optimization provided
- ⚠Each agent reasoning step adds ~1-3 seconds latency (LLM inference time) compared to direct retrieval
- ⚠Requires LLMs with strong tool-calling support (7B+ parameters recommended); smaller models may ignore retrieval instructions
- ⚠State management requires in-memory or persistent storage; no built-in distributed state backend for multi-instance deployments
Requirements
Input / Output
UnfragileRank
UnfragileRank is computed from adoption signals, documentation quality, ecosystem connectivity, match graph feedback, and freshness. No artifact can pay for a higher rank.
Repository Details
Last commit: Apr 19, 2026
About
A modular Agentic RAG built with LangGraph — learn Retrieval-Augmented Generation Agents in minutes.
Categories
Alternatives to agentic-rag-for-dummies
Are you the builder of agentic-rag-for-dummies?
Claim this artifact to get a verified badge, access match analytics, see which intents users search for, and manage your listing.
Get the weekly brief
New tools, rising stars, and what's actually worth your time. No spam.
Data Sources
Looking for something else?
Search →