gitwtfhub

wtf is controllable-rag-agent?

nirdiamant/controllable-rag-agent — explained in plain English

Analysis updated 2026-08-11 · repo last pushed 2026-06-04

1,618Jupyter NotebookAudience · developerComplexity · 4/5MaintainedSetup · moderate

TL;DR

An AI system that answers complex multi-step questions about your own documents by breaking questions into smaller pieces, planning each step, and verifying answers against your text instead of guessing.

Mindmap

mindmap
  root((repo))
    What it does
      Breaks questions into steps
      Plans and verifies answers
      Works from your documents
    How it works
      Loads and summarizes documents
      Creates generic question versions
      Checks answers against sources
    Use cases
      Legal case file analysis
      Technical manual research
      Internal knowledge tools
    Tech stack
      Jupyter Notebooks
      LangChain
      Ragas evaluation
      Multiple AI providers
    Audience
      Legal teams
      Researchers
      Product teams
    Demo
      Harry Potter example
      Visual step-by-step interface

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Build a legal research assistant that answers multi-step questions across case files while citing sources.

REASON 2

Create an internal knowledge tool that reasons over company documents with built-in fact-checking.

REASON 3

Set up a document analysis system for long technical manuals that avoids hallucinated answers.

REASON 4

Watch the AI plan and verify each reasoning step live in a visual demo using the included Harry Potter example.

What's in the stack?

Jupyter NotebookLangChainRagasPython

How it stacks up

nirdiamant/controllable-rag-agenttrekhleb/machine-learning-experimentskarpathy/cryptos
Stars1,6181,8101,915
LanguageJupyter NotebookJupyter NotebookJupyter Notebook
Last pushed2026-06-042021-06-21
MaintenanceMaintainedDormant
Setup difficultymoderatemoderatemoderate
Complexity4/53/54/5
Audiencedeveloperresearcherresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 1h+

Requires an API key from an AI model provider (OpenAI, Anthropic, etc.) and Python environment setup with LangChain and related dependencies.

No license information is provided in the repository, so usage rights are unclear.

Wtf does this do

The controllable-rag-agent project helps you build an AI system that can answer genuinely complicated questions about your own documents, the kind of multi-step questions that simpler AI tools get wrong. Instead of just searching for relevant paragraphs and hoping for the best, it breaks hard questions into smaller pieces, plans how to tackle each one, and verifies its answers along the way. Here is how it works in plain terms. You load your documents (the demo uses the first Harry Potter book as an example). The system creates summaries of each section and stores everything in a searchable format. When you ask a question, it first strips out specific names and details to create a generic version of your question, this prevents the AI from relying on what it already knows and forces it to work only from your documents. Then it builds a step-by-step plan. For a question like "How did the protagonist defeat the villain's assistant?" it would figure out who the protagonist is, who the villain is, who the assistant is, search for relevant interactions, and piece together the answer. After each step, it checks whether the information it found actually came from your documents rather than being invented, and it adjusts its plan as new information comes in. This is useful for anyone who needs an AI to reason carefully over a specific document set, a legal team analyzing case files, a researcher working through a long technical manual, or a product team building an internal knowledge tool where accuracy really matters and hallucinations are unacceptable. The project is built as Jupyter notebooks with a visual demo interface, so you can watch the agent think through each step in real time. It is designed to be controllable rather than a black box: you can see and influence how it plans, retrieves, and verifies. It uses established tools like LangChain and evaluation metrics from Ragas to measure answer quality, and it works with several different AI model providers so you are not locked into one.

Yoink these prompts

Prompt 1
Help me set up the controllable-rag-agent project with my own PDF documents instead of the Harry Potter demo. What code do I need to change in the notebook to load my files?
Prompt 2
I want to use controllable-rag-agent with Anthropic Claude instead of the default model provider. Show me how to switch the model configuration in the LangChain setup.
Prompt 3
Using the controllable-rag-agent notebook, explain how the question rewriting step works and help me customize the generic question template for my domain-specific terminology.
Prompt 4
Help me add a new evaluation metric to the Ragas scoring step in controllable-rag-agent so I can measure how well answers match my industry's standards.
Prompt 5
Walk me through adapting the controllable-rag-agent planning logic so it handles questions about my company's internal policy documents with multiple nested references.

Frequently asked questions

wtf is controllable-rag-agent?

An AI system that answers complex multi-step questions about your own documents by breaking questions into smaller pieces, planning each step, and verifying answers against your text instead of guessing.

What language is controllable-rag-agent written in?

Mainly Jupyter Notebook. The stack also includes Jupyter Notebook, LangChain, Ragas.

Is controllable-rag-agent actively maintained?

Maintained — commit in last 6 months (last push 2026-06-04).

What license does controllable-rag-agent use?

No license information is provided in the repository, so usage rights are unclear.

How hard is controllable-rag-agent to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is controllable-rag-agent for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.