Controllable-RAG-Agent is an advanced Retrieval-Augmented Generation (RAG) system designed specifically for complex, multi-step question answering over your own documents. Instead of relying solely on simple semantic search, it builds a deterministic control graph that acts as the “brain” of the agent, orchestrating planning, retrieval, reasoning, and verification across many steps. The pipeline ingests PDFs, splits them into chapters, cleans and preprocesses text, then constructs vector stores for fine-grained chunks, chapter summaries, and book quotes to support nuanced queries. At query time, it anonymizes entities, creates a high-level plan, de-anonymizes and expands that plan into concrete retrieval or reasoning tasks, and executes them in sequence while continuously revising the plan. A key focus is hallucination control: each answer is verified against retrieved context, and responses are reworked when they are not sufficiently grounded in the source documents.
Features
- Deterministic control graph that acts as the agent’s “brain” for multi-step reasoning
- End-to-end pipeline from PDF ingestion to chapter summaries and vector stores
- Hallucination prevention through strict grounding and verification against retrieved context
- Entity anonymization, planning, and de-anonymization to generalize reasoning patterns
- Modular tasks that decide when to retrieve vs when to answer using chain-of-thought
- Built-in evaluation using Ragas metrics plus Docker and non-Docker setup paths