Skip to main content

Interactive CLI that indexes polyglot repositories into a queryable knowledge graph for AI agents

Project description

Saurix

Saurix is an interactive knowledge graph engine that transforms complex codebases into a queryable, 3D-visualizable map. It is designed to be the Symbolic Intelligence Layer for modern AI coding agents.

Why Saurix for AI Agents?

Saurix solves the "Context Window" problem for LLMs by providing a structured representation of code that is superior to keyword search:

  • Structural Awareness: Understands CALLS, INHERITS, and IMPORTS relationships rather than just raw text.
  • Context Efficiency: Agents can query specific subgraphs, receiving only the architectural context they need, drastically reducing token usage.
  • Blast Radius Analysis: Built-in impact analysis allows agents to calculate the transitive side effects of a proposed change before making it.
  • Native MCP Support: Built on the Model Context Protocol, allowing AI agents to treat the repository graph as an extension of their own memory.

See docs/agent-lifecycle.md for a step-by-step walkthrough of how an AI agent uses these capabilities.


1) Core Mission

  • Knowledge Extraction: Turn local or GitHub repositories into a structured graph of symbols and relationships.
  • Agent Infrastructure: Expose high-level tools (MCP) for autonomous agents to navigate complex architectures.
  • Fast Navigation: Answer questions about dependencies, callers, and impact analysis in milliseconds.
  • Modular Architecture: Built for extensibility across languages and tools.

2) Architecture

Saurix follows a clean, domain-driven modular structure:

flowchart TD
    subgraph core
        A[Indexing] --> B[Graph Store]
        B --> C[Cache]
        D[Source Prep] --> A
    end
    subgraph analysis
        E[Extractors] --> A
        F[Python] --> E
        G[TypeScript] --> E
        H[Go/Java/Stub] --> E
    end
    subgraph discovery
        I[Search/Query] --> B
        J[Traversal/Impact] --> B
        K[Visualizer] --> B
    end
    subgraph agents
        L[MCP Server] --> discovery
        L --> core
    end
    subgraph cli
        M[Interactive Shell] --> discovery
        M --> core
    end
  • saurix.core: Root indexing orchestration, graph models, and incremental caching.
  • saurix.analysis: Language-specific AST and Tree-sitter extractors.
  • saurix.discovery: Relationship discovery, search logic, and visualization generation.
  • saurix.agents.mcp: Tooling interface for AI agents.
  • saurix.infra: Centralized configuration and structured logging.

Setup & Installation

Choose the path that fits your workflow:

A) The "Power User" Path (Global & Project-Native)

Recommended for using Saurix as a permanent tool for your own development projects.

  1. Install Globally:
    pip install -e .
    
  2. Initialize Any Project:
    cd /path/to/your/project
    saurix init
    
    This command indexes your project, creates a local 3D dashboard (saurix.html), and generates your MCP config in one step.

B) The "Developer" Path (Standalone)

Recommended if you want to contribute to Saurix or run it in isolation using uv.

  1. Clone & Setup:
    git clone https://github.com/anismabaziz/saurix.git
    cd saurix
    uv sync
    
  2. Run via uv:
    uv run saurix
    

Running the MCP Server

Expose graph tools to AI agents (e.g., Claude Desktop, Cursor):

saurix-mcp

4) Interactive Commands

Command Description
init Zero-config setup for the current project
index <source> Index a local path or GitHub URL
stats Show graph statistics and extraction coverage
find <query> Fuzzy search symbols by name or ID
callers <sym> List symbols calling the target
path <A> <B> Find shortest directed path between two symbols
impact <sym> Estimate blast radius of a change
visual Generate a hybrid 2D/3D knowledge graph visualization
export Export to GraphML or Neo4j CSV

5) AI Agent Integration (MCP)

Saurix is optimized for agentic workflows. It exposes tools that help agents understand:

  1. Context Discovery: find_symbol and related_files.
  2. Behavioral Mapping: callers and path_between.
  3. Risk Assessment: impact_of_symbol.

Configure your agent with the saurix-mcp entry point. Once configured, the AI client (e.g., Claude Desktop) will automatically manage the server lifecycle—starting it in the background when needed and stopping it when the app closes. No manual terminal execution is required.


6) Development

Running Tests

uv run pytest

Testing the MCP Server

You can test the MCP integration without a full IDE using the MCP Inspector:

  1. Install the Inspector: npm install -g @modelcontextprotocol/inspector
  2. Run the Server: npx @modelcontextprotocol/inspector uv run saurix-mcp
  3. Interact: Open http://localhost:5173, click Connect, and use the Call Tool tab.

For step-by-step setup (Claude Desktop, Cursor, OpenCode), simply run saurix init in your project folder.

Roadmap

  • Rich Cross-Language Resolution: Better linking across monorepos.
  • LLM Integration: Optional LLM-powered relationship refinement.
  • Remote Store: Support for remote graph databases (Neo4j/Memgraph).
  • Dynamic Language Support: Plug-and-play extractor modules.

Saurix is built for the era of autonomous coding.

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

saurix-0.1.0.tar.gz (104.3 kB view details)

Uploaded Source

Built Distribution

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

saurix-0.1.0-py3-none-any.whl (53.1 kB view details)

Uploaded Python 3

File details

Details for the file saurix-0.1.0.tar.gz.

File metadata

  • Download URL: saurix-0.1.0.tar.gz
  • Upload date:
  • Size: 104.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for saurix-0.1.0.tar.gz
Algorithm Hash digest
SHA256 29fd05b6d875d3b3c485bfab507443675b58ebc4283727bca6afe4ad83b1a23d
MD5 36ad14961b0a6c8debf366df1ac4a067
BLAKE2b-256 714dd84fcfbc85eae58f1272e969434aba0383ae5974ad726d9435bf74cb4014

See more details on using hashes here.

File details

Details for the file saurix-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: saurix-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 53.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for saurix-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b425303c70edb445fdb7b94f3addd29de580252cdc5c1b3bac68e681808e8ce
MD5 ba6a1e8e019061aba56871945ec30a2d
BLAKE2b-256 d02da0eacb9199de6e0ac7d80e78b61ac9c7c1f10c60f9a0a1dbcfce7e4e75f7

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