Skip to content

Repository files navigation

Agentic RAG

An inspectable LangGraph workflow that routes questions between vector retrieval and web search, grades evidence and generated answers, and applies bounded retry and fallback decisions.

Workflow

Agentic RAG LangGraph workflow showing retrieval, evidence grading, web search, generation, and answer grading

The graph is the control flow exported by this repository—not a conceptual architecture diagram.

How it works

  1. Route the question to the local vector store or Tavily web search.
  2. Retrieve and grade evidence before generation.
  3. Fall back to web search when retrieval is weak.
  4. Generate an answer and grade grounding and usefulness.
  5. Return, retry, or fall back through explicit bounded graph transitions.

Run locally

Requires Python 3.13 and Poetry:

poetry install
poetry run python main.py --question "What is agent memory?" --retry-count 2

Configure either Gemini or Ollama in .env:

LLM_PROVIDER=gemini
GEMINI_MODEL=gemini-2.5-flash
GEMINI_API_KEY=...
TAVILY_API_KEY=...

or:

LLM_PROVIDER=ollama
OLLAMA_MODEL=llama3.1:8b
TAVILY_API_KEY=...

Scope

This is a local reference implementation. It does not claim deployment, an API or UI, production use, automated test coverage, or measured answer-quality improvements.

About

Agentic RAG system with evaluation-driven control flow, LangGraph-style orchestration, and tool-based reasoning

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages