BRAG
BOOSTED RETRIEVAL AUGMENTED GENERATION
RAG with two skeptics that try to disprove every answer before you read it.
HOW IT WORKS
An answer has to survive two skeptics
- IN / OUT
- CODE
- AI MODEL
- CHECKPOINT
- IN Question about 10 years of Netflix filings
- AI MODEL Plan the evidence slots a good answer needs
- GATHER, TWO CHANNELSCODE Hybrid search BGE-small + BM25CODE Numbers straight from XBRL
- AI MODEL Draft the answer
- CHECKPOINT Verifier checks against evidence
- CHECKPOINT Refutation agent hunts for contradictions
Evidence too thin? It says so
- OUT Answer dated sources · audit trail
Simplified. The full story is on the project site.
The problem
Standard retrieval-augmented generation finds a few passages that look relevant and writes an answer from them. If the passages are old, partial, or contradicted somewhere else in the record, the answer is confidently wrong.
Ask a typical RAG system whether Netflix planned to run ads, and it may tell you no. That was true, until 2022.
What I built
BRAG puts two skeptics between retrieval and the answer. It was built and tested on ten years of Netflix SEC filings and earnings calls.
How it works
- Plan the evidence. Each question is broken into the pieces of evidence a good answer would need.
- Retrieve two ways. Hybrid search (dense embeddings with BGE-small, plus BM25 keyword search) fills those slots.
- Try to disprove it. A Verifier checks the draft against the evidence. A separate Refutation Agent goes looking for anything that contradicts it.
- Keep numbers separate. Figures come through a deterministic channel straight from XBRL financial data, never from a model’s memory.
The result
Answers carry dated sources, disclose contradictions in the record, and come with a full audit trail. When the evidence doesn’t clear the bar, BRAG says so instead of guessing. On the Netflix question, it finds the 2022 reversal.