GZOO Cortex

GZOO Cortex

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.

Category
访问服务器

README

GZOO Cortex

<p align="center"> <img src="social-preview.png" alt="GZOO Cortex — Local-first knowledge graph for developers" width="100%" /> </p>

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.

Why

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.

What It Does

  • Watches your project files (md, ts, js, json, yaml) for changes
  • Extracts entities: decisions, patterns, components, dependencies, constraints, action items
  • Infers relationships between entities across projects
  • Detects contradictions when decisions conflict
  • Queries in natural language with source citations
  • Routes intelligently between cloud and local LLMs
  • Respects privacy — restricted projects never leave your machine
  • Web dashboard with knowledge graph visualization, live feed, and query explorer
  • MCP server for direct integration with Claude Code

Quick Start

1. Install

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

2. Setup

Run the interactive wizard:

cortex init

This walks you through:

  • LLM provider — Anthropic, Google Gemini, 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

Config is stored at ~/.cortex/cortex.config.json. API keys go in ~/.cortex/.env.

3. Register Projects

cortex projects add my-app ~/projects/app
cortex projects add api ~/projects/api
cortex projects list                       # verify

4. Watch & Query

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

5. Web Dashboard

cortex serve                               # open http://localhost:3710

Excluding Files & Directories

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

How It Works

Cortex runs a pipeline on every file change:

  1. Parse — file content is chunked by a language-aware parser (tree-sitter for code, remark for markdown)
  2. Extract — LLM identifies entities (decisions, components, patterns, etc.)
  3. Relate — LLM infers relationships between new and existing entities
  4. Detect — contradictions and duplicates are flagged automatically
  5. Store — entities, relationships, and vectors go into SQLite + LanceDB
  6. 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).

LLM Providers

Cortex is provider-agnostic. It supports:

  • Anthropic Claude (Sonnet, Haiku) — via native Anthropic API
  • Google Gemini — via OpenAI-compatible API
  • Any OpenAI-compatible API — OpenRouter, local proxies, etc.
  • Ollama (Mistral, Llama, etc.) — fully local, no cloud required

Routing Modes

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.

Requirements

  • Node.js 20+
  • LLM API key for cloud modes — Anthropic, Google Gemini, or any OpenAI-compatible provider
  • Ollama (for hybrid/local modes) — install

Configuration

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

Commands

Command Description
cortex init Interactive setup wizard
cortex projects add <name> [path] Register a project directory
cortex projects list List registered projects
cortex watch [project] Start watching for file changes
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

Web Dashboard

Run cortex serve to open a full web dashboard at http://localhost:3710 with:

  • 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
  • Query Explorer — natural language queries with streaming responses
  • Contradiction Resolver — review and resolve conflicting decisions

MCP Server (Claude Code Integration)

Cortex includes an MCP server so Claude Code can query your knowledge graph directly:

claude mcp add cortex --scope user -- node /path/to/packages/mcp/dist/index.js

This gives Claude Code 4 tools: get_status, list_projects, find_entity, query_cortex.

Architecture

Monorepo with eight packages:

  • @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 with 17 commands
  • @cortex/mcp — Model Context Protocol server (stdio transport)
  • @cortex/server — Express REST API + WebSocket relay
  • @cortex/web — React + Vite + D3 web dashboard

Architecture docs: docs/

Privacy & Security

  • Files classified as restricted are never 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

Built With

Contributing

See CONTRIBUTING.md for guidelines.

License

MIT — see LICENSE

About

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.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选