An AI-powered codebase intelligence platform that transforms GitHub repositories into searchable, interactive knowledge bases using Retrieval-Augmented Generation (RAG), semantic search, and intelligent source code analysis.
Stop searching through files. Start asking questions.
RepoScan is a full-stack AI-powered developer tool designed to simplify the process of understanding unfamiliar and complex codebases.
Instead of manually navigating hundreds of source files, developers can provide a GitHub repository URL and ask questions in natural language.
RepoScan analyzes the repository, extracts meaningful code structures, generates vector embeddings, and retrieves relevant source code to generate context-aware answers with file paths and line number citations.
The platform combines Retrieval-Augmented Generation (RAG), AST-aware code parsing, vector similarity search, and Google Gemini AI to deliver an intelligent code exploration experience.
Understanding an unfamiliar codebase can be challenging and time-consuming.
Developers frequently encounter problems such as:
- Navigating large and complex repositories.
- Understanding undocumented source code.
- Finding specific functions and implementations.
- Identifying authentication and business logic.
- Understanding unfamiliar programming languages.
- Onboarding into existing software projects.
- Receiving inaccurate answers from generic AI tools without repository-specific context.
RepoScan addresses these challenges by making source code searchable through natural language.
Provide a GitHub repository URL to clone, analyze, and index its source code automatically.
Ask natural language questions about indexed repositories and receive context-aware answers powered by Google Gemini AI.
Retrieve relevant code chunks before generating answers, grounding AI responses in actual repository content.
Uses Tree-sitter to analyze source code syntax and extract meaningful functions, classes, methods, and other code structures.
Unlike arbitrary text splitting, syntax-aware chunking preserves meaningful code boundaries.
Find relevant source code based on meaning rather than exact keyword matches.
AI-generated answers include references to source files and relevant line ranges, allowing developers to verify the information.
Supports Server-Sent Events (SSE) to stream AI-generated answers progressively.
Index, browse, query, and manage multiple GitHub repositories through a unified backend.
Explore indexed repository statistics, including processed files, code chunks, and detected programming languages.
Repository ingestion runs as a background task with progress tracking.
Discover semantically similar code chunks using vector similarity search.
A React-based frontend using modern styling, animation, and visualization libraries.
flowchart TD
A[GitHub Repository URL] --> B[Repository Cloning]
B --> C[Source File Discovery]
C --> D[Tree-sitter Parser]
D --> E[AST-Aware Code Chunking]
E --> F[FastEmbed Embedding Model]
F --> G[(ChromaDB Vector Database)]
flowchart TD
A[User Question] --> B[FastAPI Backend]
B --> C[Question Embedding]
C --> D[Semantic Similarity Search]
E[(ChromaDB)] --> D
D --> F[Top-K Relevant Code Chunks]
F --> G[Context and Prompt Construction]
G --> H[Google Gemini AI]
H --> I[Answer with Source Citations]
I --> J[React Frontend]
Retrieval-Augmented Generation allows an AI model to generate answers using relevant external information rather than relying only on its pretrained knowledge.
RepoScan implements RAG in three major stages.
- Clone the GitHub repository.
- Identify supported source code files.
- Parse files using Tree-sitter.
- Extract meaningful code chunks.
- Generate vector embeddings using FastEmbed.
- Store embeddings and metadata in ChromaDB.
- Receive a natural language question.
- Convert the question into an embedding.
- Perform vector similarity search.
- Retrieve the most relevant code chunks.
- Collect source file paths and line ranges.
- Construct a context-aware prompt.
- Provide retrieved code chunks to Gemini AI.
- Generate a repository-specific answer.
- Include source code references.
- Return or stream the response to the user.
| Traditional Code Search | RepoScan |
|---|---|
| Keyword-based searching | Semantic vector search |
| Manual file exploration | Natural language queries |
| Arbitrary text chunking | AST-aware code chunking |
| Generic AI responses | Repository-grounded responses |
| Manual source verification | File and line citations |
| Limited contextual understanding | Retrieved code context |
| Individual file exploration | Repository-wide indexing |
RepoScan focuses on understanding the structure and meaning of source code, rather than simply matching text.
| Technology | Purpose |
|---|---|
| React | Component-based user interface |
| Vite | Development and build tooling |
| JavaScript | Frontend application logic |
| Tailwind CSS | Interface styling |
| Framer Motion | Animations and transitions |
| Three.js | 3D visualization capabilities |
| React Three Fiber | React-based 3D rendering |
| React Router | Application navigation |
| Axios | API communication |
| Lucide React | Interface icons |
| Technology | Purpose |
|---|---|
| Python | Backend programming language |
| FastAPI | REST API development |
| Uvicorn | ASGI application server |
| Pydantic | Data validation and schemas |
| GitPython | Repository cloning |
| Tree-sitter | Syntax-aware code parsing |
| FastEmbed | Vector embedding generation |
| ChromaDB | Vector storage and retrieval |
| Google Gemini AI | AI answer generation |
| SSE-Starlette | Streaming responses |
| Platform | Purpose |
|---|---|
| Vercel | Frontend deployment |
| Render | Backend deployment configuration |
| GitHub | Source code and version control |
RepoScan/
โ
โโโ backend/
โ โโโ api/
โ โ โโโ main.py
โ โ โโโ models.py
โ โ
โ โโโ ingest/
โ โ โโโ clone.py
โ โ โโโ languages.py
โ โ โโโ parse.py
โ โ โโโ embed.py
โ โ
โ โโโ query/
โ โ โโโ retrieve.py
โ โ โโโ answer.py
โ โ
โ โโโ .env.example
โ โโโ requirements.txt
โ
โโโ frontend/
โ โโโ src/
โ โโโ package.json
โ
โโโ codebase-qa-bot-guide.md
โโโ walkthrough.md
โโโ render.yaml
โโโ README.md
- Python
- Node.js
- npm
- Git
- Google Gemini API key
git clone https://github.com/yashpatil322/RepoScan.git
cd RepoScancd backend
python -m venv venvActivate the virtual environment.
Windows:
venv\Scripts\activateLinux / macOS:
source venv/bin/activateInstall the required dependencies.
pip install -r requirements.txtCreate a .env file inside the backend directory
using .env.example as a reference.
GEMINI_API_KEY=your_gemini_api_key_hereConfigure the remaining embedding and database settings according to the provided environment template.
Get a Gemini API key from:
https://aistudio.google.com/apikey
Never commit your private API keys to GitHub.
uvicorn api.main:app --reload --port 8000Backend API:
Interactive Swagger documentation:
Open a separate terminal from the project root.
cd frontend
npm install
npm run devConfigure the frontend API base URL to point to your running backend, if required.
Open the local URL displayed in your terminal.
RepoScan provides 12 documented REST API endpoints across five functional modules.
| Method | Endpoint | Description |
|---|---|---|
| POST | /ingest |
Clone and index repository |
| GET | /ingest/status |
Track ingestion progress |
| Method | Endpoint | Description |
|---|---|---|
| POST | /query |
Generate AI answer |
| POST | /query/stream |
Stream AI answer using SSE |
| Method | Endpoint | Description |
|---|---|---|
| GET | /repos |
List indexed repositories |
| DELETE | /repos/{repo_id} |
Delete indexed repository |
| GET | /repos/{repo_id}/chunks |
Browse indexed code |
| Method | Endpoint | Description |
|---|---|---|
| POST | /search |
Search relevant code chunks |
| GET | /search/similar/{chunk_id} |
Find related code |
| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
System health check |
| GET | /languages |
Supported languages |
| GET | /stats |
Repository and indexing statistics |
For detailed API documentation, refer to:
curl -X POST http://localhost:8000/ingest \
-H "Content-Type: application/json" \
-d '{"repo_url":"https://github.com/tiangolo/fastapi"}'Wait for the repository ingestion task to complete.
curl -X POST http://localhost:8000/query \
-H "Content-Type: application/json" \
-d '{
"question": "How does dependency injection work?",
"repo_id": "tiangolo-fastapi",
"top_k": 5
}'The response includes the generated answer, retrieved sources, file paths, line ranges, and other retrieval metadata.
Once a repository is indexed, you can ask:
- Where is user authentication implemented?
- How does the application connect to the database?
- Explain the architecture of this project.
- Where are the API routes defined?
- How does the payment processing module work?
- Which functions handle error validation?
- How does the application manage user sessions?
- Where is the middleware implemented?
- Explain the role of this particular class.
- How are background tasks scheduled?
Answer quality depends on the retrieved code and the completeness of repository indexing.
The parser is designed to support multiple programming languages, including:
- ๐ Python
- ๐จ JavaScript
- ๐ท TypeScript
- โ Java
- ๐น Go
- ๐ฆ Rust
- โ๏ธ C
- ๐ Ruby
Use the /languages endpoint to view the
complete list available in the running backend.
Understand unfamiliar repositories without manually reading every source file.
Explore the architecture and implementation of open-source software projects.
Generate explanations of functions, classes, and application components.
Locate relevant implementations before modifying existing software.
Learn how real-world software systems implement different programming concepts.
Find related implementations across indexed source files using semantic search.
- Private GitHub repository integration
- GitHub OAuth authentication
- Conversational memory
- Cross-encoder retrieval re-ranking
- Automatic repository synchronization
- GitHub pull request analysis
- AI-assisted code review
- Repository dependency graph visualization
- VS Code extension
- Local LLM integration
- Multi-model AI support
- Automated documentation generation
- Docker-based deployment
- Team workspaces
- API keys should be stored in environment variables.
- Sensitive configuration must not be committed.
- Only index repositories you are authorized to access.
- Retrieved code may be sent to the configured AI provider for answer generation.
- AI-generated answers should be verified against the original source code.
- Repository content should be treated as untrusted input before production deployment.
Yash Patil
Computer Engineering | Artificial Intelligence | Full-Stack Development | Software Engineering
- GitHub: @yashpatil322
- Project: RepoScan
- Live Demo: Launch RepoScan
Contributions, suggestions, and improvements are welcome.
- Fork the repository.
- Create a feature branch.
- Commit your changes.
- Push to your branch.
- Open a pull request.
If you find RepoScan useful or interesting, consider giving the repository a star.