Skip to main content

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.

Metadata

Release files for code-rag-agent 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for code-rag-agent 0.1.0
File Size Uploaded
code_rag_agent-0.1.0.tar.gz 17.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for code-rag-agent 0.1.0
File Interpreter ABI Platform
code_rag_agent-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.9 kB

Release files / code_rag_agent-0.1.0.tar.gz

Download URL code_rag_agent-0.1.0.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
68fe6d77788b46c74c93e9242f65db67fb345a177f6ac05be3ab7c12d765650b
BLAKE2b-256 checksum
How to use checksums
d0afefe5d3cf60c1002c22c8714a2515a7cdf655d16ee83dfff31744228bcf6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / code_rag_agent-0.1.0-py3-none-any.whl

Download URL code_rag_agent-0.1.0-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b100f8bb4edb388f7a20cb44d3d838793ce0cbb8226a2eddfbd5caf62d50088
BLAKE2b-256 checksum
How to use checksums
b64ee2b8d6d242e785c914b900221a7f1bfbcb4e62bd5a7f4d01683dafac57a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page