Intent
Current search ranking relies solely on vector cosine similarity — a flat relevance score with no understanding of code structure or architectural importance. Leading competitors like Augment Code use semantic dependency graphs to understand which files and symbols are architecturally central, enabling them to surface the most impactful results first.
Codetriever already parses code with tree-sitter and extracts symbols. The next step is building a dependency graph from this parse data — nodes represent files/symbols, edges represent imports, function calls, type references, and inheritance. This graph enables PageRank-style scoring to boost architecturally central code in search results, and powers features like "find all callers" and "trace dependency chains."
Business Rules
- The system MUST build a directed dependency graph from parsed code, where nodes are files or symbols and edges represent relationships (imports, calls, type references, inheritance)
- The dependency graph MUST be scoped per repository per branch (consistent with existing multi-tenancy model)
- Search results MUST be re-rankable using graph centrality scores (e.g., PageRank or similar) in addition to vector similarity
- Graph-based re-ranking MUST be optional and configurable — pure vector similarity must remain available as the default
- The dependency graph MUST be incrementally updatable when individual files are re-indexed
- The system SHOULD support querying the graph directly: "what depends on this symbol?" and "what does this symbol depend on?"
- Edge types MUST be labeled (import, call, type_reference, inheritance) to enable filtered graph queries
- The graph MUST NOT require a separate graph database — it should be stored in PostgreSQL or as an in-memory structure rebuilt from metadata
Competitive Context
- Augment Code's "Context Engine" uses semantic dependency graphs as its core differentiator, processing 400K+ files
- Microsoft's GraphRAG approach (entity-relation graphs) is being applied to codebases
- AST MCP Server provides structural graph awareness via tree-sitter
- Sourcegraph offers code graph navigation (go-to-definition, find-references) at enterprise scale
- This is what separates "search" from "intelligence" — understanding how code connects
Acceptance Criteria
Intent
Current search ranking relies solely on vector cosine similarity — a flat relevance score with no understanding of code structure or architectural importance. Leading competitors like Augment Code use semantic dependency graphs to understand which files and symbols are architecturally central, enabling them to surface the most impactful results first.
Codetriever already parses code with tree-sitter and extracts symbols. The next step is building a dependency graph from this parse data — nodes represent files/symbols, edges represent imports, function calls, type references, and inheritance. This graph enables PageRank-style scoring to boost architecturally central code in search results, and powers features like "find all callers" and "trace dependency chains."
Business Rules
Competitive Context
Acceptance Criteria