# memsearch: Cross-Agent Semantic Memory Backed by Markdown and Milvus

> zilliztech/memsearch adds persistent, shared memory to AI coding agents by storing conversations as Markdown files and indexing them in Milvus for semantic search. Memories captured in Claude Code surface during sessions in Codex or DeepSeek Harness, and vice versa, without any extra configuration after the initial plugin install.

**zilliztech/memsearch** — A persistent, unified memory layer for all your AI agents (e.g. Claude Code, Codex, DSH), backed by Markdown and Milvus.

- Repository: https://github.com/zilliztech/memsearch
- Website: https://zilliztech.github.io/memsearch/
- Stars: 2,684 · Forks: 263
- Language: Python
- License: MIT
- Published: 2026-09-10 · Updated: 2026-09-10 · Language: en
- Canonical page: https://hysenlabs.com/projects/zilliztech-memsearch

## What memsearch Solves and for Whom

AI coding agents such as Claude Code, Codex, and OpenClaw do not share memory by default. A decision about a database schema discussed in a Claude Code session is not visible in a later Codex session, even if both are working on the same project. Each agent starts with a blank context. memsearch adds a persistent, cross-agent memory layer that captures conversations automatically and makes them retrievable through semantic search.

The README describes two distinct audiences. For agent users, installing a plugin is the only step required: the plugin handles capture and recall automatically with no further configuration. For agent developers building their own tools, memsearch exposes a CLI and Python API for integrating the memory and retrieval pipeline directly into a custom agent.

The project is developed and maintained by Zilliz, the company behind the Milvus vector database. memsearch uses Milvus Lite as its local vector index, meaning no external Milvus server is required for single-machine use.

## Markdown as Source of Truth: The Two-Layer Design

The design choice that defines memsearch is its storage model. Memories are stored as plain Markdown files, one per day by default, in a .memsearch/memory/ directory inside the project workspace. Milvus serves as a shadow index: a derived, rebuildable cache built from the Markdown content. The README describes this directly: if the Milvus index is deleted or corrupted, it can be rebuilt from the Markdown files.

This has practical implications for teams already using git. The .memsearch/memory/ directory can be committed to version control, reviewed in pull requests, and edited by hand if a stored memory is wrong or needs to be updated. A developer who wants to correct a stored fact can open the Markdown file and edit it; the Milvus index will sync the change through the file watcher.

Retrieval uses a three-layer recall process: initial search finds candidate memories, an expand step fetches surrounding context from the same conversation, and a transcript step retrieves the original raw exchange. Within each layer, the system combines dense vector search with BM25 sparse retrieval, then applies Reciprocal Rank Fusion (RRF) for final ranking. SHA-256 content hashing skips indexing for unchanged files, and a file watcher updates the index in real time when Markdown files change.

## Installing memsearch for Claude Code

For Claude Code users, memsearch installs as a plugin through the Claude Code plugin marketplace:

```bash
/plugin marketplace add zilliztech/memsearch
/plugin install memsearch
```

After restarting Claude Code, the plugin runs automatically. Every conversation turn is captured to a daily Markdown file in .memsearch/memory/.

To verify the installation is working after a few conversations:

```bash
ls .memsearch/memory/
cat .memsearch/memory/$(date +%Y-%m-%d).md
```

Memory recall can be triggered explicitly:

```
/memory-recall what did we discuss about Redis?
```

Alternatively, Claude Code auto-invokes the memory-recall skill when it determines that a question requires historical context. A natural-language question such as "We discussed Redis caching before, what was the TTL we chose?" will trigger the recall without the slash command.

The plugin documentation is at zilliztech.github.io/memsearch/platforms/claude-code/, with a separate troubleshooting guide for common setup issues.

## Installing for Codex, DeepSeek Harness, and Other Agents

For Codex users, installation uses a shell script from a shallow clone:

```bash
git clone --depth 1 https://github.com/zilliztech/memsearch.git
bash memsearch/plugins/codex/scripts/install.sh
```

After installation, memory recall is triggered with:

```
$memory-recall what did we discuss about deployment?
```

For DeepSeek Harness (DSH), the plugin installs via uv:

```bash
uv tool install "memsearch[onnx]"
dsh plugin --profile web add @zilliz/memsearch-dsh
```

The DSH integration includes a memory browser in the web profile interface where skill candidates and .memsearch/ file contents can be reviewed without editing them directly.

For OpenClaw, the installation is through ClawHub:

```bash
openclaw plugins install --force clawhub:memsearch
openclaw config set plugins.entries.memsearch.hooks.allowConversationAccess true
openclaw config set plugins.entries.memsearch.hooks.allowPromptInjection true
openclaw gateway restart
```

OpenClaw stores memory files per workspace: ~/.openclaw/workspace/.memsearch/memory/ for the main workspace, with separate paths for other named workspaces.

## Skills from Memory and Advanced Maintenance Features

Beyond episodic memory (what happened in past sessions), memsearch adds two higher-level memory features documented in the README.

Skills from Memory distills repeated workflows into installable agent skills. When memsearch detects that the same sequence of actions recurs across multiple sessions, it generates a reusable skill and installs it into the agent. The README describes this as a third procedural memory layer, distinct from episodic session memory and user profile memory.

Advanced Memory Maintenance runs optional background tasks that keep two persistent notes current across sessions: PROJECT.md tracks project-level context and decisions, while USER.md tracks user preferences and working patterns. These files are maintained automatically in the background and injected into the agent context at the start of relevant sessions.

Reranking is an optional feature: the README describes a Jev reranking integration that reranks memory search results through a TypeSafe API without requiring a local model download. The configuration and an evaluation comparing Chinese and English recall quality are documented in the project's docs/ directory.

## Comparison with Mem0 and Project Limitations

Mem0 (mem0.ai) is a hosted memory API service for AI applications. It provides a cloud-based memory store that multiple application instances can read and write through an API, making it well-suited for multi-user or multi-instance deployments where a shared persistent memory is needed across many users. Mem0 requires no local storage or local indexing.

memsearch takes the opposite approach: all memory is stored locally as Markdown files and indexed locally in Milvus Lite. This means no data leaves the machine, no external API is required, and the memory can be inspected and edited by the developer directly. The trade-off is that memsearch is single-machine by design. Memory captured in one developer's session is not automatically shared with a teammate's session.

The requirement to run Milvus Lite locally is a concrete dependency. Milvus Lite is a Python package that runs as an in-process or background service; it must be installed and operational for semantic search to function. On machines with strict policies on running additional services or on minimal container images, this adds complexity. The memsearch package supports Python 3.10 through 3.13 and requires Python as the runtime environment regardless of which agent it is used with. The pyproject.toml defines optional embedding backend extras: onnx (ONNX Runtime with tokenizers and huggingface-hub), local (sentence-transformers), anthropic, openai via the default dependency, google, voyage, jina, mistral, and ollama. The default installation uses the openai embedding API; the onnx extra enables a local embedding model without a network call at inference time.

## Conclusion

With v0.4.21 released on 2026-09-24, memsearch is actively developed. It suits developers who use multiple AI coding agents and want conversation history to carry between tools. The Markdown format keeps memories human-readable and version-controllable with git, but the Milvus vector index is a local background process that must be running for semantic search to work. Teams restricted from installing additional Python packages or running background processes should confirm both requirements are feasible before committing to the setup.

## FAQ

### What is memsearch and how does it differ from Mem0?

memsearch is a local, Markdown-backed memory layer for AI coding agents that indexes conversation history in Milvus for semantic recall. Mem0 is a hosted cloud API for AI memory, suited for multi-user applications. memsearch keeps all data on the local machine; Mem0 stores data on external servers. memsearch is open source under MIT; Mem0 is a commercial service.

### What is memsearch?

memsearch is a Python package that adds cross-agent persistent memory to AI coding tools including Claude Code, Codex, DeepSeek Harness, OpenClaw, and OpenCode. Conversations are stored as Markdown files and indexed in a local Milvus vector database, enabling semantic recall of past sessions across different agent tools.

### Does memsearch work across multiple AI coding agents?

Yes. Memories captured in a Claude Code session are searchable from a Codex or OpenClaw session, and vice versa. The Markdown files in .memsearch/memory/ are the shared source of truth across all supported agents, and the Milvus index is rebuilt from those files.

## Sources

- [License: MIT](https://github.com/zilliztech/memsearch/blob/main/LICENSE)
- [Project website](https://zilliztech.github.io/memsearch/)
- [README](https://github.com/zilliztech/memsearch/blob/main/README.md)
- [Releases](https://github.com/zilliztech/memsearch/releases)
- [zilliztech/memsearch on GitHub](https://github.com/zilliztech/memsearch)

---

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