Skip to main content

Project knowledge indexer for AI agents — scans code, tracks documentation staleness, and serves a knowledge graph to AI agents via MCP

Project description

Cortex

A project knowledge indexer that scans your codebase, builds a structured graph of modules, functions, classes, and documentation, and tracks when docs drift from the code they describe. Designed for AI-assisted development -- cortex gives agents structured access to your project through the Model Context Protocol (MCP).

Quick Start

pip install axiom-graph[viz]

axiom-graph init /path/to/your/project    # scan and build the index
axiom-graph check /path/to/your/project   # see what's stale
axiom-graph viz /path/to/your/project     # launch the dashboard

Features

  • Knowledge graph -- indexes Python (and JS/TS via tree-sitter) into nodes and edges: functions, modules, classes, docs, tests, and their relationships
  • Staleness detection -- two-dimensional tracking (own content changes + linked dependency changes) with transitive propagation through doc chains
  • MCP server -- 29 tools for AI agents to search, read, navigate, and modify the index over the Model Context Protocol
  • Viz dashboard -- interactive browser UI with graph view, list view, doc manager, workflow explorer, and detail panels
  • DocJSON -- structured documentation format that links sections to code nodes, enabling automated drift detection
  • dFlow integration -- optional workflow/task decorators with step markers, indexed alongside code
  • CI gate -- axiom-graph check --fail-on any in GitHub Actions prevents stale docs from merging

MCP Server Setup

The MCP server is how AI agents interact with cortex. It uses stdio transport.

Claude Code

Create .mcp.json in your project root:

{
  "mcpServers": {
    "axiom-graph": {
      "type": "stdio",
      "command": "/path/to/your/venv/bin/python",
      "args": ["-m", "axiom_graph.mcp_server"],
      "env": {
        "AXIOM_GRAPH_LOG_LEVEL": "INFO"
      }
    }
  }
}

VS Code (Copilot / Continue)

Add to .vscode/settings.json:

{
  "mcp.servers": {
    "axiom-graph": {
      "command": "/path/to/your/venv/bin/python",
      "args": ["-m", "axiom_graph.mcp_server"],
      "env": {
        "AXIOM_GRAPH_LOG_LEVEL": "INFO"
      }
    }
  }
}

Any MCP client

The entry point is axiom-graph-mcp (installed as a console script) or python -m axiom_graph.mcp_server. Both use stdio transport -- JSON-RPC on stdin/stdout, logs on stderr.

Logging

Variable Default Description
AXIOM_GRAPH_LOG_LEVEL INFO DEBUG, INFO, WARNING, ERROR
AXIOM_GRAPH_LOG_FILE (none) Path to a rotating log file (5 MB max, 2 backups)

Set AXIOM_GRAPH_LOG_LEVEL=DEBUG to see tool entry/exit timing, SQL queries, and build details. Logs always go to stderr; AXIOM_GRAPH_LOG_FILE adds a file copy.

Documentation

Full documentation is available as a consumer docs site:

pip install axiom-graph[viz]              # includes mkdocs-material
axiom-graph render-site /path/to/project  # generates site/ directory
axiom-graph render-site /path/to/project --serve  # live preview at localhost:8000

Or read the DocJSON source files directly in docs/consumer/:

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

axiom_graph-2.0.0.tar.gz (353.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

axiom_graph-2.0.0-py3-none-any.whl (404.5 kB view details)

Uploaded Python 3

File details

Details for the file axiom_graph-2.0.0.tar.gz.

File metadata

  • Download URL: axiom_graph-2.0.0.tar.gz
  • Upload date:
  • Size: 353.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.9 Windows/10

File hashes

Hashes for axiom_graph-2.0.0.tar.gz
Algorithm Hash digest
SHA256 b183b825cc403a5b53cc687a65c09253101bd4a9221fa90a036116f665726a61
MD5 0cb2dc858355f18a61bf817ba358dfa5
BLAKE2b-256 8771aff88afe98951a9dc8e0c6117eb957cba4d3b6287d3bfcfdaf6026889e3d

See more details on using hashes here.

File details

Details for the file axiom_graph-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: axiom_graph-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 404.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.9 Windows/10

File hashes

Hashes for axiom_graph-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b83975a98ebfcd8efe04cc0d48a418cc44afab8107ee735887cb92a7c2e22c05
MD5 320512a8969ce481f83b3151d8110d69
BLAKE2b-256 4b7ed873fd3c7e7ab5b34740e3a1b056a0a0c899b15238f71c0501764a3940c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page