codegraph-rust  by Jakedismo

Codebase knowledge graph for AI agents

Created 8 months ago
681 stars

Top 49.4% on SourcePulse

GitHubView on GitHub
Project Summary

CodeGraph transforms codebases into semantically searchable knowledge graphs, enabling AI agents to reason about code architecture and impact beyond simple text search. It targets engineers and power users seeking to enhance AI coding assistants with deep, relational codebase understanding, shifting cognitive load from the AI to CodeGraph for more efficient and accurate assistance.

How It Works

CodeGraph builds a knowledge graph from code (AST, LSP, FastML) and combines it with embeddings. It offers configurable indexing tiers ('fast', 'balanced', 'full') to balance speed and richness. Core to its approach are four agentic tools that use reasoning agents to analyze the graph and synthesize answers, providing deep context and relationships rather than raw search results. This approach allows AI agents to understand code structure, dependencies, and impact more effectively.

Quick Start & Requirements

  • Primary install: Clone the repository and run ./install-codegraph-full-features.sh.
  • Non-default prerequisites: A running SurrealDB instance, schema application (cd schema && ./apply-schema.sh), and language-specific LSP servers (e.g., rust-analyzer) for richer indexing tiers.
  • Links: SurrealDB Cloud (surrealdb.com/cloud). Installation and Usage guides are mentioned but lack direct URLs.

Highlighted Details

  • Indexing Tiers: 'fast', 'balanced', 'full' options for configurable indexing depth vs. speed.
  • Agentic Tools: Four consolidated tools (agentic_context, agentic_impact, agentic_architecture, agentic_quality) provide synthesized answers via reasoning agents.
  • Agent Architectures: Supports Rig (default, Rust-native), ReAct, and LATS, with Reflexion for auto-recovery.
  • Tier-Aware Intelligence: Dynamically adjusts LLM prompts based on configured context window size.
  • Context Overflow Protection: Multi-layer guards prevent expensive failures from exceeding LLM context limits.
  • Hybrid Search: Combines vector similarity (70%), lexical search (30%), and graph traversal.
  • Provider Flexibility: Supports diverse embedding models and LLMs (local/cloud).
  • SurrealDB Backend: Utilizes SurrealDB with HNSW for efficient graph and vector storage.
  • Daemon Mode: Automatic background re-indexing via --watch or daemon start.

Licensing & Compatibility

  • License type: MIT.
  • Compatibility: Permissive MIT license allows for commercial use and integration into closed-source projects.

Limitations & Caveats

  • Experimental Schema: An optional graph schema requires manual application and offers potentially faster graph operations.
  • Future Development: Planned features include expanded language support, cross-repository analysis, and a plugin system.
  • LSP Dependencies: Richer indexing tiers depend on correctly configured external language servers.
Health Check
Last Commit

4 months ago

Responsiveness

Inactive

Pull Requests (30d)
2
Issues (30d)
8
Star History
509 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.