Code RAG Agent
A production-ready Python service for intelligent code retrieval and question answering using RAG (Retrieval-Augmented Generation).
Author: Sandeep G Copyright: © 2025 Sandeep G License: Apache License 2.0
Features
- 🔍 Intelligent Code Search: Self-query retrieval with automatic metadata filtering
- 🧠 Smart Question Answering: Answers complex questions about your codebase
- 🔌 Pluggable Architecture: Swap LLM providers (OpenAI, Claude) and vector stores (Pinecone, Weaviate)
- ⚡ Production-Ready: Cost-efficient, fast, and reliable
Quick Start
Installation
From PyPI (Recommended)
pip install code-rag-agent
From Source
# Clone repository
git clone https://github.com/sandeepgovi/code-rag-agent
cd code-rag-agent
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in editable mode
pip install -e .
Configuration
# Copy environment template
cp .env.example .env
# Edit .env with your API keys
PINECONE_API_KEY=your-pinecone-api-key
PINECONE_INDEX_NAME=your-index-name
PINECONE_NAMESPACE=default
OPENAI_API_KEY=your-openai-api-key
Usage
CLI
# Ask questions about your codebase
code-rag-agent query "What methods are in SongService?"
# Use verbose mode for detailed output
code-rag-agent query "How does payment processing work?" --verbose
# Show configuration
code-rag-agent info
Example Output
$ code-rag-agent query "What GET endpoints exist in MusicController?"
MusicController has 3 GET endpoints: getSongById (/{id}), getAllSongs (/all),
and searchSongs (/search).
⏱️ Response time: 4320ms (4.32s)
Architecture
Built with:
- LangChain: Self-query retrieval and LLM orchestration
- Pinecone: Vector store (pluggable)
- OpenAI: LLM provider (pluggable)
- Pydantic: Configuration management
Development
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src/ tests/
License
Apache License 2.0 - see LICENSE file for details.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
code_rag_agent-0.1.0.tar.gz
(17.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file code_rag_agent-0.1.0.tar.gz.
File metadata
- Download URL: code_rag_agent-0.1.0.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68fe6d77788b46c74c93e9242f65db67fb345a177f6ac05be3ab7c12d765650b
|
|
| MD5 |
e63ca95d15a4a5c85d580af2799cab3a
|
|
| BLAKE2b-256 |
d0afefe5d3cf60c1002c22c8714a2515a7cdf655d16ee83dfff31744228bcf6c
|
File details
Details for the file code_rag_agent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: code_rag_agent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b100f8bb4edb388f7a20cb44d3d838793ce0cbb8226a2eddfbd5caf62d50088
|
|
| MD5 |
fb9714ea6f8eb871148498c85baeec8f
|
|
| BLAKE2b-256 |
b64ee2b8d6d242e785c914b900221a7f1bfbcb4e62bd5a7f4d01683dafac57a9
|