Skip to main content

Shared memory for Claude, Ollama, and GPT. Local. Private. One pip install.

Project description

MemoryMesh

Claude figured it out. Ollama forgot it. MemoryMesh fixes that.

One shared memory for all your AI tools. Local. Private. Zero cloud. Works in 60 seconds.

Install

pip install memorymesh

The problem

You spend 5 minutes explaining your stack, your preferences, your project context to Claude. It gets it. Then you switch to Ollama for a quick local task — and it knows nothing. You switch to GPT for a second opinion — nothing. Every tool starts from zero. Every single time.

The fix — three lines

import memorymesh as mm

mm.remember("user builds in FastAPI + PostgreSQL, hates ORMs")
mm.recall("tech stack")

Claude + Ollama — one shared brain

from memorymesh.connectors.claude import ClaudeWithMemory
from memorymesh.connectors.ollama import OllamaWithMemory

# Claude saves context
claude = ClaudeWithMemory()
claude.remember("Backend is FastAPI, DB is PostgreSQL, no ORMs")
response = claude.chat("How should I structure the billing module?")

# Ollama reads the SAME memory — zero setup
# Requires: ollama serve && ollama pull llama3.2
ollama = OllamaWithMemory(model="llama3.2")
response = ollama.chat("Help me with the billing queries")
# Ollama already knows: FastAPI, PostgreSQL, no ORMs

OpenAI

from memorymesh.connectors.openai import OpenAIWithMemory

gpt = OpenAIWithMemory()
response = gpt.chat("Review my database schema")
# Same shared memory as Claude and Ollama

Claude Code — MCP server

Add to your Claude Code MCP settings:

{
  "mcpServers": {
    "memorymesh": {
      "command": "memorymesh",
      "args": ["serve"]
    }
  }
}

Claude gets 5 tools:

  • remember_memory — store a memory
  • recall_memory — search memories
  • get_context — get formatted context string
  • forget_memory — delete a memory
  • memory_stats — show statistics
pip install memorymesh
memorymesh serve

Smart Context (v0.2)

v0.1 as_context() returns everything matching the query. Over time, this causes context bloat.

v0.2 adds smart_context() which prunes, decays, and filters:

# Instead of:
ctx = mm.as_context("current project")

# Use:
ctx = mm.smart_context("current project")
# Automatically removes old/irrelevant memories
# Keeps your prompts clean as memory grows

# Configure:
ctx = mm.smart_context(
    "current project",
    min_relevance=0.3,  # filter below 30% relevance
    ttl_days=30,        # forget after 30 days
)

CLI

memorymesh remember "user prefers dark mode"
memorymesh recall "preferences"
memorymesh smart-recall "preferences"   # relevance-filtered
memorymesh prune                        # remove expired memories
memorymesh decay                        # apply importance decay
memorymesh list
memorymesh stats
memorymesh serve

Why local?

  • Data stays at ~/.memorymesh/memory.db — plain SQLite
  • No API keys for core functionality
  • Works offline
  • Open the DB with any SQLite viewer — it is yours forever

Limitations

  • Relevance scoring is keyword-based, not semantic (semantic search with embeddings planned for v0.3)
  • TTL is based on creation date, not last meaningful use
  • Decay requires manual call or auto_prune=True
  • FTS5 is keyword search, not semantic — recall("FastAPI") works, recall("what framework?") does not
  • No sync across machines (by design — your data stays on your machine)
  • Ollama connector requires ollama serve running locally

Roadmap

  • Core: remember / recall / as_context
  • Connectors: Claude / Ollama / OpenAI
  • MCP server (Claude Code integration)
  • CLI
  • Semantic search with local embeddings
  • Auto-learn from conversation history
  • LangChain / LlamaIndex connectors

MIT - github.com/originaonxi/memorymesh

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

memorymesh_ai-0.2.0.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

memorymesh_ai-0.2.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file memorymesh_ai-0.2.0.tar.gz.

File metadata

  • Download URL: memorymesh_ai-0.2.0.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for memorymesh_ai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ee92627091c5003224949cb7dd4295d5ec87a1e67f5164548ce8ab3aec254a5f
MD5 858afeb922b91dd9b2078b3cde467841
BLAKE2b-256 c857fbb9cc6d5a83ff2592544b3676a3cbe9b5c4960ae91fe1fc58e6a3aadf08

See more details on using hashes here.

File details

Details for the file memorymesh_ai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: memorymesh_ai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for memorymesh_ai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1fe4f20d75a32aa97d113ebfdda5b8a1d2a85a24b1730eb8bc5bc3e91e5f19b3
MD5 5597438b056f68dad3b5b10d8c7728fe
BLAKE2b-256 15510d2b887da58e5c3bc4bb668bf58a67e1d0af4432bc58eb10f6a2cf07d967

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page