loading…
Search for a command to run...
loading…
Persistent semantic memory for AI agents using PostgreSQL and vector embeddings, enabling cross-session continuity and semantic search.
Persistent semantic memory for AI agents using PostgreSQL and vector embeddings, enabling cross-session continuity and semantic search.
Persistent semantic memory for AI agents and beyond.
This started because we wanted our AI conversations to have real memory - not just within a session, but across platforms and over time. We built it, it works brilliantly for that use case, and then we realized the potential is way bigger.
memory-mcp-ce is an MCP (Model Context Protocol) server that provides persistent semantic memory using:
Store contextual information, retrieve it semantically, and maintain continuity across sessions. Works with any MCP-compatible client.
We use it for AI conversation memory across platforms (Claude, ChatGPT, local LLMs). But it's designed to be flexible:
The memory structure is simple but powerful:
ENCRYPTION_KEY is set)"board-meeting, production-concerns, Q1-2026")"upper-management", "engineering-team", "claude-sonnet")This flexibility means you can adapt it to whatever your use case needs - we're just scratching the surface.
labels="beer, !wine", source="!grok")memory-mcp-ce provides 9 MCP tools for managing semantic memory:
store_memory - Save content with optional labels and source attribution
store_memory(
content="Production deployment delayed due to infrastructure concerns",
labels="board-meeting, production-concerns, infrastructure",
source="upper-management"
)
retrieve_memories - Semantic search with flexible filtering
retrieve_memories(query="database performance issues")retrieve_memories(labels="production, !archived")retrieve_memories(source="!grok")retrieve_memories(query="bugs", labels="python", source="engineering-team")get_memory - Retrieve specific memory by ID
delete_memory - Remove a memory by ID
random_memory - Get a random memory (supports label/source filtering)
memory_stats - Get counts and statistics with matched labels/sources
memory_stats()memory_stats(labels="mcp") mcp, MCP, mcp-ce, fastmcp, memory-mcp-ce)memory_stats(source="engineering")trending_labels - Discover hot topics using synaptic decay model
add_labels - Add labels to existing memory without replacing current ones
del_labels - Remove specific labels from a memory
All retrieval tools support fuzzy matching with exclusion:
# Get beer memories but exclude wine
retrieve_memories(labels="beer, !wine")
# Get everything except what Grok stored
retrieve_memories(source="!grok")
# Random memory from anyone except clawdbot
random_memory(source="!clawdbot")
# Trending labels, excluding date spam
trending_labels() # then filter results as needed
# Memory stats for coding topics, excluding archived
memory_stats(labels="coding, !archived")
The ! prefix works on both labels and source fields for all tools that accept them.
We recommend embeddinggemma:300m (768 dimensions) - extensively tested in production and performs excellently for semantic memory tasks.
docker compose up -d ollama
docker exec -it memory-ollama ollama pull embeddinggemma:300m
Update your .env:
EMBEDDING_MODEL=embeddinggemma:300m
EMBEDDING_DIMS= # Leave empty for auto-detection
For faster/lighter deployments, granite-embedding:30m (384 dimensions) works well:
docker exec -it memory-ollama ollama pull granite-embedding:30m
Update your .env:
EMBEDDING_MODEL=granite-embedding:30m
EMBEDDING_DIMS= # Leave empty for auto-detection
Any OpenAI-compatible embedding API works. See .env.example for configuration details.
memory-mcp-ce works great with OpenClaw agents! It provides a significant upgrade over flat-file memory with:
Integration guide coming soon - in the meantime, OpenClaw can connect to memory-mcp-ce like any other MCP server.
Two authentication methods are supported:
⚠️ Important: Once you enable either authentication method (or both), auth becomes mandatory. There's no "auth disabled" fallback - it's either wide open or locked down.
For local/trusted development, you can leave both blank. For any public-facing deployment, enable at least one.
See .env.example for detailed configuration (excellently documented by Claude Opus!).
Works with any MCP-compatible client.
Clone and prepare configuration
git clone https://github.com/SymbioMind/memory-mcp-ce.git
cd memory-mcp-ce
cp .env.example .env
cp docker-compose.example.yml docker-compose.yml
Edit .env - At minimum, change POSTGRES_PASSWORD
For recommended setup, also update:
EMBEDDING_MODEL=embeddinggemma:300m
TIMEZONE=Your/Timezone # e.g., America/New_York, Australia/Adelaide
Create data directory
mkdir -p data
Pull embedding model (one-time setup)
docker compose up -d ollama
docker exec -it memory-ollama ollama pull embeddinggemma:300m
Start the stack
docker compose up -d
Configure your MCP client - Your server is now running at http://localhost:5005/mcp
⚠️ Important: The
data/directory stores your PostgreSQL database and Ollama models. Deleting it will permanently erase all stored memories and models.
Once running, your AI can start using the memory tools:
# Store a memory
store_memory(
content="Martin prefers embeddinggemma:300m for production deployments",
labels="preferences, embedding-models",
source="project-setup"
)
# Retrieve it semantically
retrieve_memories(query="which embedding model does Martin recommend?")
# Check what's trending
trending_labels(days=7, limit=5)
The .env.example file contains comprehensive documentation for all configuration options, including:
Big thanks to Claude Opus for the excellent .env.example documentation! 🦞
Use namespaces to isolate memories within the same database:
NAMESPACE=production # Only access production memories
NAMESPACE=user_123 # User-specific isolation
NAMESPACE= # Access ALL namespaces (default)
Enable performance timing to monitor embedding and database latency:
PERFORMANCE_METRICS=true
Returns timing breakdown in all tool responses:
{
"performance": "0.750 0.130 1.070"
// embedding_time db_time total_time (seconds)
}
Enable content encryption for sensitive memories:
# Generate a secure key
python -c "import secrets; print(secrets.token_urlsafe(32))"
# Add to .env
ENCRYPTION_KEY=your_generated_key_here
Only the content field is encrypted - labels, source, and embeddings remain plaintext for querying.
Full documentation available at:
For version history and changes, see CHANGELOG.md
Built with collaboration between humans and AI. Contributions welcome!
Built by VirtualSheep and the AI buddy team at SymbioMind 🦞
Questions? Issues? Visit our GitHub or check the docs!
Выполни в терминале:
claude mcp add memory-mcp-ce -- npx Web content fetching and conversion for efficient LLM usage.
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolProvides auto-configuration for setting up an MCP server in Spring Boot applications.
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzНе уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai