loading…
Search for a command to run...
loading…
Local-first knowledge graph for developers. Watches project files, extracts entities and relationships via LLMs, and lets you query across projects in natural l
Local-first knowledge graph for developers. Watches project files, extracts entities and relationships via LLMs, and lets you query across projects in natural language with source citations. Provides 4 MCP tools: get_status, list_projects, find_entity, query_cortex.
Local-first knowledge graph for developers. Watches your project files, extracts entities and relationships using LLMs, and lets you query across all your projects in natural language.
“What architecture decisions have I made across projects?”
Cortex finds decisions from your READMEs, TypeScript files, config files, and conversation exports — then synthesizes an answer with source citations.
You work on multiple projects. Decisions, patterns, and context are scattered across hundreds of files. You forget what you decided three months ago. You re-solve problems you already solved in another repo.
Cortex watches your project directories, extracts knowledge automatically, and gives it back to you when you need it.
npm install -g @gzoo/cortex
Or install from source:
git clone https://github.com/gzoonet/cortex.git
cd cortex
npm install && npm run build && npm link
Run the interactive wizard:
cortex init
This walks you through:
~/.cortex/.envConfig is stored at ~/.cortex/cortex.config.json. API keys go in ~/.cortex/.env.
cortex projects add my-app ~/projects/app
cortex projects add api ~/projects/api
cortex projects list # verify
cortex watch # start watching for changes
cortex query "what caching strategies am I using?"
cortex query "what decisions have I made about authentication?"
cortex find "PostgreSQL" --expand 2
cortex contradictions
cortex serve # open http://localhost:3710
Cortex ignores node_modules, dist, .git, and other common directories by default. To add more:
cortex config exclude add docs # exclude a directory
cortex config exclude add "*.log" # exclude by pattern
cortex config exclude list # see all excludes
cortex config exclude remove docs # remove an exclude
Cortex runs a pipeline on every file change:
All data stays local in ~/.cortex/. Only LLM API calls leave your machine
(and never for restricted projects).
Cortex is provider-agnostic. It supports:
| Mode | Cloud Cost | Quality | GPU Required |
|---|---|---|---|
cloud-first |
Varies by provider | Highest | No |
hybrid |
Reduced | High | Yes (Ollama) |
local-first |
Minimal | Good | Yes (Ollama) |
local-only |
$0 | Good | Yes (Ollama) |
Hybrid mode routes high-volume tasks (entity extraction, ranking) to Ollama and reasoning-heavy tasks (relationship inference, queries) to your cloud provider.
All config lives in ~/.cortex/cortex.config.json. API keys are in ~/.cortex/.env.
cortex config list # see all non-default settings
cortex config set llm.mode hybrid # switch routing mode
cortex config set llm.budget.monthlyLimitUsd 10 # set budget
cortex config exclude add vendor # exclude a directory from watching
cortex privacy set ~/clients restricted # mark directory as restricted
Full configuration reference: docs/configuration.md
| Command | Description |
|---|---|
cortex init |
Interactive setup wizard |
cortex projects add <name> [path] |
Register a project directory |
cortex projects list |
List registered projects |
cortex projects remove <name> |
Unregister a project |
cortex projects show <name> |
Show project details |
cortex watch [project] |
Start watching for file changes |
cortex stop |
Stop a running watch process |
cortex query <question> |
Natural language query with citations |
cortex find <term> |
Find entities by name |
cortex ingest <file-or-glob> |
One-shot file ingestion |
cortex status |
Graph stats, costs, provider status |
cortex costs |
Detailed cost breakdown |
cortex contradictions |
List active contradictions |
cortex resolve <id> |
Resolve a contradiction |
cortex models list/pull/test/info |
Manage Ollama models |
cortex serve |
Start web dashboard (localhost:3710) |
cortex mcp |
Start MCP server for Claude Code |
cortex report |
Post-ingestion summary |
cortex privacy set <dir> <level> |
Set directory privacy |
cortex config list/get/set |
Read/write configuration |
cortex config exclude add/remove/list |
Manage file/directory exclusions |
cortex db |
Database operations |
Full CLI reference: docs/cli-reference.md
Run cortex serve to open a full web dashboard at http://localhost:3710 with:
Cortex includes an MCP server so Claude Code can query your knowledge graph directly:
claude mcp add cortex --scope user -- npx @gzoo/cortex mcp
This gives Claude Code 12 tools:
| Tool | Description |
|---|---|
cortex_ask |
Natural language questions about your projects |
get_status |
System status and graph stats |
list_projects |
List registered projects |
find_entity |
Look up entities by name |
query_cortex |
Structured knowledge graph queries |
get_contradictions |
List detected contradictions |
resolve_contradiction |
Resolve a contradiction |
search_entities |
Search entities with filters |
ingest_file |
Trigger file ingestion |
add_project |
Register a new project |
remove_project |
Unregister a project |
session_brief |
Context summary for current session |
Monorepo with eight packages:
Architecture docs: docs/
restricted are never sent to cloud LLMs~/.cortex/ — nothing phones homeFull security architecture: docs/security.md
See CONTRIBUTING.md for guidelines.
MIT — see LICENSE
Built by GZOO — an AI-powered business automation platform.
Cortex started as an internal tool to maintain context across multiple client projects. We open-sourced it because every developer who works on more than one thing loses context, and we think this approach — automatic file watching + knowledge graph + natural language queries — is the right way to solve it.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"gzoo-cortex": {
"command": "npx",
"args": []
}
}
}