system_pipeline
HowItWorks.json
// Deep-dive technical breakdown of the GitMesh AI code intelligence engine.
{ "id": 1, "stepNumber": "01", "title": "Connect & Import", "headline": "Shallow clone and workspace detection", "description": "Paste a public or private GitHub repository URL. GitMesh performs a shallow clone (git clone --depth 1) of the target branch to retrieve the active codebase state. It runs ingestion diagnostics to analyze project files, detect monorepos, locate package configs, and identify all active programming languages.", "tech": [ "GitHub REST API", "Shallow Clone (Depth-1)", "Monorepo Detection", "Workspace Ingestion" ], "codePreview": "$ git clone --depth 1 --branch main https://github.com/owner/repo"}Shallow clone and workspace detection
Shallow cloning ensures we only pull the metadata and files required for structural analysis, optimizing memory and reducing wait times under 2 seconds.
system_execution_flow
Step-by-Step Architecture Process
Walk through the detailed sequence of steps GitMesh performs to clone, analyze, parse, route, and stream answers for your codebase.
Connect & Import
Shallow clone and workspace detectionPaste a public or private GitHub repository URL. GitMesh performs a shallow clone (git clone --depth 1) of the target branch to retrieve the active codebase state. It runs ingestion diagnostics to analyze project files, detect monorepos, locate package configs, and identify all active programming languages.
$ git clone --depth 1 --branch main https://github.com/owner/repoAST Parse & Graph Compile
Tree-sitter syntactic extractionCode files are processed using language-specific Tree-sitter parsers (such as ts_parser.py and python_parser.py). The system extracts structural declaration nodes: classes, functions, import directives, variable declarations, and associated docstrings. By mapping import paths to actual file definitions, it builds a multi-file dependency graph of nodes and relational call edges.
parse_source_file(file_content) → { classes, functions, imports, docstrings }Vectorless RAG Routing
Bi-directional Graph BFS & Hybrid ContextUnlike traditional vector database RAG, GitMesh does not chunk files or store embeddings. First, it uses Gemini LLM structured outputs to map the user query to TargetEntities (target file paths and symbols). It then executes a Breadth-First Search (BFS) graph walk traversing import and dependent relationships. Depth-0 & Depth-1 files load full source code; Depth-2 files load AST outlines (signatures & docstrings only) for import validation. Depth-3 and above are excluded to save tokens.
ASTRouter.walk_graph(target_files, graph_data, max_depth=2) → (depth_1_full, depth_2_signatures)Multi-Agent Pipeline
LangGraph supervisor coordinationThe compiled hybrid context is fed to a multi-agent pipeline choreographed using LangGraph. A supervisor agent node acts as the central router, classifying the user's intent and delegating code retrieval to specialized worker nodes: Code QA for direct questions, Visualizer for Mermaid flowchart rendering, Blast Radius for change-impact diffing, and Repo Summary for codebase overviews.
workflow: START → Supervisor → { CodeQA, Visualizer, BlastRadius, RepoSummary } → ENDSSE Stream & Visualization
SSE text streaming and interactive layoutsResponse outputs are streamed dynamically back to the client console via Server-Sent Events (SSE). The stream broadcasts live agent execution logs (thought chains), final markdown answers, specific code citations linked to file line ranges, and interactive visualizations such as dependency graphs and Mermaid class flowcharts.
data: { "type": "thought", "content": "Supervisor routing query to QA specialist..." }comparison
Why Vectorless Graph RAG?
Traditional RAG splits code into text chunks and compares them using vector embeddings. This loses structure. GitMesh maps relations.
Traditional Vector RAG
- ✗Splits functions and classes mid-line based on character count boundaries.
- ✗Ignores codebase imports, call relationships, and execution pathways.
- ✗Prone to retrieval hallucinations due to semantic similarity overlap.
GitMesh AST Graph RAG
Active- ✓Parses files into syntactically valid AST syntax blocks (methods, exports).
- ✓Builds a complete, multi-file relational import & call dependency graph.
- ✓Context window loading using Graph BFS (Depth-1 source + Depth-2 signatures).