← LabInternal productKnowledge systems

Coding Agent Memory Harness

Problem

Teams using coding agents generate thousands of conversations full of decisions, fixes, and dead ends - then throw them away. Git records what changed; nothing records why.

What we built

The core: index everything

A native Rust app that indexes every coding-agent conversation across six harnesses - Claude Code, Codex CLI, Cursor, OpenCode, Gemini CLI, Windsurf - and makes them searchable with hybrid full-text + vector retrieval, reranked for accuracy. Built almost entirely by coding agents, orchestrated by us.

Custom memories

Memory types shaped to your organisation - decisions, postmortems, runbooks, sagas - with structured payloads, not freeform notes. Your ontology, not ours, editable per scope.

Cross-user sync

Memory structures sync across machines and teammates - and optionally session history too. When Dan, who wrote all of Team X's auth and knows its every quirk, is on vacation and an urgent fix lands: load up his shared memory, and your agents now carry every caveat Dan hit in development.

Tenets: cross-harness system-prompt shapes

Standing rules injected into every new session, on every harness - "always X, never Y" written once, enforced everywhere your team's agents run.

Shaper

A specialised agent launcher with an admin toolset for editing and onboarding organisations - memory types, scopes, and rules configured conversationally instead of through config files.

Findings

Retrieval quality

On a 598-query LLM-judged diagnostic (Qwen + Opus judges, 91.4% agreement), cross-encoder reranking improved 31.6% of queries and regressed 3.3%. Graded hit-rate@5 rose from 0.707 to 0.879 on held-out test.

The latency journey

Hybrid baseline: ~39ms. Naive full-corpus rerank: 22 seconds. Two-stage shortlist: ~830ms. After fixing a macOS process-priority bug: ~398ms. The reranker itself: MiniLM/SQuAD2, 33k training pairs, INT8-quantized to 32 MB.

Worth it

Ten times the latency of bare retrieval, and the right trade - for knowledge search, a wrong-but-instant answer costs more than a right-but-400ms one.

649,638

messages indexed from real agent sessions

1,553,706

rows synced across machines - zero pending

17

custom memory types in the ontology

Reranker latency journey

Median per-query rerank latency across three implementations - log scale.

What reranking changed (598 queries)

Improved 31.6%
Unchanged 65.1%
Regressed 3.3%
LLM-judged per-query outcomes, cross-encoder rerank vs hybrid baseline (Qwen + Opus judges, 91.4% agreement).

Use cases

Any team whose agents work across sessions: engineering orgs with multiple coding agents that need shared memory, support teams searching past resolutions, consultancies recovering why a decision was made months ago. The pattern generalises - hybrid retrieval plus a small fine-tuned reranker fits anywhere search quality matters more than a few hundred milliseconds: internal wikis, support knowledge bases, agent context recall.