MCP Memory Service
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP Memory Service
Semantic memory with teeth. A Model Context Protocol server that gives AI assistants persistent, searchable memory backed by vector search, a knowledge graph, and cognitive science you didn't ask for but definitely want.
Quick Start
Docker + HTTP (Recommended)
Run the server, point your MCP client at it. Done.
docker run -d \
-p 8001:8001 \
-v memory-data:/app/data \
-e MCP_TRANSPORT_MODE=http \
-e MCP_SERVER_PORT=8001 \
ghcr.io/27b-io/mcp-memory-service:latestThen in your Claude Code or Claude Desktop config:
{
"mcpServers": {
"memory": {
"type": "http",
"url": "http://localhost:8001/mcp"
}
}
}The server speaks streamable HTTP natively via FastMCP 2.0 — no mcp-remote bridge, no npx shims, no Node.js. Your MCP client connects directly.
From Source (stdio)
For local development or if you prefer the MCP stdio transport:
git clone https://github.com/27b-io/mcp-memory-service.git
cd mcp-memory-service
uv sync
uv run memory server{
"mcpServers": {
"memory": {
"command": "uv",
"args": ["run", "--directory", "/path/to/mcp-memory-service", "memory", "server"]
}
}
}Related MCP server: Recall
Architecture
┌─────────────────────────────────┐
Claude Desktop │ MCP Memory Service │
Claude Code ──MCP──│ │
VS Code / Cursor │ ┌───────────────────────────┐ │
Any MCP Client │ │ 9 MCP Tools │ │
│ │ store · search · delete │ │
│ │ health · relation │ │
│ │ supersede · contradictions │ │
│ │ find_dupes · merge_dupes │ │
│ └─────────┬─────────────────┘ │
│ │ │
│ ┌─────────▼─────────────────┐ │
│ │ Memory Service │ │
│ │ │ │
│ │ Hybrid RRF Search │ │
│ │ Emotional Analysis │ │
│ │ Interference Detection │ │
│ │ Salience Scoring │ │
│ │ Spaced Repetition │ │
│ │ Three-Tier Memory │ │
│ └──┬──────────────────┬─────┘ │
│ │ │ │
│ ┌──▼───────┐ ┌──────▼──────┐ │
│ │ Qdrant │ │ FalkorDB │ │
│ │ (vector) │ │ (graph) │ │
│ └──────────┘ └─────────────┘ │
└─────────────────────────────────┘Every memory stored gets vectorized, emotionally tagged, checked for contradictions against existing memories, and scored for salience. Retrieval uses Reciprocal Rank Fusion to blend semantic similarity with tag matching, then applies recency decay, Hebbian co-access boosting, and spaced repetition signals. It's a lot happening behind a simple store_memory / search interface.
MCP Tools
Nine tools. Down from 16 in earlier versions — because your LLM's context window isn't free real estate.
Tool | What it does |
store_memory | Persist content with tags, metadata, and automatic cognitive processing (emotional analysis, contradiction detection, salience scoring). Auto-splits large content. |
search | Unified retrieval across 5 modes: |
delete_memory | Permanently remove a memory by content hash. |
check_database_health | Backend status, memory count, storage stats. |
relation | Create, query, or delete typed edges in the knowledge graph (RELATES_TO, PRECEDES, CONTRADICTS). |
memory_supersede | Mark a memory as superseded by a newer one. Old memory excluded from search, audit trail preserved. |
memory_contradictions | List unresolved contradiction pairs for review. |
find_duplicates | Scan memories for near-duplicates using embedding cosine similarity. Configurable threshold and canonical selection strategy. |
merge_duplicates | Supersede duplicate memories in favour of a canonical one. Non-destructive — originals kept for audit. |
Search Modes
The search tool's mode parameter selects the retrieval strategy:
Mode | When to use it | Requires query? |
hybrid (default) | General-purpose. Semantic search + tag boosting with adaptive corpus-aware weighting. | Yes |
scan | Token-budget triage. Returns ~50-token summaries instead of full content. | Yes |
similar | Duplicate detection. Pure k-NN vector similarity, no tag boosting. | Yes |
tag | Category lookup. Exact tag matching with AND/OR logic. | No (needs |
recent | Timeline browsing. Newest first, optional tag/type filter. | No |
Results come back in TOON format (pipe-delimited, ~83% smaller than JSON) for hybrid, tag, and recent modes. scan and similar return structured dicts.
Three-Tier Memory (Optional)
Behind MCP_THREE_TIER_EXPOSE_TOOLS=true, five additional tools expose a Cowan's embedded-processes memory model:
Tier | Capacity | TTL | Purpose |
Sensory Buffer | ~7 items | 1 second | Raw input capture (ring buffer) |
Working Memory | ~4 chunks | 30 minutes | Active task context (LRU eviction) |
Long-Term | Unlimited | Permanent | Qdrant persistent storage |
Items accessed 2+ times in working memory auto-consolidate to long-term storage. These tiers are ephemeral and session-scoped — they don't touch the database until consolidation fires.
Cognitive Features
These run automatically on every store_memory and search call. No configuration needed (but you can tune or disable each one).
Emotional Analysis — Keyword-based sentiment detection across 8 categories (joy, frustration, urgency, curiosity, concern, excitement, sadness, confidence). Handles negation and intensifiers. No ML model needed.
Salience Scoring — Weighted combination of emotional magnitude, access frequency, and explicit importance. High-salience memories get a retrieval boost (up to +15%).
Interference Detection — At store time, new memories are checked against existing ones for contradictions via four signal types: negation asymmetry, antonym pairs, temporal supersession ("no longer X, now Y"), and sentiment flips. Contradictions are flagged (not blocked) and recorded as CONTRADICTS edges in the knowledge graph.
Spaced Repetition — Memories accessed at expanding intervals (1h, 1d, 1w) get a retrieval boost. Based on Ebbinghaus spacing effect. Adaptive LTP prevents runaway potentiation (BCM theory).
Hebbian Learning — Co-retrieved memories form implicit association edges in the knowledge graph. Weights strengthen on co-access and decay over time. Used for spreading activation during search (BFS up to 2 hops).
Hybrid Search (RRF) — Reciprocal Rank Fusion blends vector similarity with tag matching. Alpha adapts to corpus size: balanced at <500 memories, semantic-biased at 5000+. Optional recency decay with configurable half-life (~70 days default).
Knowledge Graph
Optional FalkorDB layer for typed relationships between memories.
Explicit edges (created via relation tool):
RELATES_TO— generic semantic linkPRECEDES— temporal/causal orderingCONTRADICTS— conflicting information (also auto-created by interference detection)
Implicit edges (created automatically):
HEBBIAN— co-access associations, weight modulated by adaptive LTP
Graph features: spreading activation search boost, consolidation pruning, async write queue (CQRS pattern to avoid blocking reads).
TOON Format
Terser Object Notation — a pipe-delimited output format optimized for LLM token budgets.
# page=1 total=42 page_size=10 has_more=true total_pages=5
Meeting notes about auth redesign|planning,auth|{"priority":"high"}|2026-01-15T10:30:00Z|2026-01-15T10:30:00Z|abc123|0.95
Fixed race condition in worker pool|bugfix,concurrency|{}|2026-01-14T09:00:00Z|2026-01-14T09:00:00Z|def456|0.87~83% fewer tokens than equivalent JSON. The format spec is available as an MCP resource at toon://format/documentation.
Docker Image Variants
The Dockerfile produces two targets:
Target | Size | Embedding | Use case |
full (default) | ~1.2 GB | In-process SentenceTransformer | Single-node, |
slim | ~200 MB | External (TEI/vLLM/Ollama) | Scale-out, separate embedding service |
docker build . produces the full image (backward compatible). For the slim image:
# Build locally
docker build --target slim -t mcp-memory:slim .
# Or pull from GHCR
docker pull ghcr.io/27b-io/mcp-memory-service:latest-slimSplit Deployment (API + External Embedding)
For production scale-out, use docker-compose.prod.yml which deploys a thin API container with a separate HuggingFace TEI embedding service:
docker compose -f docker-compose.prod.yml upThis gives you:
api — Thin MCP service (~200MB, <2s cold start, no GPU needed)
embedding — HuggingFace TEI serving the embedding model
qdrant — Vector database
Only the API port (8000) is exposed to the host. Backend services communicate on the internal Docker network.
Configuration
All config via environment variables. Pydantic-settings under the hood — type-safe, validated, with sensible defaults.
Storage
Variable | Default | Description |
|
| HuggingFace model (768-dim, 8K context). Docker images default to |
|
| ONNX runtime for CPU optimization |
| — | Remote Qdrant server (omit for embedded mode) |
| Platform default | Local Qdrant data path |
Embedding Provider
Variable | Default | Description |
|
|
|
| — | Base URL for HTTP embedding service (required for |
|
| Request timeout in seconds (1-300) |
|
| Max texts per batch request (1-1024) |
| auto-detect | Override embedding dimensions |
|
| TLS certificate verification for HTTP provider |
| — | API key for managed embedding providers |
Cognitive Features
Variable | Default | Description |
|
| Emotional tagging + salience scoring |
|
| Contradiction detection at store time |
|
| Spacing-quality retrieval boost |
|
| Context-dependent retrieval |
| — | Override adaptive alpha (0.0-1.0) |
|
| Temporal decay rate (~70-day half-life) |
Three-Tier Memory
Variable | Default | Description |
|
| Enable sensory/working memory tiers |
|
| Register as MCP tools |
|
| Sensory buffer size |
|
| Working memory slots |
Content Handling
Variable | Default | Description |
|
| Auto-chunk large content |
|
| Chunk overlap (chars) |
|
| Respect sentence/paragraph breaks |
HTTP Server
Variable | Default | Description |
|
| Enable HTTP/REST interface |
|
| Listen port |
|
| Bind address |
Knowledge Graph (FalkorDB)
Variable | Default | Description |
|
| Enable FalkorDB graph layer |
|
| FalkorDB host (Redis protocol) |
|
| FalkorDB port |
| — | FalkorDB/Redis password |
Summary Generation
Variable | Default | Description |
| auto-detect |
|
|
|
|
Storage Backends
Backend | Best for | Notes |
Qdrant | All deployments | HNSW index, scalar quantization option, embedded or remote mode. Default and only backend. |
Qdrant runs in embedded mode (zero config) or connects to a remote server via MCP_QDRANT_URL.
Development
src/mcp_memory_service/
├── mcp_server.py # 9 MCP tools (+ optional three-tier)
├── unified_server.py # HTTP + MCP dual-mode server
├── config.py # Pydantic settings
├── memory_tiers.py # Cowan's three-tier model
├── cli/ # CLI entry point
├── web/ # HTTP API layer (FastAPI)
│ └── api/ # Route modules
├── services/
│ └── memory_service.py # Core business logic
├── embedding/
│ ├── protocol.py # EmbeddingProvider protocol
│ ├── local.py # In-process SentenceTransformer
│ ├── http.py # OpenAI-compatible HTTP adapter
│ ├── cached.py # CacheKit L1/L2 wrapper
│ └── factory.py # Provider factory
├── storage/
│ ├── base.py # Storage protocol (ABC)
│ ├── qdrant_storage.py # Qdrant backend
│ └── factory.py # Backend factory
├── graph/
│ ├── schema.py # FalkorDB Cypher schema
│ ├── client.py # Graph operations
│ └── queue.py # Async write queue
├── formatters/
│ └── toon.py # TOON encoder
├── utils/ # Cognitive features + helpers
│ ├── emotional_analysis.py # Sentiment detection
│ ├── interference.py # Contradiction signals
│ ├── salience.py # Importance scoring
│ ├── spaced_repetition.py # Spacing + LTP
│ ├── hybrid_search.py # RRF + adaptive alpha
│ ├── content_splitter.py # Auto-chunking
│ └── summariser.py # LLM/extractive summaries
└── models/ # Pydantic v2 models
└── memory.py # Memory dataclassRunning Tests
# Full suite
uv run pytest tests/
# Fast (skip slow integration tests)
uv run pytest -x -m "not slow"
# Quality gates
uv run ruff check src/ tests/
uv run ruff format --check src/ tests/Embedding Models
Model | Dimensions | Notes |
nomic-ai/nomic-embed-text-v1.5 | 768 | Default. 8K context, good balance. |
intfloat/e5-small-v2 | 384 | Speed over accuracy |
intfloat/e5-base-v2 | 768 | Previous default |
intfloat/e5-large-v2 | 1024 | Best quality |
Snowflake/snowflake-arctic-embed-m-v2.0 | 768 | Recommended. Instruction-tuned, strong retrieval. |
Switching models requires re-embedding existing memories.
License
WTFPL — Do What The Fuck You Want To Public License.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory for AI assistants: store, search, and connect knowledge across conversations.
Persistent personal memory for AI assistants — save, search, and recall across every MCP client.
Persistent AI memory with semantic search, conflict detection, and ticketing.
Long-term memory for AI assistants. Isolated per-user storage, recall across conversations.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides AI agents with persistent, searchable memory that survives across conversations using semantic search, temporal versioning, and smart organization. Enables long-term context retention and cross-session continuity for AI assistants.14-
- FlicenseAqualityNot gradedmaintenanceProvides long-term memory storage for AI assistants with semantic search, enabling persistent storage of preferences, decisions, and context with relationship tracking between memories.19-

Memsolus MCP Serverofficial
AlicenseAqualityDmaintenanceProvides persistent long-term memory for AI agents through semantic search and automated knowledge graph extraction. It enables agents to store, recall, and reason over facts, preferences, and relationships across multiple conversations and sessions.146 npmMIT
JauMemory MCP Serverofficial
AlicenseAqualityDmaintenanceProvides persistent memory capabilities for AI assistants, enabling storage, recall, and analysis of information across conversations with intelligent memory management.2510 npmMIT