Labsco
sparkvibe-io logo

MemoryMesh

β˜… 2

from sparkvibe-io

Zero-dependency persistent AI memory using SQLite. Dual-store, pluggable embeddings, 10 MCP tools.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup

MemoryMesh - The SQLite of AI Memory

<!-- mcp-name: io.github.sparkvibe-io/memorymesh --> <!-- Badges -->

PyPI version License: MIT Python Versions CI Smithery

Give any LLM persistent memory in 3 lines of Python. Zero dependencies. Fully local.


The Problem

AI tools start every session with amnesia. Your preferences, decisions, past mistakes -- all gone. You repeat yourself. The AI re-discovers things you already told it. Context windows reset, and weeks of accumulated knowledge vanish.

MemoryMesh fixes this. Install once, and your AI remembers everything -- across sessions, across tools, across projects.


Why MemoryMesh?

SolutionApproachTrade-off
Mem0SaaS / managed serviceRequires cloud account, data leaves your machine, ongoing costs
Letta / MemGPTFull agent frameworkHeavy framework lock-in, complex setup, opinionated architecture
ZepMemory serverRequires PostgreSQL, Docker, server infrastructure
MemoryMeshEmbeddable libraryZero dependencies. Just SQLite. Works anywhere.

Like SQLite revolutionized embedded databases, MemoryMesh brings the same philosophy to AI memory: simple, reliable, embeddable. No infrastructure. No lock-in. No surprises.


How It Works

  1. Store -- After each interaction, remember() the key facts, decisions, and patterns (not the full conversation).
  2. Recall -- At the start of the next session, recall() retrieves only the most relevant memories ranked by semantic similarity, recency, and importance.
  3. Persist -- Memories live in SQLite on your machine. They survive session restarts, tool switches, and context window resets.

The real value

  • Cross-session persistence -- Decisions made Monday are still known Friday.
  • Cross-tool memory -- What you teach Claude stays available in Gemini, Codex, and Cursor.
  • Structured recall -- Categories, importance scoring, time decay, and semantic search instead of brute-force history replay.
  • Privacy -- Everything local. No cloud, no telemetry, no data leaves your machine.

Features

  • Simple API -- remember(), recall(), forget(). That is the core interface. No boilerplate, no configuration ceremony.
  • SQLite-Based -- All memory stored in SQLite files. No database servers, no infrastructure. Automatic schema migrations.
  • Framework-Agnostic -- Works with any LLM, any framework, any architecture. Use it with LangChain, LlamaIndex, raw API calls, or your own setup.
  • Pluggable Embeddings -- Choose from local models, Ollama, OpenAI, or plain keyword matching with zero dependencies.
  • MCP Support -- Built-in MCP server for seamless integration with Claude Code, Cursor, Gemini CLI, and other MCP-compatible tools.
  • Memory Categories -- Automatic categorization with scope routing. Preferences go global; decisions stay in the project. MemoryMesh decides where memories belong.
  • Encrypted Storage -- Optionally encrypt memory text and metadata at rest with zero external dependencies.
  • Privacy-First -- All data stays on your machine. No telemetry, no cloud calls, no data collection. You own your data.
  • Auto-Compaction -- Transparent deduplication that runs automatically during normal use. Like SQLite's auto-vacuum, you never need to think about it.
  • Cross-Platform -- Runs on Linux, macOS, and Windows. Anywhere Python runs, MemoryMesh runs.

What's New

v4.3 -- Performance (Latest)

  • Bulk Access Updates -- recall() batches N access-time updates into 1-2 SQL calls instead of N.
  • Light Listing -- session_start and smart_sync skip loading embedding blobs, reducing I/O.
  • Recency Fix -- update_access() no longer sets updated_at, fixing a recency feedback loop.

v4.1 -- Hardening

  • Contradiction Scan -- 10Kβ†’500 candidate limit for contradiction detection (biggest perf win).
  • Security -- CORS same-origin, 1MB body limit, SSRF blocklist expansion, MCP assertβ†’if/raise.
  • Correctness -- Atomic scope migration (save-first-then-delete), on_conflict validation.
  • Infra -- PRAGMA busy_timeout=5000, PEP 561 py.typed, expanded secret regex patterns.

v4.0 -- Invisible Memory

  • Smart Sync -- Export the top-N most relevant memories to .md files, ranked by importance and recency.
  • Configurable Relevance Weights -- Tune recency, importance, and similarity weights via environment variables or constructor parameters.
  • EncryptedStore Completeness -- EncryptedMemoryStore now supports search_filtered and update_fields, matching the full MemoryStore interface.
  • Security Hardening -- SQL injection fix in search_filtered (strict allowlist for metadata keys) and explicit file permissions on database files.

Roadmap

v4.3.0 is the latest release. Available on PyPI.

v5.0 -- Performance & Scale is next. sqlite-vec ANN indexing, FTS5 keyword search, batch operations, and NumPy-accelerated cosine similarity for 5K+ memory stores.

See the full roadmap for details, strategic context, and completed milestones.


Documentation

Full documentation: sparkvibe-io.github.io/memorymesh

GuideDescription
ConfigurationEmbedding providers, Ollama setup, all constructor options
MCP ServerSetup for Claude Code, Cursor, Windsurf + teaching your AI to use memory
Multi-Tool SyncSync memories across Claude, Codex, and Gemini CLI
CLI ReferenceTerminal commands for inspecting and managing memories
API ReferenceFull Python API with all methods and parameters
ArchitectureSystem design, dual-store pattern, and schema migrations
FAQCommon questions answered
BenchmarksPerformance numbers and how to run benchmarks

Available On


Free. Forever. For Everyone.

MemoryMesh is part of the SparkVibe open-source AI initiative. We believe that foundational AI tools should be free, open, and accessible to everyone -- not locked behind paywalls, cloud subscriptions, or proprietary platforms.

Our mission is to reduce the cost and complexity of building AI applications, so that developers everywhere -- whether at a startup, a research lab, a nonprofit, or learning on their own -- can build intelligent systems without barriers.

If AI is going to shape the future, the tools that power it should belong to all of us.