A RAG assistant to allow you to chat with any GitHub repo. Learn fast. The default repo is AdalFlow github repo.
- Chat with GitHub Repos: Ask questions about any repository's codebase
- RAG-powered Retrieval: Uses FAISS for semantic search over code
- Conversation Memory: Maintains context across dialog turns
- Dual Interface: Streamlit app for quick demos, React frontend for production
.
├── app/ # Core RAG components
│ ├── rag.py # Main RAG pipeline with Memory component
│ ├── data_pipeline.py # DatabaseManager for repo indexing
│ ├── gemini_embedder.py # Gemini embedding model client
│ ├── groq_client.py # Groq LLM client
│ ├── config.py # Model configuration
│ └── system_prompt.py # System prompts and RAG templates
│
├── backend/ # FastAPI server
│ ├── main.py # API endpoints (/query, /health)
│ ├── dto.py # Request/Response data models
│ └── utils.py # Utility functions
│
├── frontend/ # React frontend application
│ └── src/
│ ├── App.tsx # Main React app
│ └── components/ # UI components
│
├── streamlit_app.py # Streamlit chat interface
├── pyproject.toml # Python dependencies (uv/pip)
└── .env # Environment variables (API keys)
- Python >= 3.12
- Node.js (for frontend)
- API Keys:
GEMINI_API_KEY,GROQ_API_KEY
- Install dependencies using uv:
uv syncOr using pip:
pip install -e .- Set up environment variables:
Create a .env file in the project root:
GEMINI_API_KEY=your-gemini-api-key
GROQ_API_KEY=your-groq-api-keyRun the Streamlit app for quick demos:
uv run streamlit run streamlit_app.pyRun the API server:
uv run backend/main.pyThe API will be available at http://localhost:8000
- API docs: http://localhost:8000/docs
- Health check: http://localhost:8000/health
- Navigate to the frontend directory:
cd frontend- Install Node.js dependencies:
pnpm install- Start the development server:
pnpm run devThe frontend will be available at http://localhost:5173 (Vite default)
Returns API information and available endpoints.
Health check endpoint - returns status and timestamp.
Analyzes a GitHub repository based on a query.
// Request
{
"repo_url": "https://github.com/username/repo",
"query": "What does this repository do?"
}
// Response
{
"rationale": "Analysis rationale...",
"answer": "Detailed answer...",
"contexts": [
{
"text": "Code snippet...",
"meta_data": {
"file_path": "src/main.py",
"type": "python",
"is_code": true
}
}
]
}┌─────────────────┐ ┌─────────────────┐
│ React Frontend │────▶│ FastAPI Backend │
└─────────────────┘ └────────┬────────┘
│
┌─────────────────┐ ▼
│ Streamlit App │────▶┌─────────────────┐
└─────────────────┘ │ RAG Engine │
│ (app/rag.py) │
└────────┬────────┘
│
┌──────────────────────┼──────────────────────┐
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ DatabaseManager │ │ FAISS Retriever │ │ LLM Generator │
│ (data_pipeline) │ │ (Semantic) │ │ (Gemini/Groq) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Clearly structured RAG that can prepare a repo, persist from reloading, and answer questions.
DatabaseManagerinapp/data_pipeline.pyto manage the database.RAGclass inapp/rag.pyto manage the whole RAG lifecycle.
- Conditional retrieval - skip retrieval for follow-up clarifications
- Create an evaluation dataset
- Evaluate the RAG performance on the dataset
- Auto-optimize the RAG model
- Support display of full conversation history
- Support management of multiple conversations