# MemMesh: local-first agent memory in one Rust binary

> MemMesh gives AI coding agents durable, typed, searchable memory that stays on your machine. It is a single Rust binary with MCP support, a heuristic capture path and a local embedding model, and it is still at version 0.1.2.

**ThinkfleetAI/memmesh** — Persistent, self-improving memory for AI agents. Local-first Rust memory engine with MCP support.

- Repository: https://github.com/ThinkfleetAI/memmesh
- Stars: 422 · Forks: 442
- Language: Rust
- License: Apache-2.0
- Published: 2026-09-10 · Updated: 2026-09-10 · Language: en
- Canonical page: https://hysenlabs.com/projects/thinkfleetai-memmesh

## The problem MemMesh addresses, and who feels it

Agent frameworks treat memory as an add-on. The usual arrangement is a hosted vector store plus an extraction call to a language model for every message you want remembered. That gives you three things to operate: the agent, the vector database and the search service in front of it. It also means your notes, preferences and decisions leave the machine each time the agent decides something is worth keeping.

MemMesh inverts the arrangement. The README describes it as "one binary, one file, everything local", storing memories in SQLite by default at ~/.memmesh/memory.db, with Postgres supported through the sqlx dependency list in Cargo.toml. There is no separate vector database process to run and no mandatory LLM call on the write path. The audience is narrow and specific: developers running a local coding agent who want it to remember preferences and decisions between sessions without shipping that material to a vendor.

The scope claim is worth reading carefully. The open-source engine is fully local, but the README splits its tool table in two. Graph reasoning, point-in-time edge queries, anticipatory retrieval and context building are listed under hosted mode at memmesh.ai, not under the local engine. If those are the features you want, the local binary is the storage layer underneath a paid service, not the whole product.

## How capture, storage and retrieval actually fit together

The workspace in Cargo.toml names twelve crates, including core, embed, embed-server, storage, server, mcp, sync, audit, license, eval, cli and desktop. That layout tells you where the boundaries are: a CLI, an MCP stdio server, a storage layer over sqlx, and a separate embeddings path with its own server crate.

The write path has two modes. Explicit writes go through memory_save or the memmesh save command, where you supply scope, type, content and importance yourself. The primary path is memory_observe: you hand the engine raw text and a heuristic filter, built on the regex and once_cell dependencies, keeps what looks substantive and discards conversational filler. No model is consulted. That is the design's strongest privacy property and also its weakest accuracy property, since a regex-driven filter cannot understand a sentence, only pattern-match it.

Retrieval is hybrid. The README calls it "semantic + keyword hybrid", with embeddings computed locally by bge-small, a model of roughly 130 MB downloaded once into MemMesh's cache on the first observe or search. The time model is bi-temporal: the engine distinguishes when something happened from when you learned it, which is what makes point-in-time queries possible in the hosted tier. Deletion is soft by default and recoverable, and corrections run through memory_supersede, which keeps the old item for provenance rather than overwriting it.

## Installing MemMesh and storing your first memory

The README gives a prebuilt binary path that does not require a Rust toolchain. On macOS or Linux you pipe the install script to a shell; the repository also ships install.ps1 for Windows and an install.sh at the top level. Building from source is the alternative, and the workspace requires Rust 1.78 or newer.

```bash
curl -fsSL https://memmesh.ai/install.sh | sh
```

After that, one command wires the binary into every supported tool on the machine. It detects each tool, merges an MCP server block into its config without touching your other MCP servers, and places a teaching skill file where the tool expects it.

```bash
memmesh install
```

The README lists the targets: Claude Code at ~/.claude.json with a skill at ~/.claude/skills/memmesh/SKILL.md, Cursor at ~/.cursor/mcp.json with a rule at ~/.cursor/rules/memmesh/SKILL.md, Windsurf at ~/.codeium/windsurf/mcp_config.json, and Codex CLI at ~/.codex/config.toml. Restart the host tool afterward so it reloads its configuration. Flags include --dry-run, --tool <id>, --mcp-only, --no-hooks and --force; --dry-run is the one to run first if you care about what gets written into those config files.

With the server wired in, you can write and query from the shell. The first call downloads the embedding model, so expect a pause before output appears.

```bash
memmesh observe --content "Ryan prefers pnpm over npm for all projects."
memmesh search  --query   "which package manager"
```

The search returns the stored memory even though the query shares no words with it, which is the clearest demonstration that semantic retrieval is working. To turn that off, set the provider to none in the configuration, and the engine falls back to keyword and recency ranking only.

## The hooks are the interesting part, and the risky one

On Claude Code, memmesh install also writes two hooks. UserPromptSubmit pipes every prompt into memmesh observe, so the heuristic filter decides what is worth keeping rather than the agent. SessionStart runs memmesh search with the claude-context format, injecting relevant memories back into the context when a new session opens.

The README frames this as "fire the whole conversation at memory and let the engine curate it". The trade-off is real. You stop deciding what to remember, and you inherit whatever the regex filter considers substantive. A preference stated in an unusual phrasing may be dropped; a throwaway sentence that happens to match the filter's patterns may be kept. Because nothing leaves the machine, the failure mode is noise in your own database rather than a privacy incident, and memmesh consolidate --dry-run exists to collapse near-duplicates before you commit to the merge. Run the dry run on real data before trusting the filter.

