zilliztech/memsearch

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

What is memsearch?

memsearch is a cross‑platform, open‑source tool that gives AI coding assistants (Claude Code, Codex, DeepSeek Harness, OpenClaw, OpenCode, or any custom agent) a persistent, searchable memory. It records every conversation turn in plain‑text Markdown files, indexes them with Milvus, and lets the agent retrieve relevant past notes on demand.

Who is it for?

  • Agent users – install a tiny plugin for your favourite coding assistant and get automatic capture and recall of past chats without any extra setup.
  • Agent developers – use the provided CLI or Python library to embed the same memory engine in your own bots, RAG pipelines, or harness‑engineering projects.

Core ideas

Idea How it works
Source of truth All memories are stored as human‑editable .md files (e.g., memory/2024‑11‑20.md).
Shadow index A Milvus vector store (default Milvus Lite, or Zilliz Cloud) indexes the chunks for fast semantic search.
Hybrid retrieval Combines dense embeddings, BM25 sparse matching, and Reciprocal Rank Fusion (RRF) reranking.
Progressive recall Search → expand to the full markdown section → optionally fetch the original transcript.
Live sync A file‑watcher watches the markdown folder, re‑chunks only changed parts (SHA‑256 dedup).
Optional remote reranking Results can be reranked via Jev’s TypeSafe API without downloading a model.
Procedural memory Repeated workflows can be distilled into installable skills (Agent Skills standard).
Background maintenance Optional tasks keep PROJECT.md (project state) and USER.md (personal preferences) up‑to‑date.

Main features

  • Zero‑config plugins for five major coding agents. After installing the plugin, conversations are captured automatically and can be recalled with a simple command like /memory-recall … or by asking naturally.
  • Embedding providers – default ONNX bge‑m3 runs locally for free; you can switch to OpenAI, Ollama, etc.
  • Milvus back‑ends – Milvus Lite (single‑file) for quick start, Zilliz Cloud (managed) or self‑hosted Milvus via Docker for larger teams.
  • Skill distillation – turn a captured workflow into a reusable command that the agent can invoke later.
  • CLI & Python API – memsearch index, memsearch search, memsearch config … etc., plus a library (import memsearch) for programmatic use.
  • Hybrid search – dense vector + BM25 + RRF gives better relevance than plain vector search.
  • Live file watcher – updates the index instantly as markdown files change.

Typical workflow for a user

  1. Install the plugin for your agent (e.g., plugin marketplace add zilliztech/memsearch).
  2. Chat as usual – each turn is summarised and appended to a daily markdown file.
  3. Recall – either run /memory-recall <question> or just ask the agent; it will automatically invoke the memory‑recall skill.
  4. (Optional) Enable PROJECT/User notes or skill distillation by asking the agent to “enable MemSearch skill distillation”.

Typical workflow for a developer

from memsearch import MemsearchClient
client = MemsearchClient()
# index a new markdown file
client.index_path('my_project/memory/2024-11-20.md')
# search
results = client.search('how did we configure redis?', top_k=5)
for r in results:
    print(r.text)

The same client powers the plugins, so any custom agent can reuse the full indexing, searching, and maintenance logic.

Why it matters

  • Continuity – agents forget after a session; memsearch preserves the whole conversation history across sessions and even across different agents.
  • Human‑readable – because the memory lives in Markdown, developers can inspect, edit, version‑control, or diff the notes.
  • Cost‑effective – default local ONNX embeddings avoid API charges; Milvus Lite works out‑of‑the‑box.
  • Extensible – plug into any LLM via the CLI/API, add custom summarisation models, or switch to a managed Milvus cluster.

TL;DR: memsearch is a lightweight, markdown‑backed semantic memory system for AI coding assistants, offering automatic capture, hybrid search, cross‑agent sharing, and optional skill creation, with both ready‑made plugins and a full CLI/Python API for developers.

Related

  • Project
  • Project
  • Project
  • Project
  • Project