
Longmem
io.github.mareremPublished by GitHub account mareremv0.2.1Updated Oct 24, 2026
Persistent cross-project memory for Cursor and Claude Code using local semantic search.
Overview
Gives coding assistants a persistent local memory of solved problems, searched semantically before reasoning from scratch.
- What you can do
- Longmem is a local MCP server that stores solutions to problems you have already solved and retrieves them across projects and sessions. Its main tools are search_similar, which runs hybrid semantic and keyword search over stored entries, and confirm_solution, which saves a solution with metadata auto-filled from the preceding search. It also exposes tools such as save_solution, correct_solution, enrich_solution, add_edge_case, search_by_project, delete_solution, rebuild_index, list_recent and stats, plus a CLI for setup, review, export and import.
- When to use it
- Worth adding if you use Cursor or Claude Code across several repositories and keep re-solving the same bugs, boilerplate or patterns. It is most useful once it holds entries, so seed it with a review pass or a teammate's export. Teams can share one database so knowledge surfaces from every repository.
- Requirements
- Runs as a local process, installed with pipx from PyPI, on desktop only. Needs an embedding backend: a local Ollama instance with the nomic-embed-text model, or OpenAI embeddings with an API key. Optional configuration lives in ~/.longmem/config.toml and can point at a shared path, S3 or LanceDB Cloud.
Installation
In SourceWeft
- Open Longmem in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Cross-project memory for AI coding assistants.
Stop solving the same problems twice.
[PyPI] [Python 3.11+] [License: MIT] [Tests] [Coverage] [Open Issues] [Closed Issues] [marerem/longmem MCP server]
Your AI solves the same bug in a different project six months later. Writes the same boilerplate. Explains the same pattern. You already knew the answer.
longmem gives your AI a persistent memory that works across every project and every session. Before reasoning from scratch, it searches what you've already solved. After something works, it saves it. The longer you use it, the less you repeat yourself.
Why longmem
Quickstart
1. Install
2. Setup — checks Ollama, pulls the embedding model, writes your IDE config
3. Activate in each project — copies the rules file that tells the AI how to use memory
4. Restart your IDE. Memory tools are now active on every chat.
Need Ollama? Install from ollama.com, then
ollama pull nomic-embed-text. Or use OpenAI — see Configuration.
How it works
longmem is an MCP server. Your IDE starts it on demand. Two rules drive the workflow:
Rule 1 — search first. Before the AI reasons about any bug or question, it calls search_similar. If a match is found (cosine similarity ≥ 85%), the cached solution is returned with any edge-case notes. Below the threshold, the AI solves normally.
Rule 2 — save on success. When you confirm something works, the AI calls confirm_solution. One parameter — just the solution text. Problem metadata is auto-filled from the earlier search.
The rules file (longmem.mdc for Cursor, CLAUDE.md for Claude Code) wires this up automatically. No manual prompting.
AI forgot to save? Run longmem review — an interactive CLI to save any solution in 30 seconds.
Cold start — getting value from day one
longmem is most useful once it has entries. The fastest way to seed it:
Option 1 — review as you go. After every solved problem this week, run longmem review and describe what you fixed. Ten entries is enough to feel the difference.
Option 2 — team import. If a teammate already has entries, they export and you import:
Option 3 — shared DB. Set db_path (or db_uri for S3/cloud) to the same location for the whole team. Every save is instantly available to everyone.
CLI
longmem with no arguments starts the MCP server (used by your IDE).
Configuration
Config lives at ~/.longmem/config.toml. All fields are optional — defaults work with a local Ollama instance.
Switch to OpenAI embeddings
Install the extra: pip install 'longmem[openai]'
Team shared database
Point every team member's config at the same path:
Or use cloud storage:
No shared mount? Use longmem export / longmem import to distribute a snapshot.
Team knowledge base
Save facts that are true across your whole stack under project="shared" so they surface from any repo:
search_similar searches all projects — a shared entry surfaces automatically from any repo without needing search_by_project.
Three-layer solution format — write solutions so they work for anyone who finds them:
Tuning
MCP tools
The server exposes 11 tools. The two you interact with most:
search_similar— semantic + keyword hybrid search. Returns ranked matches with similarity scores, edge cases, and akeyword_matchflag when the hit came from exact text rather than vector similarity.confirm_solution— saves a solution with one parameter. Problem metadata auto-filled from the preceding search.
Full list: save_solution, correct_solution, enrich_solution, add_edge_case, search_by_project, delete_solution, rebuild_index, list_recent, stats.
Call rebuild_index once you reach 256+ entries to compact the database and build the ANN index for faster search.
Category reference
Categories pre-filter before vector search — keeps retrieval fast at any scale.
Contributing
Contributions are very welcome — this project grows with the community that uses it.
Whether it's a bug fix, a new feature, better docs, or just sharing your use case — all of it helps. If you're unsure whether an idea fits, open an issue first and we'll figure it out together.
Getting started:
Good first contributions:
- New category suggestions
- Edge cases you hit in real projects
- IDE integrations (JetBrains, VS Code, Neovim, etc.)
- Better error messages
- Seed datasets — export your own entries and share them as a starter pack
Ways to contribute without code:
- Star the repo if you find it useful
- Share it with your team
- Open an issue if something is confusing — unclear UX is a bug
License
MIT — see LICENSE.
mcp-name: io.github.marerem/longmem
Source: README.md at commit b43dc04
Tools
0Version history
1- v0.2.1LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts