A production-ready, full-stack RAG assistant that ingests, searches, and reasons over any GitHub repository on demand.
Paste any public GitHub URL directly into the sidebar, hit "Trigger Ingestion", and watch the live pipeline logs stream in real-time as the backend clones, chunks, embeds, and indexes the codebase into Pinecone.
Ask complex architectural questions about any indexed repository. The assistant generates precise, markdown-formatted answers and cites the exact source files it referenced.
| Feature | Description |
|---|---|
| π Dynamic Repository Ingestion | Paste any public GitHub URL in the UI β no .env edits required. The backend handles cloning, chunking, embedding, and indexing. |
| π Multi-Query Retrieval | The LLM generates multiple query variants to cast a wider semantic net, improving recall from the vector store. |
| π Cohere Reranking | Retrieved chunks are reranked by Cohere's cross-encoder for maximum relevance before being sent to the LLM. |
| π Parent-Document Retrieval | Searches on small, semantic child chunks but feeds the full parent document to the LLM β preventing context loss. |
| βοΈ Cloud & GPU Ready | Run the backend on a free Google Colab T4 GPU and expose it via Ngrok. The notebook is included. |
| π Modern Dark UI | Sleek React dashboard with real-time log streaming, markdown rendering, and source citations. |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β React Frontend β
β (Vite + React, dynamic URL input, real-time log polling) β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β HTTP / REST
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββ
β FastAPI Backend (api.py) β
β Async background ingestion β LCEL chain assembly β
ββββββββ¬βββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββ
β β
ββββββββΌβββββββββββ βββββββββββΌβββββββββββββββββ
β ingest.py β β rag_pipeline.py β
β β β β
β β’ git clone/pull β β β’ HuggingFace Embeddings β
β β’ File splitter β β β’ Pinecone VectorStore β
β β’ Commit history β β β’ MultiQueryRetriever β
β β’ Pinecone upsertβ β β’ Cohere Reranker β
β β’ Docstore pkl β β β’ Groq LLM (Llama 3.3) β
ββββββββββββββββββββ βββββββββββββββββββββββββββββ
git clone https://github.com/hamzasaqib80/codebase-rag-assistant.git
cd codebase-rag-assistant
# Copy the example env and fill in your API keys
cp .env.example .envEdit .env with your API keys:
PINECONE_API_KEY=your_pinecone_api_key_here
GROQ_API_KEY=your_groq_api_key_here
COHERE_API_KEY=your_cohere_api_key_here
GITHUB_REPO_URL=https://github.com/any/repo.git # Default repo to pre-indexOption A: Local (CPU)
pip install -r requirements-api.txt
uvicorn api:app --host 0.0.0.0 --port 8000Option B: Google Colab (Free T4 GPU) β Recommended
π‘ Open
RAG_Ingestion_Colab.ipynbin Google Colab, fill in your API keys, and run all cells. The notebook will start the FastAPI server and expose it via Ngrok automatically.
cd frontend
# Install dependencies
npm install
# Create frontend environment file
echo "VITE_API_URL=http://localhost:8000" > .env
# (Replace with your Ngrok URL if using Colab)
# Start the dev server
npm run devOpen http://localhost:5173 in your browser.
- Paste a GitHub URL in the sidebar input field (e.g.
https://github.com/psf/requests.git). - Click "Trigger Ingestion".
- Watch the live pipeline logs as the repository is indexed.
- Once complete, start asking questions in the chat!
| Layer | Technology |
|---|---|
| LLM | Groq β Llama 3.3 70B (ultra-fast inference) |
| Vector DB | Pinecone (serverless) |
| Embeddings | sentence-transformers/all-mpnet-base-v2 (local, no API cost) |
| Reranker | Cohere Rerank v3 |
| Framework | LangChain LCEL |
| Backend | FastAPI + Uvicorn |
| Frontend | React 18, Vite |
| Cloud Hosting | Google Colab + Ngrok |
codebase-rag-assistant/
βββ api.py # FastAPI backend β ingestion & query endpoints
βββ ingest.py # Full ingestion pipeline (clone β chunk β embed β upsert)
βββ rag_pipeline.py # LangChain LCEL chain assembly
βββ retrievers.py # Custom ParentFetchingRetriever implementation
βββ utils.py # Shared logging utilities
βββ query.py # Standalone CLI query script
βββ requirements-api.txt # Backend Python dependencies
βββ RAG_Ingestion_Colab.ipynb # Google Colab notebook for cloud deployment
βββ .env.example # Environment variable template
βββ frontend/ # React + Vite frontend
βββ src/
β βββ App.jsx # Main UI component
βββ package.json
This project is licensed under the MIT License.

