Cortex
Obsidian-backed knowledge graph with semantic search, entity extraction, and cross-session memory. 11 MCP tools. Works with Claude Code, Cursor, Windsurf, and any MCP-compatible editor.
README
š§ Cortex ā Proactive Memory Agent for AI Coding Assistants
Obsidian-backed knowledge graph with semantic search, entity extraction, and cross-session memory. 11 MCP tools. Works with Claude Code, Cursor, Windsurf, and any MCP-compatible editor.
What It Does
You: "How does the memory system handle forgetting?"
Cortex: š” This reminds me of your previous work on:
1. decisions/memory-architecture-choice ā Ebbinghaus decay with 14-day half-life
2. daily/2026-06-19 ā You designed the three-tier memory architecture
3. moc/system-architecture ā Full system diagram
- Semantic search ā Find concepts across languages (EN query ā CN content)
- Knowledge graph ā 928 entities, 106K relationships, auto-extracted from your notes
- Proactive context ā
memory_monitorwatches conversation topics, surfaces relevant memories - Gap analysis ā Compare your learning goals against actual knowledge coverage
- Cross-session ā Every session loads your memory index + recent daily logs automatically
Architecture
MCP Client (Claude Code / Cursor / Windsurf)
ā stdio JSON-RPC
ā¼
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Cortex MCP Server (TypeScript) ā
ā 11 tools + 1 resource ā
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā
ā ā SQLite (sql.js) ā ā ā Knowledge graph (8 tables)
ā ā LanceDB ā ā ā Vector embeddings (384-dim)
ā ā ONNX (all-MiniLM-L6-v2) ā ā ā Local, zero API cost
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā
āāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāā
ā reads & indexes
ā¼
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Obsidian Vault (source of truth)ā
ā daily/ decisions/ moc/ ā
ā å¦ä¹ č®”å/ ... ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Quick Start
# 1. Install
cd Cortex/mcp-server
npm install --ignore-scripts
npx tsc
# 2. Configure (Claude Code)
# Copy the MCP config to your global Claude Code settings:
# ~/.claude/.mcp.json
# 3. Use
# Start a Claude Code session. The MCP server starts automatically.
# Say: "memory_ingest" to index your vault
# Say: "search for architecture decisions" to find memories
MCP Tools
| Tool | Description |
|---|---|
memory_search |
Hybrid keyword + vector semantic search |
memory_ingest |
Scan vault, extract entities, build index |
memory_status |
System health report |
memory_entity_extract |
Extract typed entities from text |
memory_graph_query |
Query the knowledge graph (multi-hop) |
memory_auto_link |
Suggest [[wikilinks]] between notes |
memory_monitor |
Process conversation, return proactive context |
memory_conflict_resolve |
Detect contradictions with existing memories |
memory_gap_analysis |
Analyze knowledge gaps vs learning goals |
memory_consolidate |
Apply decay, find archive candidates |
memory_session_end |
Generate daily note (portable Stop hook) |
Editor Support
| Editor | Setup |
|---|---|
| Claude Code | ~/.claude/.mcp.json (global) or .mcp.json (project) |
| Cursor | Copy editors/cursor.mcp.json ā .cursor/mcp.json |
| Windsurf | Copy editors/windsurf.mcp.json |
| Cline / VS Code | Copy editors/cline.mcp.json |
Project Structure
Cortex/
āāā mcp-server/ ā TypeScript MCP server (32 source files)
ā āāā src/
ā ā āāā tools/ ā 11 MCP tools
ā ā āāā graph/ ā Knowledge graph + decay + gap detection
ā ā āāā ingest/ ā Vault scanner, chunker, entity extractor
ā ā āāā embeddings/ ā ONNX pipeline (all-MiniLM-L6-v2)
ā ā āāā db/ ā SQLite + LanceDB
ā ā āāā resources/ ā MCP resource endpoints
ā āāā editors/ ā Config templates for other editors
ā āāā tests/
āāā src/
ā āāā hooks/ ā Bash hooks (SessionStart, Stop, etc.)
ā āāā lib/ ā Bash utilities
ā āāā templates/ ā Vault file templates
āāā skills/ ā Claude Code skills
āāā commands/ ā Slash commands
āāā docs/ ā Architecture docs
āāā tests/ ā Hook tests
License
MIT ā see LICENSE
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.