BRAG: Bayesian retrieval augmented generation
Read first: Is Complex Agentic Memory Always Needed? Naive RAG Is Stronger Than We Thought · MemGPT: Towards LLMs as Operating Systems
Intuition. Standard RAG indexes are amnesiac: even if an AI agent answers hundreds of queries over nine months of personal memory, the retriever treats every chunk identically on day 270 as on day 1—and when a user updates a fact or asks the assistant to forget an old preference, static feedback methods (like Rocchio or NUDGE) keep surfacing the heavily reinforced stale chunk. BRAG (Apple) puts a lightweight Bayesian filter directly on top of a vector index: every chunk keeps a decaying Beta belief over its usefulness plus a compact mixture of query keys it has answered. Unused or obsolete memories naturally relax toward a low equilibrium prior, while freshly confirmed memories adapt cleanly.
Source: arXiv, submitted November 23, 2026 (HTML full text), by Javier Movellan, Manjot Bilkhu, Young-mok Jung, Sirajul Salekin, Henry Tran, and Zhao Huang (Apple).
First read: focus on the two-variable generative model (OU logit utility + vMF key mixture), why existing feedback methods fall out as static special cases, and the nuanced trade-offs between BRAG and BRAG+ in Table 2. Skip the Laplace-bridge moment-matching algebra on a first pass.
Generative model and closed-form filtering
Section titled “Generative model and closed-form filtering”BRAG assumes each query is answered by one latent chunk, with two per-chunk states:
- Dynamic utility : the probability chunk answers the next query. Its logit evolves as an Ornstein–Uhlenbeck (OU) process toward a low equilibrium with half-life (): A Laplace bridge projects this onto a two-scalar Beta belief (mean , effective sample size ). During the predict step, precision relaxes toward equilibrium via (moving toward , not strictly downward—e.g., the personal-memory setup starts at with ). On an explicitly observed curator outcome , Beta–Bernoulli conjugacy updates in closed form; in the paper’s reported experiments, only positive labels are applied, while unlabeled chunks take only the predict step.
- Adaptive query keys : each chunk carries a von Mises–Fisher (vMF) mixture initialized at its original embedding, , updated via batch EM over accumulated positive queries (§4, Appendix B.4; streaming EM is noted as an alternative).
Retrieval as control: the posterior responsibility of chunk for query is , where is the posterior odds of utility. Choosing which chunks to return under discount factor defines a control spectrum: greedy reranking (, oversampling ANN candidates and reranking down to by —evaluated in the paper), Thompson sampling (), and RL ().
Unification (§7): fixing utility dynamics (, uniform ) recovers Rocchio, query averaging, and NUDGE (single key) as well as LADER (one key per past query); fixing keys recovers frequency reranking.
Empirical results: where BRAG wins—and the BRAG vs. BRAG+ trade-off
Section titled “Empirical results: where BRAG wins—and the BRAG vs. BRAG+ trade-off”All figures are author-reported across a 9-month personal agent store (20,640 chunks, 281 held-out queries), LongMemEval-M (301 questions), PersonaMem-v2 (200 personas, 3,288 queries), 3 of NUDGE’s 7 text benchmarks, and TripClick (§6.4):
- 9-month personal agent memory: Recall@5 rises 0.747 → 0.977 and Recall@1 rises 0.438 → 0.969, while 72 never-trained control chunks stay virtually untouched (0.669 → 0.661).
- Public long-term memory benchmarks (Table 2, Recall@5 and new-ranked-above-old):
| Method | LME-M asked again | PMv2 asked again | PMv2 never asked (control) | LME-M update (obsolete) | PMv2 forget (obsolete) | Avg R@5 | New > Old (LME-M / PMv2) |
|---|---|---|---|---|---|---|---|
| Plain search | 0.697 | 0.426 | 0.444 | 0.711 | 0.673 | 0.590 | 0.528 / 0.236 |
| Rocchio / NUDGE-N / LADER | 0.856–0.858 | 0.657–0.661 | 0.362–0.390 | 0.711 | 0.669 | 0.652–0.658 | 0.047–0.485 / 0.005–0.007 |
| BRAG (pure filter) | 0.858 | 0.658 | 0.320 | 0.860 | 0.801 | 0.699 | 0.557 / 0.567 |
| BRAG+ (gated + curator transfer) | 0.858 | 0.650 | 0.424 | 0.851 | 0.850 | 0.727 | 0.843 / 0.540 |
- End-to-end LLM answers: feeding BRAG’s retrieved chunks instead of plain search lifts LongMemEval-M LLM answer accuracy from 0.55 to 0.70.
- NUDGE text benchmarks (§6.3): evaluated on 3 of NUDGE’s 7 benchmarks—BRAG beat the stronger NUDGE variant on FEVER and NQ and tied statistically on NFCorpus (the remaining 4 benchmarks were not tested).
Nuances and limitations
Section titled “Nuances and limitations”- BRAG vs. BRAG+ trade-off: pure BRAG drops on PersonaMem-v2 never-asked chunks (
0.444 → 0.320). BRAG+ adds a similarity gate (0.320 → 0.424) and a curator LLM that transfers an obsolete chunk’s keys and utility to its replacement (0.557 → 0.843new-above-old on LME-M,0.801 → 0.850PMv2 forget,0.699 → 0.727average)—but scores slightly lower than pure BRAG on three columns: PMv2 new-above-old (0.567 → 0.540), LME-M update (0.860 → 0.851), and PMv2 asked again (0.658 → 0.650). - Curator noise & candidate depth: §6.2 tests injected/missing labels, and Appendix A.1 replaces gold labels with a Qwen LLM curator on 50 PersonaMem-v2 personas—where BRAG’s asked-again Recall@5 drops from 0.664 to 0.489. On TripClick (§6.4), LADER leads BRAG+ at larger candidate depths.
- Greedy-only & modeling scope: experiments evaluate only the greedy policy () with single-chunk query generation, independent chunks, and positive-only updates; Thompson sampling and RL exploration remain theoretical.
Connection to the rest of the track: Bridges Raw-RAG and MemGPT by showing how to make a flat vector store adapt over months—and handle memory obsolescence—without rewriting the underlying embeddings or maintaining a brittle bespoke memory graph.
Questions to think through
These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.
- Derive / compute
In BRAG, each chunk i maintains a Beta belief over its latent utility X_t^i ∈ (0, 1) parameterized by mean e_t^i and effective sample size n_t^i, and its posterior responsibility for query q_t is γ_t^i ∝ r_t^i φ^i(q_t), where r_t^i = e_t^i / (1 − e_t^i) is the posterior odds and φ^i(q_t) is the vMF mixture density. (a) Derive the exact closed-form Beta–Bernoulli update to (e, n) after an explicitly observed positive (y_t^i = 1) vs. explicitly observed negative (y_t^i = 0) label. (b) Using the predict-step precision equation 1/n' = a²/n + (1 − a²)/n̄ (with a = 2^{−1/h}), explain how unused chunks behave when n > n̄ vs. n < n̄, and why an obsolete frequently used chunk no longer permanently outranks a fresh replacement.
What a strong answer covers
- (a) With Beta(α, β) where α = n e and β = n(1 − e), an explicitly observed outcome y ∈ {0, 1} adds 1 to n (n' = n + 1) and shifts the mean to e' = (n e + y)/(n + 1). Note that in the paper's reported experiments, only positive labels are applied; unlabeled chunks take only the predict step rather than a y = 0 update.
- (b) Between uses, logit utility contracts exponentially toward a low equilibrium l̄ with half-life h (a = 2^{−1/h}), while precision relaxes toward the equilibrium effective sample size n̄ via 1/n' = a²/n + (1 − a²)/n̄: n moves *toward* n̄ (down if n > n̄, or up if initialized below n̄, e.g., n = 10 toward n̄ = 20 in the personal-memory setup).
- Consequently, an obsolete heavily boosted chunk's posterior odds r_t^i = e/(1 − e) decay back toward the low equilibrium prior—whereas static methods (Rocchio, frequency rerank, NUDGE, LADER) preserve accumulated boosts forever, keeping the stale chunk above a newly arrived update.
- Mechanism
Section 7 proves that Rocchio feedback, regularized query-centroid averaging, frequency reranking, NUDGE, and LADER are all special cases of BRAG. State what parameters each baseline freezes, and explain why they all match BRAG on "asked again" queries (0.852–0.858 on LongMemEval-M) yet stay stuck at plain-search Recall@5 (0.67–0.71) when facts change.
What a strong answer covers
- Rocchio / query averaging / NUDGE freeze utility dynamics (no OU decay, uniform utility odds) and collapse each chunk's query distribution to a single key vector (one vMF component moved toward past positive queries).
- LADER freezes utility dynamics and stores one key per past query (non-parametric mixture) rather than a compact EM-fitted vMF mixture.
- Frequency reranking tracks hit counts without decaying utility or adapting query keys.
- When facts are stationary ("asked again"), moving keys toward past paraphrases accounts for nearly the entire gain (0.697 → ~0.858 LME-M; 0.426 → ~0.66 PMv2). When a new chunk obsoletes an old one, no past feedback exists for the fresh chunk, so static key-shift methods cannot promote it—only BRAG's utility dynamics lift new-chunk Recall@5 to 0.860 (LME-M) and 0.801 (PMv2).
- What if…
Inspect Table 2 closely: pure BRAG lifts LongMemEval-M update Recall@5 from 0.711 to 0.860 and PersonaMem-v2 forget from 0.673 to 0.801, yet drops on PersonaMem-v2 "never asked" control queries from 0.444 (plain search) down to 0.320. Explain the two additions defining BRAG+, where BRAG+ wins over pure BRAG, and the three columns where BRAG+ actually scores slightly *worse* than pure BRAG.
What a strong answer covers
- BRAG+ adds (1) a similarity gate applying learned chunk state *only* near a chunk's learned keys—recovering PMv2 "never asked" Recall@5 from 0.320 → 0.424 (near plain search's 0.444)—and (2) a curator LLM that transfers an obsolete chunk's keys and utility to its replacement, raising LME-M "new > old" from 0.557 → 0.843, PMv2 forget from 0.801 → 0.850, and overall average from 0.699 → 0.727.
- However, BRAG+ is not a uniform win over pure BRAG—it drops slightly on three Table 2 columns: PMv2 "new > old" (0.567 → 0.540), LME-M update Recall@5 (0.860 → 0.851), and PMv2 "asked again" (0.658 → 0.650).
- Lesson: gating protects untouched memories and curator transfer strongly improves factual-update top-1 ordering on LME-M, but explicit LLM transfer does not uniformly beat pure Bayesian decay on forget-style preference overrides (PMv2).
- Design
BRAG frames retrieval as a sequential control problem with discount factor β ∈ [0, 1), spanning greedy reranking (β → 0, evaluated in the paper), Thompson sampling (β → 1), and RL (0 < β < 1), while reranking an oversampled pool of mK ANN candidates down to K. You are deploying BRAG in a long-running personal assistant where curator feedback comes from an imperfect LLM judge. Decide between greedy BRAG vs. BRAG+ vs. Thompson sampling, and specify the concrete experiment and metric that would flip your deployment choice.
What a strong answer covers
- Candidate pool & greedy policy: greedy reranking (β → 0) oversamples mK ANN candidates before reranking to K (so promoted chunks can enter top-K), adding minimal latency while avoiding showing low-probability exploratory chunks to the user.
- Curator-noise risk: Appendix A.1 shows that replacing gold labels with a Qwen LLM curator on 50 PersonaMem-v2 personas drops BRAG's asked-again Recall@5 from 0.664 to 0.489; start with gated BRAG+ (protecting never-asked memories) plus a confidence threshold on curator labels rather than raw BRAG.
- When to flip to Thompson sampling (β → 1): because feedback is observed only on surfaced candidates, if offline replay shows high-uncertainty new chunks (small n) are starved of exposure despite being in the mK pool, test Thompson sampling over a bounded exploration slot (e.g., 1 of K slots) and measure 30-day cumulative answer accuracy.
- Critique
Evaluate the empirical scope and modeling boundaries of BRAG across its four experimental settings: the 9-month personal agent memory, LongMemEval-M / PersonaMem-v2 (including Appendix A.1 noisy-curator tests), the 3 tested NUDGE benchmarks, and TripClick (§6.4).
What a strong answer covers
- NUDGE coverage: the paper evaluated BRAG on **3 of NUDGE's 7** text benchmarks (NFCorpus, FEVER, NQ), where BRAG beat the stronger NUDGE variant on FEVER and NQ and tied statistically on NFCorpus; the remaining 4 NUDGE benchmarks were untested.
- Noisy-curator degradation: while §6.2 tests injected/missing labels and Appendix A.1 tests a Qwen LLM curator on 50 PersonaMem-v2 personas, asked-again Recall@5 falls sharply from 0.664 (gold) to 0.489 (Qwen curator), showing sensitivity to real-world curator errors.
- Candidate-depth trade-off (§6.4): on TripClick, LADER leads BRAG+ at larger candidate depths, indicating compact vMF mixtures do not dominate non-parametric per-query caches everywhere.
- Modeling scope: the generative model assumes single-chunk query generation and independent chunks, batch-refits EM over accumulated positive queries (streaming EM is noted as an alternative), and evaluates only the greedy policy (β → 0) empirically.