CodeGraph Rust

repository·main·Indexed 21 days ago

https://github.com/jakedismo/codegraph-rust

A tool that transforms codebases into semantically searchable knowledge graphs for AI agents. It provides structural, relational, and architectural context through features like semantic search, clone detection, and impact analysis. The project includes specialized crates: codegraph-mcp for agentic tool suites, codegraph-graph for RocksDB-backed storage with I/O batching, codegraph-concurrent for lock-free data structures, and codegraph-parser for high-performance parsing with optional io_uring support.

Tokens
131.6K
Snippets
405
Records
623
Agent score
74%

What's inside codegraph-rust

  1. Overview of CodeGraph Vector (`codegraph-vector`)

    main
    The codegraph-vector crate handles the vector embedding generation process for the CodeGraph ecosystem. Its primary purpose is to transform code nodes into high-dimensional vectors, enabling semantic search and AI-driven graph analysis. It is a core component used by codegraph-mcp to enrich CodeNodes before they are persisted to a database.
  2. Overview of CodeGraph MCP (`codegraph-mcp`)

    main
    The codegraph-mcp crate serves as the central orchestrator for the CodeGraph system. It is responsible for implementing the Model Context Protocol (MCP) server and coordinating the entire indexing pipeline. It acts as the unified interface that connects the internal graph processing logic to external consumers like IDEs and AI assistants.
  3. Overview of CodeGraph MCP Tools

    main

    The codegraph-mcp-tools package provides specific tool implementations exposed by the CodeGraph MCP (Model Context Protocol) server. These tools allow AI agents to interact with codebases through three primary capabilities:

    1. Search: Locating specific code patterns or text.
    2. Graph Traversal: Navigating the structural relationships within the code graph.
    3. Semantic Analysis: Performing high-level analysis of code meaning and intent.
  4. Overview of CodeGraph Zerocopy

    main
    CodeGraph Zerocopy (codegraph-zerocopy) is a specialized crate focused on maximizing serialization performance. It is designed for scenarios involving large graphs where traditional deserialization overhead becomes a performance bottleneck. By utilizing zero-copy techniques, it allows for storing and retrieving complex graph structures with minimal CPU and memory overhead.
  5. Overview of the CodeGraph MCP Daemon

    main

    The codegraph-mcp-daemon is a background service designed to support the CodeGraph system. It manages long-running processes and state that are required for continuous code intelligence. Its primary responsibilities include:

    • File watching: Monitoring the filesystem for changes using the notify crate.
    • Incremental indexing triggers: Initiating updates to the code graph when changes are detected.
    • Long-running state management: Maintaining the necessary state for the CodeGraph ecosystem to function continuously.
  6. Overview of CodeGraph AI (`codegraph-ai`)

    main
    The codegraph-ai crate provides high-level LLM (Large Language Model) integration capabilities. Unlike simple vector embeddings used for similarity searches, codegraph-ai is designed for complex reasoning tasks that require semantic understanding, such as "Semantic Edge Resolution" (e.g., determining if a generic function call like handle_request maps to a specific controller).
  7. Overview of the CodeGraph MCP Family

    main

    The CodeGraph MCP (Model Context Protocol) family is a suite of modular crates designed to provide agentic tools and graph-based context to LLMs. The suite is divided into core protocol implementations, server management, background services, and specialized toolsets.

    Key components include:

    • codegraph-mcp-core: Shared traits and types for the MCP protocol.
    • codegraph-mcp-server: The primary binary/library for running the MCP server, managing connection lifecycles via Stdio or SSE.
    • codegraph-mcp-daemon: A background service for filesystem watching (triggering incremental re-indexing) and long-running graph state management.
    • codegraph-mcp-tools: A collection of tools for semantic/exact search and graph traversal.
    • codegraph-mcp-autoagents: Experimental autonomous agents using an Observation -> Thought -> Action loop.
    • codegraph-mcp-rig: Scaffolding for developing and testing new MCP tools.
  8. Explore CodeGraph crate documentation

    main

    CodeGraph is organized into several specialized crates. Depending on your integration needs, you may interact with different layers of the system:

    Core & Data

    • codegraph-core: Provides fundamental types and models like CodeNode and ExtractionResult.
    • codegraph-graph: Handles the Database Access Layer using SurrealDB.
    • codegraph-zerocopy: Contains zero-copy serialization utilities.

    Processing & AI

    • codegraph-parser: Manages Tree-sitter parsing and unified extraction.
    • codegraph-vector: Handles embeddings and chunking.
    • codegraph-ai: Provides abstractions for LLM providers.
    • codegraph-cache: Implements caching and read-ahead mechanisms.
    • codegraph-concurrent: Provides concurrency primitives.

    MCP Ecosystem

    • codegraph-mcp: The main Orchestrator and Indexer.
    • codegraph-mcp-server: The server binary and its setup.
    • codegraph-mcp-daemon: A background service with file watching capabilities.
    • codegraph-mcp-tools: Specific tool implementations for MCP.
    • codegraph-mcp-core: Shared MCP traits.
    • codegraph-mcp-autoagents: Experimental agents.
    • codegraph-mcp-rig: A testing rig.