Cortex

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.

Category
Visit Server

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_monitor watches 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured