Subcog
Persistent memory system for AI coding assistants. Captures decisions, learnings, and context from coding sessions. Features hybrid search (semantic + BM25), MCP server integration, SQLite persistence with knowledge graph, and proactive memory surfac
What is Subcog?
Subcog is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to persistent memory system for ai coding assistants. captures decisions, learnings, and context from coding sessions. features hybrid search (semantic + bm25), mcp server integration, sqlite persistence...
Persistent memory system for AI coding assistants. Captures decisions, learnings, and context from coding sessions. Features hybrid search (semantic + BM25), MCP server integration, SQLite persistence with knowledge graph, and proactive memory surfac
This server falls under the Knowledge & Memory category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Persistent memory system for AI coding assistants. Captures
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx subcogConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Subcog
Subcog is a persistent memory system for AI coding assistants that captures decisions, learnings, and context across sessions so your AI never starts from scratch. It combines semantic vector search with BM25 keyword ranking (hybrid search) and stores everything in SQLite with a knowledge graph for entity and relationship tracking. Subcog integrates with Claude Code via MCP hooks and exposes around 22 MCP tools for capturing, recalling, consolidating, and managing memories scoped by namespace, project, or git branch. It is written in Rust for performance and supports optional PostgreSQL backends and encryption at rest.
Prerequisites
- Rust toolchain (for cargo install) OR Homebrew (macOS/Linux) OR Docker
- An MCP-compatible client such as Claude Desktop or Claude Code CLI
- Optional: an LLM provider API key (Anthropic, OpenAI, or Ollama) for advanced summarization features
- SQLite is bundled — no separate database setup required for the default backend
Install Subcog
Install using Cargo (recommended for Rust developers), Homebrew on macOS/Linux, or npx as a fallback.
# Homebrew (macOS/Linux)
brew install zircote/tap/subcog
# Cargo
cargo install subcog
# npx fallback
npx @zircote/subcog --helpStart the MCP server
Run subcog in server mode to expose MCP tools to your AI client. By default it uses SQLite at ~/.config/subcog/.
subcog serveConfigure your MCP client
Add subcog to your Claude Desktop configuration file. The server runs as a local stdio process.
Capture your first memory
Use the CLI to store a decision or context snippet, scoped to a namespace for easy retrieval later.
subcog capture --namespace decisions "Use PostgreSQL for primary storage due to ACID requirements"
# With project and branch scope
subcog capture --namespace decisions --project my-app --branch feature/auth "Added JWT support"Search your memories
Use hybrid semantic + BM25 search to find relevant past decisions and context.
subcog recall "database storage decision"
# Scoped to a project
subcog recall "authentication" --project my-appTune storage and embedding config
Edit ~/.config/subcog/config.toml to change the embedding model, storage backend, or enable encryption. The default embedding model is all-MiniLM-L6-v2 with 384 dimensions.
# Example config.toml snippet
[storage]
backend = "sqlite"
data_dir = "~/.config/subcog"
[embedding]
model = "all-MiniLM-L6-v2"
dimensions = 384
[hooks]
enabled = true
session_start_timeout_ms = 2000Subcog Examples
Client configuration
Add subcog to Claude Desktop so it has persistent memory across all coding sessions.
{
"mcpServers": {
"subcog": {
"command": "subcog",
"args": ["serve"]
}
}
}Prompts to try
Once connected, ask your AI assistant to store and recall project knowledge automatically.
- "Remember that we decided to use Redis for session caching because of its TTL support."
- "What database decisions have we made for this project?"
- "Recall any notes about our authentication approach."
- "Consolidate and summarize memories from last week's session."
- "Show me the knowledge graph relationships for the auth module."Troubleshooting Subcog
subcog serve fails with embedding model download errors
Subcog downloads the all-MiniLM-L6-v2 model on first run. Ensure you have internet access during initial startup. If behind a proxy, set standard HTTP_PROXY/HTTPS_PROXY environment variables.
Recall results are irrelevant or missing
Run 'subcog reindex' to rebuild the search index if you upgraded subcog or changed the embedding model. Also check that memories were captured with matching namespace/project scopes.
Claude Code hooks integration not triggering
Ensure 'hooks.enabled = true' is set in ~/.config/subcog/config.toml and that the subcog MCP server is listed in your Claude Code MCP configuration. Restart Claude Code after making changes.
Frequently Asked Questions about Subcog
What is Subcog?
Subcog is a Model Context Protocol (MCP) server that persistent memory system for ai coding assistants. captures decisions, learnings, and context from coding sessions. features hybrid search (semantic + bm25), mcp server integration, sqlite persistence with knowledge graph, and proactive memory surfac It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Subcog?
Follow the installation instructions on the Subcog GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Subcog?
Subcog works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Subcog free to use?
Yes, Subcog is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Subcog Alternatives — Similar Knowledge & Memory Servers
Looking for alternatives to Subcog? 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 Subcog 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 Subcog?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.