Skip to main content
AllMCPs
BrowseBestCategoriesStackCompareToolsGuidesBlog
Log in Submit MCP

Stay in the loop

Get new MCP servers and top picks in your inbox.

AllMCPs

The open directory for discovering and installing Model Context Protocol servers.

AllMCPs on GitHub (opens in a new tab)
Launched onTiny Startupstinystartups.com
Explore
  • Browse servers
  • Best MCP servers
  • Categories
  • MCP clients
  • Agent prompts
  • Stack Builder
  • Compare servers
  • Random discovery New
  • Submit a server
  • Pricing & Boost Boost
Learn
  • Guides hub
  • What is MCP?
  • Install guide
  • Build an MCP server
  • Deploy an MCP server
  • Security guide
  • Troubleshooting
  • MCP for SEO & AEO
  • Protocol versioning
  • Blog & updates
Tools
  • All developer tools
  • Config generator
  • Config validator
  • Config auditor
  • MCP playground
  • Token calculator
  • OpenAPI โ†’ MCP
  • Badge generator
For agents
  • REST API docs
  • Trust & traffic Live
  • Remote MCP server SSE โ†— (opens in a new tab)
  • llms.txt โ†— (opens in a new tab)
  • Catalog JSON โ†— (opens in a new tab)
Company
  • About
  • Advertise Sponsor
  • Contact
  • GitHub โ†— (opens in a new tab)
  • Terms
  • Privacy
AllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZoneAllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZone
ยฉ 2026 Jackalope Digital LLC. All rights reserved.
  1. Home
  2. ๐Ÿง  Knowledge & Memory
  3. Lean Memory
Lean Memory logo
Health: ActiveRecent health check succeeded.Last checked 9/11/2026, 5:03:12 PM

Lean Memory

User RatingsBe the first to rate and review this MCP server!
View Repository42 GitHub StarsTotal stargazers on GitHub for the source repository (42 stars).
memorysqliteofflinemcpembedding

Local-first embedded agent memory using SQLite with hybrid dense+sparse search and add-only history.

Quick Install

Automated & IDE Setup

Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ€” or use 1-click editor setup below.

Add to CursorAdd to VS Code
We couldnโ€™t automatically confirm this listing starts correctly

We ran the install command below but it didn't respond within our test window โ€” this can mean a slow first-time install rather than a real problem.

uvx lean-memory

No response to initialize.

This is an experimental automated check and can have false negatives โ€” missing environment variables, a slow cold install, etc. It doesnโ€™t necessarily mean somethingโ€™s wrong. Last checked 1mo ago.

Manual Client & Custom JSON ConfigExpand JSON โ–พ

Client Config & Setup

Choose your client or environment
Target File:~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "wuesteon-lean-memory": {
      "command": "uvx",
      "args": [
        "lean-memory"
      ]
    }
  }
}

๐Ÿ’ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.

Install Directory Badge Claim listing Alternatives๐Ÿง  More in Knowledge & Memory

Overview

This library provides an embedded, local-first memory system for AI agents, storing facts in a single SQLite file per namespace. It supports hybrid dense and sparse retrieval with add-only history, allowing queries as of any past time. Memory maintenance tasks like deduplication, summarization, and eviction are performed offline and reviewed by a human. It runs fully offline with no server or cloud key required, suitable for agents needing persistent, private memory.

Use cases

โ€ขStore and retrieve agent facts locally without external services
โ€ขQuery historical memory states at specific past times
โ€ขMaintain and clean memory offline with human-reviewed summarization
โ€ขIntegrate persistent local memory into MCP-compatible AI agents
โ€ขRun memory retrieval with hybrid embedding and sparse search

Key features

โ€ขSingle SQLite file per namespace for isolated memory storage
โ€ขHybrid dense (embedding) and sparse (FTS5) search retrieval
โ€ขAdd-only memory history with point-in-time querying
โ€ขOffline sleep-time maintenance for deduplication and summarization
โ€ขMCP server bridge with tools for add, search, and clear memory
โ€ขOptional real embedder, reranker, and extractor models

Capabilities & Tool Schemas

Inspect callable tools, capabilities, and parameters exposed to AI agents by Lean Memory.

Extracted Tool Capabilities
Single SQLite file per namespace for isolated memory storage
Hybrid dense (embedding) and sparse (FTS5) search retrieval
Add-only memory history with point-in-time querying
Offline sleep-time maintenance for deduplication and summarization
MCP server bridge with tools for add, search, and clear memory
Optional real embedder, reranker, and extractor models

