Ogham
Persistent shared memory for AI agents. Hybrid search (pgvector + tsvector), knowledge graph, cognitive scoring, and 16-language temporal extraction. 97.2% Recall@10 on LongMemEval with one PostgreSQL query. Works across Claude Code, Cursor, Codex, O
What is Ogham?
Ogham is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to persistent shared memory for ai agents. hybrid search (pgvector + tsvector), knowledge graph, cognitive scoring, and 16-language temporal extraction. 97.2% recall@10 on longmemeval with one postgresql...
Persistent shared memory for AI agents. Hybrid search (pgvector + tsvector), knowledge graph, cognitive scoring, and 16-language temporal extraction. 97.2% Recall@10 on LongMemEval with one PostgreSQL query. Works across Claude Code, Cursor, Codex, O
This server falls under the Knowledge & Memory category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Persistent shared memory for AI agents. Hybrid search (pgvec
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx oghamConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Ogham
Ogham is a persistent shared memory system for AI agents, backed by PostgreSQL with pgvector and tsvector for hybrid semantic and full-text search. It achieves 97.2% Recall@10 on the LongMemEval benchmark with a single PostgreSQL query, and exposes a rich set of MCP tools for storing, updating, searching, and synthesising memories across sessions and agents. Beyond basic storage, Ogham includes a knowledge graph layer, cognitive scoring to surface the most relevant memories, a wiki compiler that synthesises tagged memories into structured pages, and temporal extraction in 16 languages. It works with Claude Code, Cursor, Codex, and any MCP-compatible client.
Prerequisites
- Python 3.10 or later and uvx (from the uv package manager) installed
- A PostgreSQL database with the pgvector extension enabled — Supabase (free tier works) or a self-hosted Postgres instance, or a Neon database
- An embedding provider and its API key: Ollama (local, free), OpenAI (OPENAI_API_KEY), Mistral (MISTRAL_API_KEY), Voyage (VOYAGE_API_KEY), or Gemini (GEMINI_API_KEY)
- SUPABASE_URL and SUPABASE_KEY (if using Supabase) or DATABASE_URL (if using self-hosted Postgres)
- An MCP-compatible client: Claude Code, Cursor, Codex, or Claude Desktop
Run the Ogham setup wizard
The init command walks you through database selection, embedding provider choice, and writes a ready-to-use MCP config block. For Postgres/Neon, include the postgres extra.
# Supabase (default)
uvx --from ogham-mcp ogham init
# PostgreSQL / Neon
uvx --from 'ogham-mcp[postgres]' ogham initAdd the generated config to your MCP client
The setup wizard prints a JSON config block. Paste it into your claude_desktop_config.json or equivalent client config file. It will include all required environment variables.
{
"mcpServers": {
"ogham": {
"command": "uvx",
"args": ["--from", "ogham-mcp", "ogham", "serve"],
"env": {
"DATABASE_BACKEND": "supabase",
"SUPABASE_URL": "https://yourproject.supabase.co",
"SUPABASE_KEY": "your-service-role-key",
"EMBEDDING_PROVIDER": "openai",
"OPENAI_API_KEY": "your-openai-api-key"
}
}
}
}Restart your MCP client
Save the configuration and restart your client to load Ogham. On first start it will create the necessary database schema automatically.
Store your first memory
Ask the AI to remember something. Ogham captures it with semantic embeddings, timestamps, and optional tags for later retrieval.
Run a hybrid search
Retrieve memories using natural language queries. Ogham combines vector similarity and full-text search via Reciprocal Rank Fusion for high-recall results.
(Optional) Run in SSE multi-agent mode
For scenarios where multiple agents share the same memory store, start Ogham as a persistent SSE server and point all clients at the URL.
ogham serve --transport sse --port 8742
# Client config: use "url": "http://127.0.0.1:8742/sse" instead of command/argsOgham Examples
Client configuration
claude_desktop_config.json entry for Ogham with Supabase backend and OpenAI embeddings.
{
"mcpServers": {
"ogham": {
"command": "uvx",
"args": ["--from", "ogham-mcp", "ogham", "serve"],
"env": {
"DATABASE_BACKEND": "supabase",
"SUPABASE_URL": "https://yourproject.supabase.co",
"SUPABASE_KEY": "your-service-role-key",
"EMBEDDING_PROVIDER": "openai",
"OPENAI_API_KEY": "sk-your-openai-key",
"DEFAULT_PROFILE": "default"
}
}
}
}Prompts to try
These prompts exercise memory storage, hybrid search, and knowledge synthesis.
- "Remember that we chose PostgreSQL over MongoDB because of ACID guarantees"
- "Search my memories for anything related to deployment errors in production"
- "What do you remember about our API rate limiting decisions?"
- "Compile a wiki page summarising all my architecture decisions"
- "Find memories tagged 'security' from the last 30 days"
- "Store the fact that the staging environment URL is https://staging.myapp.dev"Troubleshooting Ogham
uvx command not found
Install uv with curl -LsSf https://astral.sh/uv/install.sh | sh (macOS/Linux) or pip install uv, then open a new terminal. uvx is bundled with uv.
Database connection fails or pgvector extension missing
For Supabase: enable the pgvector extension from the Supabase dashboard under Database > Extensions. For self-hosted Postgres: run CREATE EXTENSION IF NOT EXISTS vector; as a superuser before starting Ogham.
Hybrid search returns no results despite stored memories
Check that EMBEDDING_PROVIDER and the corresponding API key match what was used during init. Switching embedding providers without re-embedding existing data will break similarity search. Run the re_embed_all tool to regenerate embeddings after changing providers.
Frequently Asked Questions about Ogham
What is Ogham?
Ogham is a Model Context Protocol (MCP) server that persistent shared memory for ai agents. hybrid search (pgvector + tsvector), knowledge graph, cognitive scoring, and 16-language temporal extraction. 97.2% recall@10 on longmemeval with one postgresql query. works across claude code, cursor, codex, o It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Ogham?
Follow the installation instructions on the Ogham GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Ogham?
Ogham works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Ogham free to use?
Yes, Ogham is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
Ogham Alternatives — Similar Knowledge & Memory Servers
Looking for alternatives to Ogham? Here are other popular knowledge & memory servers you can use with Claude, Cursor, and VS Code.
MemPalace
★ 52.6kA local AI memory system that stores all conversations verbatim and organizes them into navigable structures. It provides 19 MCP tools for AI assistants to search and retrieve past decisions, debugging sessions, and architecture debates automatically
Kratos
★ 25.7k🏛️ Memory System for AI Coding Tools - Never explain your codebase again. MCP server with perfect project isolation, 95.8% context accuracy, and the Four Pillars Framework.
Context Mode
★ 15.4kAn MCP server that preserves LLM context by intercepting large data outputs and returning only concise summaries or relevant sections. It enables efficient sandboxed code execution, file processing, and documentation indexing across multiple programm
Memu
★ 13.7kMemory for 24/7 proactive agents like OpenClaw.
MemOS
★ 9.3kMemOS (Memory Operating System) is a memory management operating system designed for AI applications. Its goal is: to enable your AI system to have long-term memory like a human, not only remembering what users have said but also actively invoking, u
Everos
★ 5.4kBuild, evaluate, and integrate long-term memory for self-evolving agents.
Browse More Knowledge & Memory MCP Servers
Explore all knowledge & memory servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Ogham in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Ogham?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.