The MentisDB Agent Memory Cookbook — How to Make Coding Agents Remember
We just published the The MentisDB Agent Memory Cookbook: a practical guide to using MentisDB with coding agents, MCP harnesses, and custom applications that need durable memory.
Read the The MentisDB Agent Memory Cookbook →The cookbook exists because most people do not start by writing a custom agent. They start with a coding harness: OpenCode, Codex, Claude Code, Cursor, Claude Desktop, or another MCP client. The hard part is not just connecting the tool. The hard part is teaching the model when to search memory, when to append a new memory, what to skip, and how to checkpoint so tomorrow's session starts smarter than today's.
The core lesson: "use MentisDB" is not enough. Good agent memory is an operating loop: bootstrap, read the skill, load recent context, search before work, distill durable lessons, append typed thoughts, and checkpoint before context loss.
What is inside
The cookbook is organized around how people actually adopt MentisDB:
- Foundations — why agent memory matters, the MentisDB mental model, quickstart, and search-first discipline.
- Operator Playbook — prompts, daily memory loop, what to save vs skip, and how to make OpenCode/Codex/Claude Code squeeze value out of MentisDB.
- Core Patterns — episodic task memory, handoff, long-running projects, preference learning, and mistake memory.
- Advanced Patterns — semantic compression, dynamic skills, webhooks, and federated team memory.
- Production Hardening — embedding provider selection, vector sidecars, retrieval tuning, benchmarking, and deployment.
- Harness Guides and Recipes — OpenCode, Claude Code, Codex, Cursor, TypeScript MCP, Python, Rust, CLI, and dashboard workflows.
The operator playbook is the center
The most important new chapter is 1.0 Operator Playbook for Coding Agents. It is written for regular users running a coding agent through MCP. It gives copy-paste prompts for starting a task, debugging a failure, recording a durable lesson, writing a checkpoint, and deciding when a repeated lesson should become a skill.
For example, a good session starts like this:
Use MentisDB as your durable memory system for this repository.
Before doing work:
1. Find or bootstrap the correct project chain.
2. Read the core MentisDB skill/instructions.
3. Load recent context and the latest checkpoint.
4. Search for prior decisions, constraints, mistakes, and lessons related to this task.
5. Tell me what you found before editing files.
That one habit changes the agent's behavior. It stops treating every session as a cold start. It starts seeing old decisions, failed fixes, constraints, user preferences, and verification history before it edits files.
Cookbook-as-test
The cookbook is also wired into CI. Rust examples are extracted from the HTML and compiled by
cargo test --test cookbook_tests --all-features. If the public API drifts, cookbook
examples fail before they ship.
That matters because memory documentation is only useful if the examples are real. We already used the pipeline to catch stale APIs while writing the book, and it now protects future edits.
Why this matters
Without durable memory, coding agents are brilliant in the moment and amnesiac by design. With a good MentisDB operating loop, the same tools accumulate context: decisions, traps, preferences, task completions, and skills. The model is still the model, but the session begins with better evidence every day.
Start here: The MentisDB Agent Memory Cookbook.