Documentation Overview

lean-memory

test PyPI Wuesteon/lean-memory MCP server

Embedded, local-first agent memory. No server, no daemon, no mandatory cloud key.

Status (2026-07): first public release line (0.2.1) is live on PyPI and the MCP Registry (MCP-first launch); the Claude Code plugin ships in this repo (marketplace listing pending). Roadmap and rationale: docs/superpowers/specs/2026-07-08-strategic-direction-design.md. Public benchmark runs (LongMemEval/LoCoMo) are deliberately deferred until after launch; the harness is complete (bench/phase2_*.py) and the engine flaws it exposed are fixed โ€” see docs/phase2-learnings.md.

server.ts
from lean_memory import Memory

mem = Memory(root="./data")

mem.add("user-42", "I work at Acme Corp.")
mem.add("user-42", "I now work at Globex.")          # supersedes Acme automatically

mem.search("user-42", "where does the user work?")   # โ†’ "I now work at Globex."

lean-memory quickstart

Facts are extracted from natural language, stored in a per-namespace SQLite file, and retrieved with hybrid dense+sparse search. Old facts are never deleted โ€” they're superseded and queryable at any past point in time.

Install

Terminal
pip install lean-memory

Runs fully offline out of the box. Optional extras unlock real model quality:

ExtraWhat it adds
lean-memory[models]Real embedder + reranker (Qwen3-0.6B + Ettin-32M)
lean-memory[extract]GLiNER2 candidate generation for richer extraction
lean-memory[llm]Ollama-backed LLM typing pass
lean-memory[mcp]MCP server bridge for Claude Desktop / Claude Code
lean-memory[examples]Terminal demo agent (requires anthropic SDK)

Quickstart

server.ts
from lean_memory import Memory

mem = Memory(root="./data")   # one SQLite file per namespace, stored under ./data/

# Store facts in natural language
mem.add("alice", "I work at Stripe.")
mem.add("alice", "I now work at Vercel.")   # supersedes Stripe automatically

# Retrieve โ€” the superseded Stripe fact drops out; only the current one is returned
results = mem.search("alice", "what does Alice do for work?", k=3)
for hit in results:
    print(hit.fact.fact_text, hit.final_score)
# โ†’ I now work at Vercel. 0.89

# Point-in-time query โ€” what was true at a specific moment?
mem.search("alice", "employer", as_of=1_700_000_000_000, is_latest_only=False)  # epoch ms

# Always close when done (flushes WAL)
mem.close()

Demo Agent

A terminal chatbot showing the full memory loop โ€” add, retrieve, supersede, restart. The demo script lives in the repo (it is not installed with the package):

server.ts
git clone https://github.com/Wuesteon/lean-memory && cd lean-memory
pip install -e '.[examples]'
export ANTHROPIC_API_KEY=sk-ant-...
python examples/chat.py                  # uses offline stubs by default
python examples/chat.py --namespace bob  # separate memory tenant, persists across restarts

No API key? The demo still runs โ€” it echoes the retrieved memory context instead of calling Claude, so you can watch the engine work offline.

MCP Server โ€” memory for Claude Code / Claude Desktop

Give any MCP agent persistent local memory: three tools (memory_add, memory_search, memory_clear), one SQLite file per namespace, nothing leaves your machine.

Terminal
pip install 'lean-memory[mcp,models,extract]'

First run downloads three open models (~2.0 GB total: Qwen3-Embedding-0.6B

  • Ettin-32M reranker for retrieval, plus GLiNER2-base (~0.8 GB) for real extraction โ€” all ungated). Pre-warm once so your MCP client never waits on a download:
server.ts
python -c "from lean_memory.embed.sentence_transformer import SentenceTransformerEmbedder; \
from lean_memory.retrieve.rerank import CrossEncoderReranker; \
SentenceTransformerEmbedder().embed_one('warm'); CrossEncoderReranker().score('warm', ['up']); \
from lean_memory.extract.gliner_extractor import Gliner2Generator; from lean_memory.types import Episode; \
Gliner2Generator().generate(Episode(namespace='w', raw='I work at Acme.', t_ref=0, source='user'))"

Claude Code:

Terminal
claude mcp add lean-memory -- lean-memory-mcp

Claude Desktop โ€” add to mcpServers (or copy examples/mcp_config.json):

