A Structurally Aware code understanding Agent for Onboarding and training.
This repository contains the cloud backend powering a code intelligence and agent-assisted developer system. The platform ingests repositories, builds semantic and structural understanding of codebases, and enables AI agents to retrieve architectural knowledge only when required.
The backend transforms raw source code into a hybrid knowledge system combining:
- Semantic search (vector embeddings)
- Structural reasoning (knowledge graph)
The system is designed to run both as:
- Distributed cloud infrastructure, or
- Instance-based deployments with reduced components.
The backend consists of three primary services:
- Ingestion Service --- Repository parsing, dependency extraction, embeddings, and graph construction\
- Semantic Service (Optional) --- LLM-powered description generation pipeline\
- Lambda Backend --- Agent utilities and retrieval orchestration
Workers → Queue → Semantic Service (vLLM + DeepSeekCoder)
The ingestion pipeline converts a repository into structured machine-understandable knowledge.
- Parallelized repository extraction
- Repository cloning
- Static code analysis using Tree-sitter
- Dependency and relationship discovery
- Semantic metadata extraction
- Embedding generation
- Knowledge graph construction
The service first clones the target repository locally before analysis begins.
Tree-sitter is used to parse source files and extract:
- Imports
- Function and method calls
- Class relationships
- Module dependencies
Code units are converted into structured descriptions capturing functional intent.
Extracted code entities are embedded and stored in OpenSearch for semantic retrieval.
A dependency graph is simultaneously created in Amazon Neptune:
- Nodes represent code entities
- Edges represent relationships such as imports, calls, and dependencies
- Vector embeddings for semantic search
- Knowledge graph for structural reasoning
Provides large-scale semantic understanding using an LLM inference service.
Note:
This service is optional and primarily intended for distributed or high-throughput deployments.
Instance-based setups can bypass this service and generate descriptions directly during ingestion.
- Runs on vLLM
- Uses DeepSeekCoder for code reasoning and description generation
The service operates using a queue-driven workflow:
Workers → Processing Queue → LLM Processor → Structured Descriptions
- Ingestion workers push parsing outputs to a queue.
- The semantic service consumes jobs asynchronously.
- DeepSeekCoder generates:
- Code summaries
- Functional descriptions
- Architectural explanations
- Results are returned to the ingestion pipeline.
For smaller deployments:
- Running a dedicated LLM service may be unnecessary.
- Descriptions can be generated inline.
- Reduces infrastructure complexity.
For large-scale ingestion:
- Prevents GPU overload
- Enables centralized inference
- Improves throughput and scalability
Acts as the execution layer for AI agents interacting with indexed repositories.
- Uses Claude as the reasoning agent.
- Retrieval is performed only when additional context is required.
- Agent helper utilities
- Conditional retrieval orchestration
- Graph and semantic queries
- Session-aware execution logic
The agent dynamically decides when to retrieve knowledge:
- Query Neptune for structural relationships
- Query vector index for semantic similarity
- Merge retrieved context into reasoning flow
This approach improves:
- Accuracy
- Context efficiency
- Architectural awareness
- Reduced hallucinations
Recommended for large repositories or multi-user environments.
Includes:
- Dedicated semantic service
- Queue-based processing
- Scalable ingestion workers
Lightweight deployment for experimentation or smaller workloads.
Includes:
- Ingestion service
- Lambda backend
- Inline semantic generation (Semantic Service optional)
Component Technology
Parsing Tree-sitter LLM Runtime vLLM Code Model DeepSeekCoder Agent Model Claude Vector Storage OpenSearch Graph Database Amazon Neptune Compute AWS Lambda Processing Worker + Queue Architecture
- Repository submitted for ingestion
- Code parsed and dependencies extracted
- (Optional) Semantic descriptions generated via LLM service
- Embeddings stored in vector index
- Relationships stored in Neptune graph
- Agent retrieves knowledge dynamically during queries
- Hybrid knowledge representation (graph + vector)
- Retrieval-on-demand agent architecture
- Parallel-first ingestion pipeline
- Scalable LLM processing
- Modular deployment flexibility
- Incremental repository indexing
- Graph-aware reasoning prompts
- Multi-language parsing expansion
- Streaming ingestion support
- Agent planning over dependency graphs