Architecture & Pipeline

Graph-RAG Engine Architecture

CodeAtlas bridges static AST analysis, SQLite metadata caching, and Neo4j graph traversal to deliver context to AI Agents.

System Pipeline

User Question
    β”‚
    β–Ό
AI Agent (Cursor / Antigravity / Claude)
    β”‚ (MCP stdio)
    β–Ό
CodeAtlas MCP Server
    β”‚
    β”œβ”€β–Ί Query Normalizer (Strips stop words, extracts tokens)
    β”‚
    β”œβ”€β–Ί Candidate Search Engine (Stage 1 lookup)
    β”‚
    β”œβ”€β–Ί Neo4j Graph Expansion (Depth 1-3 traversal)
    β”‚
    β”œβ”€β–Ί 6-Factor Reranker (Computes graph proximity & layer score)
    β”‚
    └─► Context Compiler (Packages line ranges & evidence)
    β”‚
    β–Ό
Grounded AI Answer

6-Factor Reranking Formula

Every candidate symbol and node is scored dynamically using 6 parameters:

final_score = semantic_score 
            + lexical_score 
            + symbol_score 
            + graph_proximity 
            + entry_point_score 
            + relationship_score

Architectural Layer Derivation

CodeAtlas precomputes architectural layers during AST extraction:

ROUTE
HTTP endpoints (e.g. POST /upload, GET /api/users).
CONTROLLER
Request handler functions mapping HTTP routes to business logic.
SERVICE
Core domain logic, media processors, and transcoding services.
REPOSITORY
Data access objects, database queries, and storage adapters.