
Memory Lean
io.github.zamansheikhPublished by GitHub account zamansheikhv1.5.0Updated Oct 24, 2026
Token-lean memory for AI agents: a knowledge graph searched cheaply. Drop-in for server-memory.
The publisher's own server: Memory.fit
Overview
Local knowledge-graph memory server for AI coding agents, giving cheap, token-lean search and recall of projects, facts and relations across sessions.
- What you can do
- Search and read memory: ranked name-and-snippet search, open full entities with their relations, and get a name index grouped by type.
- Create and change the graph: add entities, relations and observations, rename entities, and delete entities, relations or observations.
- Manage archived facts: list what overflowed per entity and restore chosen facts.
- Run a local web UI to explore, edit and watch the graph, plus CLI helpers for linting, compacting and printing agent instructions.
- When to use it
- Useful when an agent should remember projects, dependencies, shipped versions, pending work and learned rules between sessions, and you want that recall to cost few tokens. Also a fit if you already use the reference memory server and want the same file and tool names with smaller answers.
- Requirements
- Runs as a local stdio process, typically via npx, so Node.js is needed. Optional environment variables: MEMORY_FILE_PATH (default ~/.claude/memory-graph/memory.jsonl), MEMORY_OBS_MAX_CHARS, MEMORY_OBS_MAX, MEMORY_SEARCH_LIMIT, MEMORY_BACKUPS_KEPT. No account, API key or network access required.
Installation
In SourceWeft
- Open Memory Lean 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
memory-lean
Long-term memory for AI coding agents that doesn't burn the context window.
A knowledge graph your agent searches cheaply, and a web UI where you can see and edit all of it.
[npm version] [npm downloads] [tests] [listed in the MCP registry] [zero dependencies] [MIT license]
Quick start · Web UI · How it works · Tools · Setup for 12 agents · Contributing
memory-lean is an MCP server that gives Claude
Code, Codex, Cursor, MiMo Code and any other MCP client a memory that lasts between
sessions: which projects exist, what depends on what, which version shipped, what
is still pending, and which rules were learned the hard way. It is a drop-in
replacement for the reference memory server
(@modelcontextprotocol/server-memory),
with the same file and tool names, but its answers are about 40 times smaller.
Highlights
The numbers
Measured on a real graph of 237 entities, 355 relations and 1,160 facts (tokens ≈ characters ÷ 4):
A narrow search that matches one or two entities saves less, because there is
little to trim. To measure your own graph, run node tools/bench.mjs from a clone;
it is read-only and prints sizes, never content.
Quick start
Claude Code: install the plugin. It adds the server, the instructions as a
skill, a short reminder at the start of each session, and /memory-ui.
Any other agent: add the server to its MCP config, then give it the instructions.
Just looking? Open the web UI on a made-up example graph:
Setup for each agent
The graph is created on the first write at ~/.claude/memory-graph/memory.jsonl,
whichever agent writes it, so all your agents share one memory. Set
MEMORY_FILE_PATH to keep it somewhere else.
Web UI
This opens your memory in the browser. Everything an agent can do, you can do here:
- Explore. Each type gets its own bubble. Click an entity to highlight everything it connects to, drag nodes to arrange them, and scroll to zoom. Search matches names, types and facts.
- Edit. Add, edit and delete facts, rename an entity or change its type, add and remove relations, create and delete entities, and restore archived facts. Every change passes the same checks as the agents' tools.
- Watch. Changes your agents make appear within two seconds.
- Spot problems. The overview lists pending work, the most connected entities, and anything over budget, which is also marked on the graph.
The page runs on your machine only (127.0.0.1) and needs the one-time key in
the link it prints, so other websites cannot read or change your memory. Nothing
is uploaded anywhere.
How it works
Search, then open
The reference server answers a search with every matching entity in full, as pretty-printed JSON. memory-lean answers with a ranked list of names and the lines that matched:
The agent then opens only what it needs:
Why it stays lean
How it keeps your data safe
Tools
The three read tools are marked read-only, so clients that support it can run them without asking.
Command line
With npx, put npx -y in front: npx -y memory-lean --ui.
Teach your agent to use it
A memory server only helps if the agent reads it before working and writes to it
when something changes. docs/AGENT-PROTOCOL.md is a
ready-made set of instructions: what to look up at the start of a task, what to
record, how to name things, and what never to store. The Claude Code plugin
includes it. For every other agent, one command installs it:
Adjust the entity types and names in it to your own work.
Coming from the reference memory server
Point MEMORY_FILE_PATH at your existing memory.jsonl and swap the command. The
file format is identical, so you can switch back at any time. Existing
observations longer than 300 characters are kept as they are; only new writes are
checked. To see what is over budget, and optionally fix it:
Settings
All optional, set as environment variables on the server:
FAQ
Is my memory sent anywhere?
No. The server reads and writes local files and makes no network requests. The
web UI listens on 127.0.0.1 only. Keep the graph out of git, and never
store passwords, keys or tokens in it: record where a secret lives, not its value.
Can several agents or sessions share one graph?
Yes. Every write takes a lock, re-reads the file and replaces it atomically, so
parallel sessions (and the web UI) do not overwrite each other.
Why plain text search instead of embeddings?
It needs no model, no index and no dependencies, and an agent's queries are
mostly names it already knows. Good entity names matter more than clever queries.
What happens to old facts?
When an entity passes 15 facts, the oldest dated ones move to
archive/<entity>.md next to the graph. archived_observations,
or the Archive section in the web UI, lists and restores them.
Roadmap
- Claude Code plugin with the server, a skill and
/memory-ui - Setup guides for 12 agents
-
rename_entityand archive restore - A web UI to explore and edit the graph
- Listed in the official MCP registry
- Listed in the Claude Code plugin directory
- Search across the archived facts of every entity
- Undo in the web UI
Contributing
Ideas, bug reports and pull requests are welcome. The server is one file with no
dependencies, the web UI is one HTML file, and npm test runs in a few seconds,
so a first change is quick to make. CONTRIBUTING.md has the
layout, the ground rules and a list of good first contributions.
If memory-lean saves you tokens, a ⭐ helps other people find it.
Support
memory-lean is free and MIT licensed. If it is useful to you, you can support the work:
Author
Created and maintained by Zaman Sheikh at Silifton.
[GitHub] [X] [LinkedIn] [Website]
Built on the file format and tool names of the Model Context Protocol reference memory server.
License
MIT © 2026 Zaman Sheikh. Free to use, change and share, including commercially; keep the copyright notice.
Source: README.md at commit f2767b0
Tools
0Version history
2- v1.5.0LatestOct 16, 2026
- v1.4.1Oct 9, 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
Other Memory integrations

Memory.fit
fit.memoryOfficial publisher
Hosted Memory.fit server that lets an AI read your training, sleep, recovery and nutrition data and write back weekly plans, targets and meal plans.
pg.ddx.io: the PostgreSQL community's memory
io.ddx.pgOfficial publisher
pg.ddx.io: the PostgreSQL community's memory's hosted MCP server, published by pg.ddx.io; no sign-in required; Streamable HTTP; 29 tools.
var.gg Naming Memory
gg.varOfficial publisher
Remote MCP server that suggests and searches code identifier names from domain concepts in Korean, Japanese, Chinese, Vietnamese and English, and exposes ERD…

Counterparts
ai.counterparts
Local-first long-term memory for Claude Code and Claude Desktop: the assistant writes notes about you and your projects and recalls them in later sessions.

LAHZE - Persian AI Memory Platform
Published by GitHub account pedramgholizadeh
LAHZE - Persian AI Memory Platform's hosted MCP server; no sign-in required; Streamable HTTP; 13 tools.