config.json
{ "lean-memory": { "command": "lean-memory-mcp", "env": { "LM_DATA_ROOT": "~/.lean_memory" } } }

Data root: LM_DATA_ROOT (default ~/.lean_memory). Works offline-only too โ€” the server opportunistically upgrades each backend that its extra is installed for ([models] โ†’ real embedder + reranker, [extract] โ†’ GLiNER2 extraction) and otherwise falls back to deterministic stub backends (fine for CI, semantically meaningless for real use โ€” install [mcp,models,extract]).

What the optional [llm] extra buys. The canonical [mcp,models,extract] install has no LLM typing pass, so the ~15% of candidates that escalate โ€” almost all of them inferential (derives) facts โ€” are typed by a deterministic stub instead of a model. Assertional facts are unaffected; inference-type facts are effectively second-class on the default path. Adding [llm] (a local Ollama model) upgrades that escalated tier to real constrained typing. See ARCHITECTURE.md โ†’ Known Limitations.

Sleep-time maintenance & review

Memory accumulates cruft: the same fact restated a dozen ways, old records that never come up, clusters begging to be summarized. lean-memory cleans it up the way sleep consolidates memory โ€” an offline job you run off-hours that dedupes, summarizes, and demotes low-value records, then hands you the judgment calls to click through the next morning, in the web console or conversationally in Claude Code.

The CLI (lean-memory-maintain) is the primary trigger. It is dry-run by default โ€” it reports what it would do and writes nothing:

bash
lean-memory-maintain --root ~/.lean_memory              # dry-run: report only, zero writes
lean-memory-maintain --root ~/.lean_memory --apply      # auto-apply safe transforms + stage the rest
lean-memory-maintain --root ~/.lean_memory --auto-only   # with --apply: ONLY the provably-safe band, stage nothing
lean-memory-maintain --root ~/.lean_memory --json        # one machine-readable object, stable keys

--root defaults to $LM_DATA_ROOT; add --namespace NS to run a single namespace instead of every *.db under the root. Overnight, on a schedule โ€” one crontab line runs the safe band nightly at 3am and stages everything else for you:

cron
0 3 * * *  lean-memory-maintain --root ~/.lean_memory --apply >> ~/.lean_memory/maintain.log 2>&1

Next-morning review in Claude Code. Judgment calls (near-duplicate merges, summaries, evictions) are staged as proposals โ€” nothing changes in stored memory until you approve. Run the /review-memory plugin command (or invoke the review-memory-maintenance MCP prompt on the console server) and Claude walks you through the queue, grouped by entity with before/after evidence, recording only the verdicts you give. Four MCP tools back it โ€” memory_maintenance_run (dry-run by default, like the CLI), memory_maintenance_status, memory_review_queue, and memory_review_decide โ€” available on the core lean-memory-mcp server and both console MCP surfaces. Set LM_MAINT_AUTO=1 to opt into a background auto-run (safe band only) on the first tool call of a stale namespace; it is off by default.

Or click through it in the console. The memory console ships a Review page: the same queue grouped by entity, before/after evidence per proposal (both texts + cosine for near-duplicates, sources + proposed text for summaries, score evidence for evictions), with Approve / Keep / Edit-then-approve / Promote verbs, batch-approve per entity, and a run-maintenance button (dry-run by default; apply sits behind a confirm). Both frontends drive the same proposal store with compare-and-set decisions, so deciding in one place shows up as "already decided" in the other instead of double-applying.

The safety story in one paragraph. Nothing is ever deleted โ€” maintenance only appends, retires (the same superseded_by flip ordinary supersession uses), or demotes to a cold tier, so your full history stays queryable as-of any past point in time, bit-for-bit identical at the store predicate and pinned by executable tests. Only two transforms auto-apply: exact-duplicate retirement and a strict eviction band; everything judgmental is staged for a human, and an unreviewed proposal expires after 30 days rather than auto-applying โ€” silence is never consent. Cold-demoted facts stay reachable via as_of queries and search(..., include_cold=True), and promotion back to the hot tier is explicit-only, so a read never durably changes what your agent sees.

Real Model Quality

The default backends are offline stubs โ€” deterministic and dependency-free, but semantically meaningless. Swap in real models for production-quality retrieval:

Terminal
pip install 'lean-memory[models]'

With Qwen3-Embedding-0.6B + Ettin-32M reranker, retrieval jumps from 1/5 to 4/5 on the internal benchmark with zero code changes.

For benchmark results, architecture decisions, and implementation status see ARCHITECTURE.md.

How It Works

Each mem.add() call runs a 4-pass hybrid extraction pipeline:

Read the full README โ†’View source on GitHub โ†’

Related MCP Servers

View all in Knowledge & Memory View all alternatives
  • Engram logoEngram

    Local-first persistent memory for AI agents. SQLite + local embeddings (all-MiniLM-L6-v2), hybrid semantic + FTS5 recall, secret detection, and contradiction handling. 6 MCP tools (remember, recall, forget, feedback, context, status) over stdio. Zero cloud, no API keys, fully offline. Works with Claude Desktop/Code, Cursor, and Windsurf. npm install -g @hbarefoot/engram

    ๐Ÿง  Knowledge & Memory2 views
    Compare vs Engram โ†’
  • Moxie Docs MCP logoMoxie Docs MCP
    โ˜… Featured

    MCP & Agent Skills for Automated Documentation, and codebase conventions + context

    ๐Ÿง  Knowledge & Memory21 views
    Compare vs Moxie Docs MCP โ†’
  • Tribal logoTribal

    Self-hosted semantic memory server, served over MCP, for an engineering team's tribal knowledge: the tacit decisions and hard-won reasoning behind the code, captured once and kept queryable for the team and the agents they work with. Postgres-backed (pgvector).

    ๐Ÿง  Knowledge & Memory2 views
    Compare vs Tribal โ†’
  • Mnemo MCP logoMnemo MCP

    Persistent AI memory with SQLite hybrid search (FTS5 + semantic). Built-in Qwen3 embedding, rclone sync across machines. Zero config, no cloud, no limits.

    ๐Ÿง  Knowledge & Memory2 views
    Compare vs Mnemo MCP โ†’

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks โ€” not a rating.

GitHub stars
42
Stargazers on the source repository.
Install check
Inconclusive
Didn't respond in our test window โ€” often a slow first install.
Directory activity
2 views
Config copies, upvotes, and views on AllMCPs.

Reviews

No reviews yet โ€” be the first to share how this listing worked for you.

Frequently Asked Questions about Lean Memory

No, it runs fully offline out of the box with no mandatory cloud key or server.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewLean Memory AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/wuesteon-lean-memory?style=directory)](https://allmcps.com/mcp/wuesteon-lean-memory)
HTML Embed
<a href="https://allmcps.com/mcp/wuesteon-lean-memory"><img src="https://allmcps.com/api/badge/wuesteon-lean-memory?style=directory" alt="Lean Memory on AllMCPs" /></a>

Technical Specs & Signals

Category๐Ÿง Knowledge & Memory
PricingFree
More technical detailsExpand โ–พ
TransportSTDIO
RuntimePython
AuthNo auth required
ClientsClaude Desktop, Cline / VS Code
Last updatedAug 9, 2026
Views2
Unique ViewsTotal visits recorded for this listing page on AllMCPs.
Installs0
Installs & Copy ActionsTotal times users copied install commands or configuration snippets for this server.
GitHub stars42
GitHub Star CountTotal stargazers on GitHub representing community popularity (42 stars).
52Quality signal: Good ยท 52/100How this signal is calculated โ–พ
Server availabilityNot measured

Not scored for repo-hosted servers โ€” we can't reach the running server, only its GitHub page. Hosted MCP endpoints are health-checked live.

Verified ownership10/20
Documentation & tools25/30
Adoption & activity4/15
Community engagement0/10

A guidance signal from public completeness & health data โ€” not a user rating. New listings start lower and rise as they add docs, get verified, and grow adoption. Signals we can't observe for a listing are skipped, not counted against it.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 22d ago via OSV.dev ยท lean-memory (PyPI)

โ˜… FeaturedMoxie Docs MCP logo

Moxie Docs MCP

MCP & Agent Skills for Automated Documentation, and codebase conventions + context

Explore Server โ†’

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to unlock edit access and the Official badge and attach your website โ€” proof is checked automatically, then reviewed by our team.

Free dofollow backlink: add your website and place the AllMCPs badge on it โ€” no claim needed. We detect it automatically and keep it verified as long as the badge stays live.

Claim & get free dofollow

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.

Explore more

More in ๐Ÿง  Knowledge & Memory โ†’Best MCP servers for Memory & Knowledge โ†’Alternatives to Lean Memory โ†’Install in Claude DesktopInstall in CursorInstall in VS Code