Cortex

Cortex

An MCP server for capturing, searching, and synthesizing knowledge objects with formal ontology, reasoning, and hybrid retrieval.

Category
访问服务器

README

Cortex

<!-- mcp-name: io.github.abbacusgroup/cortex -->

CI PyPI Python License

Cognitive knowledge system with formal ontology, reasoning, and intelligence serving.

Cortex captures knowledge objects (decisions, lessons, fixes, sessions, research, ideas), classifies them with an OWL-RL ontology, discovers relationships, reasons over the graph, and serves intelligence through hybrid retrieval.

Dashboard

Knowledge Graph

Install

pip install abbacus-cortex[embeddings]
cortex setup

The setup wizard configures everything: LLM provider, embeddings, dashboard password, background services, and Claude Code registration.

<details> <summary>Other install methods</summary>

Lightweight (no PyTorch — wizard offers to install embeddings):

pip install abbacus-cortex
cortex setup

Homebrew:

brew install abbacusgroup/cortex/abbacus-cortex
cortex setup

From source:

git clone https://github.com/abbacusgroup/Cortex.git && cd Cortex
uv sync --extra embeddings
cortex setup

Docker:

docker compose up -d

</details>

For non-interactive installs (CI, scripts): cortex setup --auto uses environment variables.

Quick Start

cortex capture "Fix: Neo4j pool exhaustion" --type fix --content "Root cause was..."
cortex search "Neo4j"
cortex list
cortex context "Neo4j"
cortex dashboard                    # web UI at http://localhost:1315

Configuration

cortex setup writes configuration to ~/.cortex/.env. You can also edit it directly:

CORTEX_LLM_PROVIDER=anthropic
CORTEX_LLM_MODEL=claude-sonnet-4-20250514
CORTEX_LLM_API_KEY=sk-...
CORTEX_EMBEDDING_MODEL=all-mpnet-base-v2

Cortex loads .env from these locations in priority order: environment variables (highest), .env in the current working directory, then ~/.cortex/.env. The recommended location is ~/.cortex/.env for persistent configuration.

See .env.example for all options.

CLI Commands

Command Description
cortex init Initialize data directory and stores
cortex setup Interactive setup wizard
cortex install Install background services (macOS/Linux)
cortex uninstall Remove background services
cortex register Register MCP server with Claude Code
cortex capture Capture a knowledge object
cortex search Hybrid keyword + semantic search
cortex read Read object in full
cortex list List objects with filters
cortex status Health and counts
cortex context Briefing mode (summaries)
cortex dossier Entity-centric intelligence brief
cortex graph Show object relationships
cortex synthesize Cross-document synthesis
cortex entities List resolved entities
cortex serve Start MCP or HTTP server
cortex dashboard Start web dashboard
cortex backup Backup data directory to archive
cortex restore Restore from backup archive
cortex doctor Diagnostics: check, unlock, logs, repair
cortex pipeline Re-run intelligence pipeline on an object
cortex reason Run advanced reasoning (contradictions, patterns, gaps)
cortex import-v1 Import from Cortex v1 database
cortex import-vault Import from Obsidian vault

MCP Tools

22 tools for AI agent integration. Localhost-bound HTTP exposes all; non-localhost binds expose only the public set.

Public: cortex_search, cortex_context, cortex_dossier, cortex_read, cortex_capture, cortex_link, cortex_feedback, cortex_graph, cortex_list, cortex_classify, cortex_pipeline

Admin (localhost only): cortex_status, cortex_synthesize, cortex_delete, cortex_reason, cortex_query_trail, cortex_graph_data, cortex_list_entities, cortex_export, cortex_safety_check, cortex_debug_sessions, cortex_debug_memory

Architecture

Cortex runs as a single MCP HTTP server that owns the graph store. Claude Code, the dashboard, the CLI, and the REST API are all HTTP clients of that one server.

┌───────────────┐    ┌────────────┐    ┌─────────────┐
│ Claude Code   │    │  Dashboard │    │     CLI     │
│ (MCP client)  │    │ (browser)  │    │  (terminal) │
└───────┬───────┘    └─────┬──────┘    └──────┬──────┘
        │                  │                  │
        │ HTTP JSON-RPC    │ HTTP MCP         │ HTTP MCP (default)
        │                  │                  │ direct (--direct)
        ▼                  ▼                  ▼
        ┌──────────────────────────────────────┐
        │   cortex serve --transport mcp-http  │
        │   (canonical MCP HTTP server)        │
        │   PID-locked owner of graph.db       │
        └──────────────────────────────────────┘
                          │
                          ▼
            ┌─────────────────────────────┐
            │  ~/.cortex/                 │
            │    graph.db   (Oxigraph)    │
            │    cortex.db  (SQLite WAL)  │
            └─────────────────────────────┘
  • Ontology: OWL-RL formal ontology with 8 knowledge types and 8 relationship types
  • Storage: Oxigraph (RDF/SPARQL) + SQLite (FTS5/BM25) dual-write
  • Pipeline: Classify → Extract entities → Link → Enrich → Reason
  • Retrieval: Hybrid keyword + semantic + graph-boosted ranking
  • Serving: 5 presentation modes (briefing, dossier, document, synthesis, alert)
  • Transports: MCP (stdio + HTTP), REST API, Web Dashboard

Service Management

# Install both MCP server and dashboard as background services
cortex install

# Install only the MCP server
cortex install --service mcp

# Remove all services
cortex uninstall

On macOS, this creates LaunchAgent plists (auto-start on login, auto-restart on crash). On Linux, this creates systemd user units.

Raw templates are available in deploy/ for manual setup.

--direct escape hatch

By default, CLI commands route through the running MCP server. If the server is down:

cortex --direct list               # bypass MCP, open store directly
cortex --direct pipeline --batch   # required for bulk SQL operations

Bootstrap commands (init, setup, import-v1, import-vault) always run directly.

Docker

docker compose up -d
# Server at http://localhost:1314

Troubleshooting

Crashed MCP server

If the MCP server is killed hard, stale lock files auto-recover on next start. For manual cleanup:

cortex doctor unlock              # normal cleanup
cortex doctor unlock --dry-run    # report only
cortex doctor unlock --force      # bypass live-holder check

Log management

cortex doctor logs                # show log file sizes and status
cortex doctor logs --tail 20      # last 20 lines
cortex doctor logs --rotate       # rotate log files (safe while running)

Claude Code session staleness

After restarting the MCP server, restart Claude Code to clear its stale session ID. claude --resume restores your conversation. The dashboard and CLI do not have this issue.

Knowledge Types

decision, lesson, fix, session, research, source, synthesis, idea

Relationship Types

causedBy, contradicts (symmetric), supports, supersedes (transitive), dependsOn, ledTo (inverse of causedBy), implements, mentions

Privacy

Cortex stores all data locally. No telemetry, no analytics, no phone-home. If you configure an LLM provider (via CORTEX_LLM_API_KEY), object content may be sent to that provider for classification and reasoning. Embeddings are computed locally by default using sentence-transformers.

License

Copyright (c) 2026 Abbacus Group. Licensed under the MIT License.

Trademark Notice

Cortex is a project of Abbacus Group and is not affiliated with any other product named Cortex.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选