universal-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.
Universal Memory Service
Self-hosted service providing unified memory search and write operations across file-based memory, vector embeddings, and the Graphiti temporal knowledge graph. Platform-agnostic — works with any client via HTTP API or MCP stdio transport.
Features
Unified search — One query searches vector embeddings (Gemini), BM25 full-text, and Graphiti temporal facts, merged and reranked
Unified write — One call persists to markdown files and Graphiti simultaneously
6-stage retrieval pipeline — Query expansion → vector → BM25 → Graphiti → merge & rank → cross-encoder rerank
Local models — Reranker and query expander run locally via GGUF (no API dependency for search)
Platform sync — Canonical files auto-sync to OpenClaw, Hermes, and other platforms
MCP server — Stdio transport for Claude Desktop, Cursor, and any MCP client
Graceful degradation — Every component fails independently; the service never fully breaks
Related MCP server: Agent Memory
Architecture
┌───────────┐ ┌───────────┐ ┌───────────────┐ ┌───────────┐
│ OpenClaw │ │ Hermes │ │Claude Desktop │ │ Any MCP │
│ (skill) │ │ (skill) │ │ (MCP client) │ │ Client │
└─────┬─────┘ └─────┬─────┘ └──────┬────────┘ └─────┬─────┘
│ │ │ │
└──────────────┴───── HTTP ────┴──── MCP stdio ───┘
│
┌────────────▼────────────┐
│ Universal Memory Svc │
│ FastAPI :8002 + MCP │
├─────────────────────────┤
│ Retrieval Pipeline │
│ File Writer + Sync │
│ Indexer + Watcher │
│ Local GGUF Models │
└──────┬──────────┬───────┘
│ │
┌──────▼──┐ ┌───▼────────┐
│ SQLite │ │ Graphiti │
│ vec+FTS │ │ API :8001 │
└─────────┘ └────────────┘Quick Start
Prerequisites
Python 3.11+
Graphiti API running on port 8001 (optional)
Gemini API key for embeddings (optional — falls back to OpenAI, then BM25-only)
Install
git clone <repo-url> && cd universal-memory-service
pip install -e ".[dev]"Configure
cp config/config.example.yaml ~/.memory-service/config.yaml
# Edit to set your data_dir, API keys, agent mappings
# Required for vector embeddings:
export GEMINI_API_KEY=your-key-here
# Without this key, the service falls back to BM25-only search (no vector embeddings).Run
# HTTP server
python -m universal_memory.main
# MCP server (for Claude Desktop / Cursor)
python -m universal_memory.mcp_serverAPI
Base URL: http://localhost:8002/api/v1
Endpoint | Method | Description |
| POST | Hybrid search across files + Graphiti |
| POST | Write to files and/or Graphiti |
| GET | Read a file from the memory store |
| GET | List files under a namespace |
| POST | Surgical find-and-replace in a file |
| POST | Batch ingest messages into Graphiti |
| GET | Health check and index stats |
| POST | Trigger full re-index |
Search
curl -s localhost:8002/api/v1/search \
-H "Content-Type: application/json" \
-d '{"query": "deployment process", "author": "alice"}' | jqWrite
curl -s localhost:8002/api/v1/write \
-H "Content-Type: application/json" \
-d '{"content": "Deployed v2.3 to staging", "author": "bob"}'MCP Server
The MCP server exposes 6 tools over stdio transport:
Tool | Maps to | Description |
| POST /search | Search files + Graphiti |
| POST /write | Write to files + Graphiti |
| GET /read | Read a specific file |
| GET /list | List files in a namespace |
| POST /edit | Find-and-replace in a file |
| GET /status | Service health and stats |
Claude Desktop config
{
"mcpServers": {
"memory": {
"command": "python",
"args": ["-m", "universal_memory.mcp_server"],
"env": { "MEMORY_AUTHOR": "alice" }
}
}
}Retrieval Pipeline
Every search runs through a 6-stage pipeline:
Query Expansion — Local LLM rewrites the query into 2-3 semantic variants
Vector Search — Embed all variants via Gemini, cosine similarity against SQLite-vec
BM25 Search — Full-text search via SQLite FTS5
Graphiti Search — Temporal fact retrieval from the knowledge graph
Merge & Rank — Normalize scores, weighted merge (vector 0.40, BM25 0.20, Graphiti 0.25), temporal decay, MMR dedup
Rerank — Local cross-encoder re-scores top-N candidates for precision
File Namespaces
~/.memory-service/data/
├── shared/ # Cross-agent knowledge (MEMORY.md, USER.md)
├── agents/{name}/logs/ # Per-agent daily logs
├── departments/{dept}/ # Department-level knowledge
├── projects/ # Cross-cutting project docs
├── guides/ # How-to docs
└── system/ # Internal stateAgents write using author and target fields — the service resolves file paths automatically.
Configuration
See config/config.example.yaml for all options:
Service — Host, port, auth token
Memory — Data directory, file extensions
Agents — Name-to-department mapping
Index — Chunk size (400 tokens), overlap (80 tokens), DB path
Embedding — Provider (Gemini/OpenAI), model, batch size
Models — Reranker and query expander GGUF paths
Search — Weights, temporal decay, MMR lambda
Graphiti — URL, timeout
Sync — Platform sync targets
Local Models
Model | Purpose | Size | Latency |
bge-reranker-v2-m3 (GGUF Q4) | Cross-encoder reranking | ~312 MB | ~165ms for 30 candidates |
Qwen3-1.7B (GGUF Q4) | Query expansion | ~980 MB | ~80-100ms per query |
Both are optional — the service degrades gracefully without them.
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/
# Lint
ruff check src/ tests/License
MIT
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
Hosted agent memory: store, search, and recall facts across sessions from any MCP client.
Hosted memory for AI agents over MCP. One memory shared by all your agents.
Persistent memory, hybrid search and a goal graph for AI agents, over stdio or remote HTTP.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceAn offline-first, governed memory and knowledge server for AI agents that provides Remember, Search, Update, and Forget operations with hybrid retrieval, semantic embeddings, and NID-based authentication. It can be used as an MCP server via stdio or Streamable HTTP, enabling agents to persist and query memories and wiki knowledge.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceProvides a self-hosted shared memory service that lets AI agents capture and recall durable facts, decisions, and context across multiple tools and MCP-capable clients.3MIT

Kagura Memory Cloudofficial
AlicenseNot gradedqualityBmaintenanceProvides AI agents and teams with self-hosted adaptive memory, combining hybrid search and a self-improving neural memory graph to enable precise recall and serendipitous discovery across MCP-compatible clients.13Apache 2.0- AlicenseNot gradedqualityBmaintenanceEnables AI agents to store, search, and link typed knowledge entities such as memories, people, projects, tasks, and documents over a Streamable HTTP MCP endpoint. Combines hybrid BM25 and vector search with a knowledge graph, and separates short-lived session context from durable memory that future agents can trust.10AGPL 3.0