Lightweight FastAPI service to ingest a GitHub repo and answer developer questions using RAG.
Quick start
- Create a virtualenv and install:
python -m venv .venv
source .venv/bin/activate # or .\.venv\Scripts\activate on Windows
pip install -r requirements.txt-
Copy
.env.exampleto.envand setGOOGLE_API_KEYorGEMINI_API_KEY.To get a free Gemini API key:
- Sign in at https://aistudio.google.com/app/apikey
- Create a new API key in Google AI Studio
- Copy the key into your
.envfile asGOOGLE_API_KEY=... - If you are using the free-tier Gemini access, keep the key in local development only and avoid committing it to git
- Optional: set
GEMINI_MODEL=gemini-3.6-flashin.envif you want the recommended standard text-generation model
-
Run the app:
uvicorn app.main:app --reload --port 8000Usage
- Ingest a repo:
curl -X POST "http://localhost:8000/ingest" -H "Content-Type: application/json" -d '{"repo_url":"https://github.com/owner/repo"}'- Query the ingested repo:
curl -X POST "http://localhost:8000/query" -H "Content-Type: application/json" -d '{"repo_url":"https://github.com/owner/repo", "question":"Where is the database configuration?"}'Notes & next steps
- FAISS and sentence-transformers may need platform-specific wheels on Windows. If
faiss-cpufails to install, consider using Linux or WSL.
Frontend
- Change into the
frontendfolder and install deps:
cd frontend
npm install
npm run dev- Open
http://localhost:5173and use the simple UI toIngesta repo and ask questions.
Git & GitHub
- Initialize git and push to your GitHub repo (replace URL):
git init
git add .
git commit -m "Initial commit"
git remote add origin git@github.com:youruser/yourrepo.git
git branch -M main
git push -u origin main- Ensure you do not commit secrets like
.env..gitignoreis present to help.