This project is a Retrieval-Augmented Generation (RAG) agent designed to understand and interact with codebases. It ingests external repositories, indexes them using vector embeddings, and allows users to query the codebase using a powerful LLM.
| Stack | Tech |
|---|---|
| Language | |
| Frameworks | |
| AI / ML | |
| Database | |
| Utilities |
RAG/
│
├── add_repo.py # Script to ingest external repositories
├── run_app.bat # Batch script to run the application
├── requirements.txt # Project dependencies
├── .env # Environment variables (API keys)
│
├── intern/ # Core internal logic
│ ├── agent/ # Agent definition
│ │ ├── graph.py # LangGraph workflow definition
│ │ ├── state.py # Agent state definition
│ │ └── tools.py # Custom tools for the agent
│ │
│ ├── app/ # FastAPI application
│ │ └── main.py # API entry point
│ │
│ ├── db/ # Database handling
│ │
│ └── ingest/ # Ingestion logic
│ └── ingest_codebase.py # Logic to ingest code into ChromaDB
│
├── source_code/ # Directory where ingested repos are stored
│ └── ...
│
├── testfiles/ # Files for testing
│
└── venv/ # Virtual environment
Ensure you have Python installed. Create a virtual environment and install dependencies.
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txtCreate a .env file in the root directory and add your Google API key:
GOOGLE_API_KEY=your_api_key_hereTo add a codebase for the agent to understand, use the add_repo.py script. This will copy the repo to source_code/ and ingest it into the vector database.
python add_repo.py /path/to/external/repoYou can start the FastAPI server using the provided batch script or directly with uvicorn.
Using Batch Script:
run_app.batUsing Uvicorn:
cd intern
uvicorn app.main:app --reloadOnce the server is running (default: http://localhost:8000), you can send POST requests to interact with the agent.
Endpoint: POST /
Payload:
{
"question": "Explain the main logic of the ingested codebase."
}