Why I Moved Audit Context Out of Prompts, Into Hindsight

Nobody could tell me exactly what our audit-drafting model had been told the last time it ran. In an audit program, that is a control gap.

How the prompt grew

Every time the model missed a prior finding, I added another loader to the prompt builder:

parts = [RULES, RUBRIC] parts += [r.full_text for r in load_reports(last_n_quarters=4)] parts += [f.to_text() for f in load_findings(control_id)] 

I thought I was adding context. I was building a database inside a string, with no schema and no ordering. It failed three ways: cost grew with history instead of relevance, old and corrected statements competed as equals, and I could not reproduce what the model had seen.

The move

I moved history into Hindsight, an open-source agent memory system. The prompt keeps only the rules, rubric and new evidence. Past facts are retained as dated events and recalled on demand:

client.retain(bank_id="audit-ops", content=text, timestamp=occurred_at.isoformat()) memories = client.recall(bank_id="audit-ops", query=f"Prior findings and status for control {control_id}") 

Recall combines semantic, keyword, graph and temporal search, so AC-2 and "last quarter" both work. Logging what was recalled next to each draft gave me an audit trail stuffed prompts never could. The Hindsight docs cover the details.

Result

Asked to draft a backup-restore finding, the system now surfaces the Q2 finding, the one completed test and the missing second test. It suggests a recurrence and leaves classification to the reviewer.

Lessons

  1. A prompt is working memory, not storage.
  2. Make retrieval a visible, loggable step.
  3. Store order as real timestamps.
  4. Test recall against known history.
  5. Memory is not the system of record, and the rubric still belongs in the prompt.

That is the case for agent memory over ever-longer prompts.