GZOO Cortex
About
Local-first knowledge graph for developers. Watches project files, extracts entities and relationships via LLMs, and lets you query across projects with natural language and source citations.
Details
- Author
- gzoonet
- Categories
- Developer Tools, Knowledge Base, AI
Jump to
Setup
Install GZOO Cortex in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/gzoonet/cortex
Follow the installation instructions in the repository README, then restart your MCP client.
- Ask natural language questions about your projects— query your knowledge graph withcortex_askand get answers with source citations.
- Check system status and graph stats— useget_statusto see entity counts, provider health, and recent activity.
- List and manage registered projects—list_projects,add_project, andremove_projectlet you view and control which directories are tracked.
- Find and search entities by name or filters—find_entityandsearch_entitieslocate decisions, components, patterns, and more.
- Review and resolve contradictions—get_contradictionssurfaces conflicting decisions, andresolve_contradictionmarks them resolved.
- Ingest files on demand—ingest_filetriggers extraction for a specific file without waiting for the watcher.
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.
- Watchesyour project files (md, ts, js, py, json, yaml) for changes
- Extractsentities: decisions, patterns, components, dependencies, constraints, action items
- Infersrelationships between entities across projects
- Detectscontradictions when decisions conflict
- Queriesin natural language with source citations
- Searches semantically— blends keyword and vector (embedding) similarity so queries match by meaning, not just keywords (optional; seeSemantic Search)
- Routesintelligently between cloud and local LLMs
- Respectsprivacy — restricted projects never leave your machine
- Web dashboardwith knowledge graph visualization, live feed, and query explorer
- MCP serverfor direct integration with Claude Code
If global install fails withEACCES, use a user prefix instead:
mkdir -p ~/.local npm config set prefix ~/.local echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc source ~/.bashrc npm install -g @gzoo/cortex
git clone https://github.com/gzoonet/cortex.git cd cortex npm install && npm run build && npm link
Verify:cortex --version(current release:0.8.1)
cortex init cortex doctor # verify config, providers, and DB
- LLM provider— Anthropic, Google Gemini, DeepSeek, Groq, OpenRouter, or Ollama (local)
- API key— saved securely to~/.cortex/.env
- Routing mode— cloud-first, hybrid, local-first, or local-only
- Watch directories— which directories Cortex should monitor
- Budget limit— monthly LLM spend cap
cortex initwrites global config to~/.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
Backfill existing files first— the watcher only picks up new changes:
cortex ingest "~/projects/app/src//.ts" # one-shot backfill cortex serve # dashboard + API + file watcher (recommended)
Don't runwatchandservetogether— they compete for file changes. The Live Feed shows real-time events fromcortex serveonly (file saves while the server is running).
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
Auth is enforced automatically on non-localhost hosts. A bearer token is auto-generated and saved to~/.cortex/.env(read it withgrep CORTEX_SERVER_AUTH_TOKEN ~/.cortex/.env). Open the dashboard once withhttp://<host>:3710/?token=<token>— the token is embedded only for requests that already prove possession of it and is then kept for the browser tab (so anonymous visitors never receive it). API/WebSocket calls behind a reverse proxy useAuthorization: Bearer <token>.
Cortex ignoresnode_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:
- Parse— file content is chunked by a language-aware parser (tree-sitter for code, remark for markdown)
- Extract— LLM identifies entities (decisions, components, patterns, etc.)
- Relate— LLM infers relationships between new and existing entities
- Detect— contradictions and duplicates are flagged automatically
- Store— entities, relationships, and vectors go into SQLite + LanceDB
- Query— natural language queries search the graph and synthesize answers
All data stays local in~/.cortex/. Only LLM API calls leave your machine (and never for restricted projects).
Cortex isprovider-agnostic. It supports:
- Anthropic Claude(Sonnet, Haiku) — via native Anthropic API
- Google Gemini— via OpenAI-compatible API
- DeepSeek(Reasoner, Chat) — strong reasoning, very affordable
- Groq— fast inference with free tier
- Any OpenAI-compatible API— OpenRouter, local proxies, etc.
- Ollama(Mistral, Llama, etc.) — fully local, no cloud required
Cost tracking uses provider-aware rates for DeepSeek, Gemini, Groq, and OpenRouter models — not a blanket Anthropic fallback.
Embeddings(for semantic search) are configured as aseparateprovider — independent of your chat model — so you can run chat on DeepSeek and embeddings on OpenAI. SeeSemantic Search.
Incloud-firstmode, all tasks route to your cloud provider. Ollama is not required and is only used if budget fallback is enabled. Hybrid mode routes high-volume tasks (entity extraction, ranking) to Ollama and reasoning-heavy tasks (relationship inference, queries) to your cloud provider.
- Node.js20+
- LLM API keyfor cloud modes — Anthropic, Google Gemini, DeepSeek, Groq, or any OpenAI-compatible provider
- Ollama— only forhybrid,local-first, orlocal-onlymodes (install)
Config is layered — later sources override earlier ones:
API keys are stored separately in~/.cortex/.env(never in config JSON).
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 cortex doctor # validate setup
Full configuration reference:docs/configuration.md
Cortex blends keyword (full-text) search withvector similarity, so queries match by meaning rather than exact words. Embeddings areoptional and off by default— enable them with a cloud embeddings provider (no local GPU or Ollama required):
cortex config set llm.embeddings.enabled true cortex config set llm.embeddings.baseUrl https://api.openai.com/v1 cortex config set llm.embeddings.model text-embedding-3-small cortex config set llm.embeddings.apiKeySource env:OPENAI_API_KEY cortex config set llm.embeddings.dimensions 1536 # then add the key to ~/.cortex/.env: echo 'OPENAI_API_KEY=sk-...' >> ~/.cortex/.env
The embeddings provider isindependent of your chat provider— run chat on DeepSeek (or Anthropic, Groq, …) and embeddings on OpenAI. Any OpenAI-compatible embeddings endpoint works.
New files are embedded automatically as they're ingested. To build the index for a graph youalreadyingested, run a one-time reindex:
cortex reindex # all projects cortex reindex my-app # a single project
Full CLI reference:docs/cli-reference.md
Runcortex serveto open a full web dashboard athttp://localhost:3710with:
- Dashboard Home— graph stats, recent activity, entity type breakdown
- Knowledge Graph— interactive D3-force graph with clustering, click to explore
- Live Feed— real-time file change and entity extraction events via WebSocket (fromcortex serveonly)
- Query Explorer— natural language queries with streaming responses
- Contradiction Resolver— review and resolve conflicting decisions
For access beyond localhost, bind to all interfaces and put Cortex behind a reverse proxy:
Example nginx config — protect/api/and/wswith basic auth; serve static assets without auth (the dashboard injects the bearer token into HTML):
location /api/ { auth_basic "Cortex"; auth_basic_user_file /etc/nginx/.htpasswd; proxy_pass http://127.0.0.1:3710; proxy_set_header Authorization "Bearer $CORTEX_TOKEN"; } location /ws { auth_basic "Cortex"; auth_basic_user_file /etc/nginx/.htpasswd; proxy_pass http://127.0.0.1:3710; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location / { auth_basic off; proxy_pass http://127.0.0.1:3710; }
SetCORTEX_SERVER_AUTH_TOKENorserver.auth.tokenin config. When auth is enabled, Cortex injects the token into the dashboard HTML so API and WebSocket calls authenticate automatically.
Cortex includes an MCP server so Claude Code can query your knowledge graph directly:
claude mcp add cortex --scope user -- npx @gzoo/cortex mcp
- @cortex/core— types, EventBus, config loader, error classes
- @cortex/ingest— file parsers (tree-sitter + remark), chunker, watcher, pipeline
- @cortex/graph— SQLite store, LanceDB vectors, query engine
- @cortex/llm— Anthropic/Gemini/OpenAI-compatible/Ollama providers, router, prompts, cache
- @cortex/cli— Commander.js CLI
- @cortex/mcp— Model Context Protocol server (stdio transport, 12 tools)
- @cortex/server— Express REST API + WebSocket relay
- @cortex/web— React + Vite + D3 web dashboard
- Files classified asrestrictedarenever**sent to cloud LLMs
- Sensitive files (.env, .pem, .key) are auto-detected and blocked
- API key secrets are scanned and redacted before any cloud transmission
- All data stored locally in~/.cortex/— nothing phones home
Full security architecture:docs/security.md
- SQLitevia better-sqlite3 — entity and relationship storage
- LanceDB— vector embeddings for semantic search
- Anthropic Claude— cloud LLM provider
- Google Gemini— cloud LLM provider (via OpenAI-compatible API)
- DeepSeek— cloud LLM provider (reasoning + chat)
- Groq— fast cloud inference
- Ollama— local LLM inference
- tree-sitter— language-aware file parsing
- Chokidar— cross-platform file watching
- Commander.js— CLI framework
- React+Vite— web dashboard
- D3— knowledge graph visualization
Built byGZOO— 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.
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
A server for CodeFuse-CGM, a graph-integrated large language model designed for repository-level software engineering tasks.
Developer context continuity system that builds a temporal knowledge graph of your codebase — modules, symbols, decisions, and open problems — and serves it to AI coding agents via 12 MCP tools, so every agent session starts knowing your architecture without manual context pasting.
Knowledge graph for token-efficient code reviews with Tree-sitter parsing, dual-mode embedding (ONNX + LiteLLM), and blast-radius analysis via MCP tools.
MCP server that ingests project docs once and lets Claude search by meaning instead of reading everything — saving tokens on large codebases
Easily provide codebase context to Large Language Models (LLMs).
An MCP server that indexes local code into a graph database to provide context to AI assistants.
Code Rag with Graph - local only installation
A blazingly fast codebase graphRAG implementation in 100% Rust
Graph-powered code intelligence MCP server with semantic search, knowledge graph, and dependency analysis for Claude Code, Cursor, and Copilot.
Provides up-to-date, version-specific documentation and code examples for libraries directly into your prompt.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





