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.
The graph is the control flow exported by this repository—not a conceptual architecture diagram.
- Route the question to the local vector store or Tavily web search.
- Retrieve and grade evidence before generation.
- Fall back to web search when retrieval is weak.
- Generate an answer and grade grounding and usefulness.
- Return, retry, or fall back through explicit bounded graph transitions.
Requires Python 3.13 and Poetry:
poetry install
poetry run python main.py --question "What is agent memory?" --retry-count 2Configure 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=...
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.
