Mimir.
Bounded task context for agents, built on Basic Memory.
Problem.
Each new agent session repeated the same bootstrap, search and read sequence. Follow-up questions often pulled in the same notes again. I wanted agents to receive the guidance they needed, see what had changed and retain useful context without treating an old excerpt as current operational truth.
Implementation.
- 01
Built get_task_context on Basic Memory's Markdown storage, indexing, search and MCP engine. It combines required notes, directory-scoped search and canonical reads under an explicit prose budget. Required guidance is returned in full or the request fails clearly.
- 02
Added caller-held revision receipts. A follow-up rechecks selected content and omits unchanged prose while preserving identity and truncation metadata. Receipts travel with their excerpts and must be discarded when that context is lost. Backend reads still happen, and response metadata sits outside the prose budget.
- 03
Used real MCP-client trials to find a compatibility issue: indexed Markdown could exist without accepted database content. Added the existing resource-read fallback for that specific state while preserving valid empty content and real errors.
- 04
Added focused CI and a pull-based release process with immutable revisions, health/context probes and recovery checks. Integrated a later Basic Memory release through copied-data rehearsal, matched backups and an attended schema migration.
- 05
Deployed a separate owner-only HTTPS/OAuth beta with an isolated curated corpus and only context, search and read tools. Private knowledge stays separate; direct mutation calls are rejected.
Result.
Mimir became the shared memory service for the reachable agent clients and operational assistant. A recorded live code rollback and forward upgrade preserved a post-cutover note's identity and revision. The later upstream migration preserved existing note identities, Markdown and accepted content. The read-only beta adds authenticated remote access to selected material; a general multi-user product remains future work.
Recorded focused retrieval tests and MCP-client checks, with 100% coverage scoped to the retrieval/schema code rather than the whole repository. CI promotion, live context probes, a code rollback drill, copied-data migration and the attended upgrade are documented separately. Beta verification covers tool discovery, direct mutation denial, OAuth protocol checks and unchanged note bytes; it does not establish every client integration or a public product launch.
What I learned.
Returning fewer repeated words is a concrete improvement; it does not prove a general latency or token-saving percentage. The first small fixture response was larger because of metadata. Recovery also changes at a schema boundary: a code-only rollback must refuse an incompatible database, and restoring old data requires preserving and reconciling later writes.
Questions about this project?
Email Binh ↗