You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Persistent knowledge graph for your codebase. Cortex Index converts source code into a queryable graph with symbol resolution, call tracking, and token-optimized AI context building β all local, no cloud, no vector DB.
β‘ Key Features
20 MCP Tools β Full Model Context Protocol (MCP v1.0) over stdio JSON-RPC 2.0
π§ Brain System β Persistent .cortex/brain.md stores project purpose, rules, and knowledge. Created on cortex init, queryable via cortex_brain_get/update/append MCP tools. AI agents learn once, remember forever.
Search Layer β Three search tools: recursive knowledge base search, line-level grep across workspace files, and glob pattern matching for file discovery.
Skills Management β Install, uninstall, list, search, and update reusable AI skill conventions templates. Both workspace-scoped and global.
Task Tracking β Create, update, complete, list, show, and delete tracked tasks in .cortex/tasks/.
Codebase Documentation β Auto-generated architecture overview (codebase.md) with metadata that stays in sync via cortex update.
Project-Local β No global database. Each project owns .cortex/ next to it. cortex init creates it. cortex clean resets it.
Embedded Storage β Pebble LSM tree embedded KV store at .cortex/data/.
# Install
git clone https://github.com/Haslab-dev/CortexIndex.git
cd CortexIndex && make && make install
# Create a projectcd~/my-project
cortex init # creates .cortex/ + project.json + brain.md + codebase.md + full index
cortex update # refresh project metadata and codebase.md# Quick MCP test
cortex mcp call cortex_brain_get '{}'
π§ Brain System β Persistent Agent Knowledge
The brain file (.cortex/brain.md) records your project's purpose, rules, and explanations. Created automatically on cortex init. AI agents read it to understand context without codebase exploration.
# Read brain
cortex brain
# Add knowledge (append)
cortex brain add "Uses Pebble KV storage"# Append as "Learned"
cortex brain append "Providers self-register via init() calling Register()"# Add a rule
cortex brain rule add "All APIs must have timeout handling"# Add a permission
cortex brain permission add "can access database credentials"# Set an instruction
cortex brain instruction set"Always check .cortex/brain.md before modifying code"# Search brain content
cortex brain search "Pebble"# Via MCP (agent-friendly)
cortex mcp call cortex_brain_append '{"line":"Uses Pebble KV storage"}'
The brain persists between agent sessions β knowledge learned once is retained.
π Performance Benchmarks
Tested on cortex-index (self-project):
Operation
Time
Notes
Brain get
<1ms
Read brain.md content
Brain append
<1ms
append-only write
Grep workspace
<1ms
Recursive text search
Glob pattern
<1ms
File path matching
Skill CRUD
<1ms
install/uninstall/list/search/update
Task CRUD
<1ms
create/update/complete/list/show/delete
Codebase init
<1ms
Generate architecture overview
Codebase update
<1ms
Refresh metadata
π 20 MCP Tools Reference
π§ Brain (3 tools)
Tool
Description
Example
cortex_brain_get
Read brain.md (purpose/rules)
{}
cortex_brain_update
Replace brain.md content
{"content":"## Purpose\n..."}
cortex_brain_append
Append line as "Learned"
{"line":"Uses Pebble storage"}
π Search (3 tools)
Tool
Description
Example
cortex_search
Search knowledge base and codebase files recursively
{"query":"MCP"}
cortex_grep
Search for target text within workspace files
{"query":"cortex"}
cortex_glob
Match file paths in workspace using glob pattern
{"pattern":"**/*.go"}
π― Skills (5 tools)
Tool
Description
Example
cortex_skill_install
Install a coding skill conventions template
{"name":"refactor"}
cortex_skill_uninstall
Uninstall a coding skill conventions template
{"name":"refactor"}
cortex_skill_list
List all global and workspace skills
{}
cortex_skill_search
Search for skills by query text
{"query":"refactor"}
cortex_skill_update
Update or install coding skill content
{"name":"refactor"}
β Tasks (6 tools)
Tool
Description
Example
cortex_task_create
Create a task tracking document
{"name":"test","goal":"Test"}
cortex_task_update
Update active task status
{"name":"test","status":"in_progress"}
cortex_task_complete
Mark a task tracking document completed
{"name":"test"}
cortex_task_list
List all registered workspace tasks
{}
cortex_task_show
Show detailed task instructions
{"name":"test"}
cortex_task_delete
Delete/remove task document from workspace
{"name":"test"}
π Codebase (3 tools)
Tool
Description
Example
cortex_codebase_init
Initialize codebase.md architecture overview
{}
cortex_codebase_update
Update codebase.md metadata recursively
{}
cortex_codebase_get
Get the content of the codebase.md architecture overview file
Local-first AI code intelligence engine & persistent semantic OS for your codebase. Features: 22 native MCP tools, Go AST graph engine, Context Builder, and a Bun-powered Web UI dashboard.