If you would rather stay explicit, --no-hooks skips both hooks and leaves you calling the memory tools yourself. The same pattern can be wired into Codex or a custom agent by piping raw text to memmesh observe --json and reading memmesh search --format claude-context, though the README does not document those integrations beyond the suggestion.

## Where MemMesh is the wrong choice

Version 0.1.2, released on 2026-08-06, is three releases into the project's life, and the API surface shows it. Tool names have legacy aliases, the README notes underscore names are canonical while dot names are accepted for compatibility, and the repository root carries a file named RESTORE-thinkfleet-memory.txt. Treat the schema and the tool names as moving.

The bigger boundary is the feature split. If multi-hop reasoning over a knowledge graph, point-in-time edge queries or anticipatory retrieval are what you need, the open-source engine does not provide them. The README places those under hosted mode. The local binary also does not call an LLM: memory_extract_pending and memory_commit_extraction exist so that your own model, your own key and your own rate limit do the knowledge-graph extraction. If you were expecting the engine to enrich memories on its own, it will not.

One more constraint: the default store is a single SQLite file at ~/.memmesh/memory.db. That is the point of the design, but it also means memory is tied to one machine unless you use the sync crate, whose behaviour the README does not describe. Teams that need shared memory across machines should confirm that path before committing.

## How it differs from a hosted memory service

The obvious comparison is a hosted agent-memory API, where you send text and receive back extracted, embedded memories. The difference is not just deployment location; it is where the intelligence sits. A hosted service runs an extraction model on its own infrastructure and returns structured results. MemMesh runs a regex filter locally and leaves extraction to a client-side model you supply through memory_extract_pending and memory_commit_extraction.

That changes the cost model and the failure model together. There is no per-message bill, because there is no per-message call. There is also no server-side model improving your captures, so the quality of what gets stored depends on the heuristic filter and, if you wire it up, on the model you run yourself. For a solo developer with a local agent, that is a reasonable exchange. For a team that wants memory quality handled for them, it is not.

The second difference is protocol. MemMesh is MCP-native and installs into four named tools with one command, rather than requiring a framework-specific SDK. If your agent speaks MCP, integration is a config merge. If it does not, you are writing the glue.

## Licence, maintenance and what an upgrade costs

MemMesh is Apache-2.0, and the workspace package metadata sets publish = false, so the crates are not published to crates.io under this workspace. The repository also contains a license crate alongside sync and audit, which suggests licensing logic is part of the codebase rather than only a file at the root. Apache-2.0 permits commercial use and modification, but the hosted tier at memmesh.ai is a separate service with terms the README does not state. That is a question for the project, not for a licence file.

On maintenance, the last push to main was on 2026-08-25, and the repository is not archived. Three releases landed between 2026-07-22 and 2026-08-06. The project is moving, but the version number and the legacy tool aliases mean upgrades can require attention: if dot-named tools are deprecated later, configurations written today will need editing. The --force flag on memmesh install exists for re-running the wiring, which is the practical upgrade path when the MCP block or skill file changes.

There is no documented rollback for a schema migration. memmesh migrate is described as safe to repeat, but the README does not say what happens if a migration is wrong. Back up ~/.memmesh/memory.db before upgrading across minor versions.

## Conclusion

Adopt MemMesh if you run Claude Code, Cursor, Windsurf or Codex locally and want agent memory that never leaves the machine, and you accept a 0.1.x engine whose graph reasoning and context-building tools live only in the hosted tier. Skip it if you need a stable schema across releases, a managed service with an SLA, or memory that follows you across machines without the sync crate. Verify first that the prebuilt binary and the bge-small download work on your platform, then run memmesh consolidate --dry-run on real data before trusting the heuristic capture filter.

## FAQ

### Does MemMesh send my memories to a server?

No. The README states that capture is heuristic and local, retrieval uses a local embedding model, and no API calls are made by the open-source engine. The first observe or search downloads bge-small, roughly 130 MB, into MemMesh's cache, and nothing leaves the machine.

### Which AI tools can MemMesh install into?

The README lists Claude Code, Cursor, Windsurf and Codex CLI, each with its own MCP config path, and memmesh install merges an MCP server block into those files without touching your other MCP servers. You need to restart the host tool afterward so it reloads the config.

### Can I use MemMesh without semantic search?

Yes. Semantic search is on by default, but setting the embeddings provider to none switches the engine to pure keyword plus recency ranking, which also avoids the bge-small model download.

## Sources

- [Issues](https://github.com/ThinkfleetAI/memmesh/issues)
- [License: Apache-2.0](https://github.com/ThinkfleetAI/memmesh/blob/main/LICENSE)
- [README](https://github.com/ThinkfleetAI/memmesh/blob/main/README.md)
- [Releases](https://github.com/ThinkfleetAI/memmesh/releases)
- [ThinkfleetAI/memmesh on GitHub](https://github.com/ThinkfleetAI/memmesh)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/thinkfleetai-memmesh
