Understand any codebase faster. An AI-powered developer platform that analyzes GitHub repositories, extracts code intelligence, builds dependency relationships, and provides context-aware explanations and answers using RAG, AST analysis, and LLM-based reasoning.
Overview โข Features โข Architecture โข Tech Stack โข Getting Started โข API โข Roadmap
Understanding an unfamiliar software repository can require hours of manually reading files, tracing imports, following function calls, and searching for documentation.
The AI Codebase Knowledge Platform is designed to reduce that effort.
A developer provides a public GitHub repository URL, and the platform:
GitHub Repository
โ
โผ
Repository Cloning
โ
โผ
Codebase Discovery
โ
โผ
Source File Filtering
โ
โผ
AST / Structural Analysis
โ
โโโโโโโโโโโโโโโโบ File Intelligence
โ
โโโโโโโโโโโโโโโโบ Function Intelligence
โ
โโโโโโโโโโโโโโโโบ Dependency / Call Graph
โ
โผ
Knowledge Retrieval
โ
โผ
LLM Reasoning
โ
โผ
Context-Aware Developer Answers
The goal is to evolve the platform from a codebase-aware RAG system into an agentic developer assistant capable of autonomously exploring and reasoning about software repositories.
- Clone public GitHub repositories from a URL
- Automatically discover repository structure
- Traverse source directories
- Filter relevant source files
- Extract useful code artifacts
- File-level code analysis
- Function-level explanations
- Class and dependency identification
- AST-based structural analysis
- Code relationship extraction
Analyze relationships between functions and modules to help developers understand:
Module A
โ
โโโ imports โ Module B
โ
โโโ calls โ Function X
โ
โโโ calls โ Function Y
This makes it easier to trace execution paths through unfamiliar code.
Ask natural-language questions such as:
"Where is authentication handled?"
"How does the repository process uploaded files?"
"Which function generates the dependency graph?"
"What happens after a repository is cloned?"
The system retrieves relevant code context before generating an answer.
The next stage introduces agentic workflows capable of:
- Exploring multiple files
- Following dependencies
- Reasoning across modules
- Gathering relevant context
- Performing multi-step codebase investigation
Future integrations include:
- VS Code extension
- AI-powered pull request review
- PR summarization
- CI/CD integration
- IDE-aware code explanations
โโโโโโโโโโโโโโโโโโโโโโโโ
โ Developer โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ Next.js Frontend โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ FastAPI Backend โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ GitHub Repo โ โ AST Analysis โ โ Retrieval โ
โ Cloning โ โ Engine โ โ Layer โ
โโโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโโ โโโโโโโโฌโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ Code Knowledge โ
โ Layer โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ LLM / RAG Layer โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ Context-Aware Answer โ
โโโโโโโโโโโโโโโโโโโโโโโโ
1. GitHub URL
โ
2. Repository Clone
โ
3. Repository Traversal
โ
4. Source File Detection
โ
5. Code Parsing
โ
6. AST Extraction
โ
7. Function / Class Extraction
โ
8. Dependency Analysis
โ
9. Call Graph Construction
โ
10. Knowledge / Retrieval Layer
โ
11. LLM Context Construction
โ
12. AI Explanation / Q&A
This architecture separates deterministic code analysis from probabilistic LLM reasoning, improving the reliability of the overall system.
The platform combines several complementary approaches.
| Component | Purpose |
|---|---|
| AST Analysis | Understand code structure deterministically |
| File Analysis | Identify purpose and important components |
| Function Analysis | Explain signatures, parameters and logic |
| Dependency Analysis | Identify relationships between modules |
| Call Graph | Trace function-to-function relationships |
| Embeddings | Represent code semantically |
| Vector Retrieval | Retrieve relevant code context |
| RAG | Ground LLM responses in repository context |
| LLM | Generate explanations and answers |
| Agentic Workflows | Perform multi-step repository investigation |
- Next.js
- React
- TypeScript
- Tailwind CSS
- Python
- FastAPI
- Uvicorn
- GitPython
- Python AST
- Dependency analysis
- Call graph construction
- Static code inspection
- Large Language Models
- Embeddings
- Vector retrieval
- Retrieval-Augmented Generation
- Agentic workflows
- Render โ Backend
- Vercel-compatible deployment โ Frontend
ai-codebase-platform/
โ
โโโ backend/
โ โโโ models/
โ โโโ services/
โ โ โโโ ast_service.py
โ โ โโโ explain_service.py
โ โ โโโ prompt_builder.py
โ โโโ main.py
โ โโโ requirements.txt
โ
โโโ frontend/
โ โโโ app/
โ โโโ components/
โ โโโ lib/
โ โโโ package.json
โ
โโโ README.md
โโโ LICENSE
Project structure may evolve as additional agentic and developer-tooling components are introduced.
Make sure you have:
- Python 3.10+
- Node.js 18+
- npm
- Git
git clone https://github.com/dheeraj116232/ai-codebase-knowledge-platform.git
cd ai-codebase-knowledge-platformcd backendCreate a virtual environment:
python -m venv venv
venv\Scripts\activatepython3 -m venv venv
source venv/bin/activateInstall dependencies:
pip install -r requirements.txtStart the backend:
uvicorn main:app --reload --port 8000Backend:
http://localhost:8000
Health check:
http://localhost:8000/health
Interactive API documentation:
http://localhost:8000/docs
Open another terminal:
cd frontendInstall dependencies:
npm installStart the development server:
npm run devFrontend:
http://localhost:3000
Open the web application.
Paste a public GitHub repository URL.
Select:
Clone Repository
The backend analyzes the repository.
The platform extracts:
- Repository structure
- Files
- Functions
- Classes
- Dependencies
- Call relationships
Use the AI interface to ask questions about the repository.
Example:
How does authentication work in this project?
The system retrieves relevant code context and generates an explanation.
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/health |
Backend health check |
POST |
/clone |
Clone a GitHub repository |
POST |
/explain/file |
Generate a file explanation |
POST |
/explain/function |
Explain a function |
GET |
/callgraph |
Retrieve call graph information |
Once the backend is running, the complete interactive API documentation is available through:
/docs
FastAPI automatically provides Swagger/OpenAPI documentation.
- FastAPI backend
- Next.js frontend
- GitHub repository cloning
- Repository traversal
- Source-file filtering
- Initial code analysis
- RAG foundation
- AST-based analysis
- File explanations
- Function explanations
- Dependency analysis
- Call graph generation
- Multi-step codebase reasoning
- Autonomous repository exploration
- Cross-file reasoning
- Context-aware investigation agents
- Improved retrieval and reranking
- Repository-level task planning
- VS Code extension
- AI pull-request review
- Automated PR summaries
- CI/CD integration
- IDE-aware code explanations
- Autonomous debugging workflows
The current implementation is primarily designed for development, experimentation, and portfolio demonstration.
Before production deployment, several areas should be hardened:
- Repository URL validation
- SSRF protection
- Repository size limits
- Clone timeouts
- Resource quotas
- Sandboxed code analysis
- Authentication and authorization
- Rate limiting
- Secret/API-key protection
- Malicious repository handling
- Dependency security scanning
These considerations are particularly important because the platform processes externally supplied repositories.
- Repository cloning is currently synchronous.
- Large repositories may require additional processing time.
- Public GitHub repositories are the primary supported input.
- Retrieval quality can vary depending on repository structure.
- Production-grade URL and repository security hardening is still required.
- Advanced reranking and autonomous agent workflows are under development.
Modern software repositories can contain thousands of files and millions of lines of code.
Traditional search answers:
"Where is this code?"
This project aims to answer:
"How does this code work, why does it work this way, and what happens if I change it?"
The long-term objective is to build a developer intelligence layer that sits between the developer and the complexity of large software systems.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Developer โ
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ AI Codebase Understandingโ
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
Understand Explain Navigate
โ โ โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ AI Code Agent โ
โโโโโโโโโโฌโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโ
โผ โผ โผ
Plan Modify Test
โ โ โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโ
โผ
Software Development
The eventual goal is not simply a "chat with your codebase" application.
It is to build an AI system that can understand software, reason across its architecture, navigate dependencies, plan changes, and eventually assist with implementation and validation.
Contributions, suggestions, issues, and feature requests are welcome.
git checkout -b feature/your-feature
git add .
git commit -m "Add: your feature"
git push origin feature/your-featureThen open a Pull Request.
This project is licensed under the MIT License.
See LICENSE for details.
AI Engineer | Generative AI | Agentic AI | Machine Learning | Data Science
๐ NIT Tiruchirappalli
- GitHub: @dheeraj116232
- Project: AI Codebase Knowledge Platform
Built with FastAPI, Next.js, Python, TypeScript, and a genuine curiosity about how software works.
โญ If you find this project interesting, consider starring the repository.