Revelin7Revelin7
All work
Lab note

We Stopped Tuning the Model. We Tuned the Memory.

Most recall failures were retrieval failures. Storing retrieval instructions as memories, and compiling them into a master rule, fixed them without touching the model.

75% to 94%
keyword recall, same LLM, same corpus
949
memories from 52 legal documents
20
evaluation queries, 3-5 expected keywords each

For an agent recalling its own stored knowledge, we found the retrieval configuration mattered more than the model. We held the LLM, the embeddings and the data fixed and changed only how recall was called.

Setup

We indexed 52 legal documents (contracts, board minutes, vendor assessments, compliance policies, risk registers, incident reports) into 949 memories and wrote 20 questions a legal team would ask. Each had 3 to 5 expected keywords, matched strictly with no partial credit. Default settings (similarity strategy, k=5, default weights) scored 75%.

Four things changed

  • Query construction: expand acronyms, add entity names and specifics. "SOC2 policy" became "SOC 2 Type II audit findings access controls Cloudvault". This was the largest single gain.
  • Result depth: k=5 to k=10 for complex queries. Supporting facts sat in results 6 to 10.
  • Strategy: temporal or analogical recall where pure similarity was the wrong tool.
  • Scoring weights: recency-heavy for timeline questions, importance-heavy for compliance. This closed the last gaps.

The agent runs the loop

We did not hand-tune the 20 queries. A tuning skill lets the agent profile the domain, generate evaluation queries from the corpus, run a baseline, classify each failure, apply a fix and re-score. It then stores what it learned as ordinary memories:

RETRIEVAL-INSTRUCTION: For compliance queries, always expand
acronyms and include the vendor name in the cue. Use k=10 minimum.

RETRIEVAL-INSTRUCTION: For timeline queries, use temporal strategy
with recency weights 0.3:0.5:0.2:0. Always scope to entity-id.

MASTER-RULE: Default k=10 for all non-trivial queries. Only use
k=5 for simple factual lookups with unique entity names.

These instructions are recalled before queries in later conversations. After 2 to 3 tuning sessions the agent compresses them into master rules and exports them to a markdown file that loads before the first tool call. Because the rules are memories, they are reinforced when recalled and decay when they stop being used.

Reading the number

The gain depends on the embedding model and the eval set. The engine README reports the same loop at 54% to 84% with local embeddings and 75% to 90% with OpenAI embeddings, and the research write-up documents a run at 59% to 88%. The direction is consistent across runs; the absolute figures are per corpus and should be re-measured on yours. The loop needs a memory layer that exposes strategy, weights and k per call and lets the caller score its own results.

Date

27 March 2026

Part of

HEBBS

Source

HEBBS blog

Topics

Open the original

Related