01

Retrieval is a decision

The adaptive RAG repository routes between local retrieval, web search, and direct answers. Questions do not all need the same path. An exact technical identifier benefits from lexical matching, while a paraphrased concept may benefit from semantic retrieval. Combining FAISS and BM25 gives the system two different ways to find evidence.

02

Relevant documents are not the same as grounded answers

Document grading asks whether evidence belongs in the context. Answer reflection asks whether the output is supported by that context and addresses the question. These checks occur at different points and catch different classes of failure. Neither is a proof that an answer is correct.

03

Recovery must be bounded

Query rewriting can recover a missed concept, but a loop without limits may consume time and tokens without improving evidence. The repository documents retry limits and web-search fallback. An explicit “insufficient evidence” outcome is preferable to manufacturing a confident answer.

04

Make the path inspectable

The Streamlit interface exposes graph transitions and retrieved sources. This gives a reviewer something concrete to inspect when an answer is weak. A future evaluation should compare quality and latency across a fixed set of questions rather than judge the system on one impressive example.

Implementation reference

This note explains the documented architecture and separates suggested evaluations from measured results.

Adaptive Corrective & Self-Reflective RAG — source repository ↗
Explore the project