Metadata-Version: 2.4
Name: code-rag-agent
Version: 0.1.0
Summary: Production-ready RAG agent for intelligent code retrieval and question answering
Author-email: Sandeep G <sandeepg2890@gmail.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/sandeepgovi/code-rag-agent
Project-URL: Repository, https://github.com/sandeepgovi/code-rag-agent
Project-URL: Bug Tracker, https://github.com/sandeepgovi/code-rag-agent/issues
Keywords: rag,code-analysis,langchain,vector-store,ai,llm,retrieval
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pydantic_settings>=2.11.0
Requires-Dist: langchain>=0.1.0
Requires-Dist: langchain-community>=0.0.1
Requires-Dist: langchain-openai>=0.0.5
Requires-Dist: langchain-pinecone>=0.0.3
Requires-Dist: langchain-huggingface>=0.0.1
Requires-Dist: lark>=1.0.0
Requires-Dist: pinecone-client>=3.0.0
Requires-Dist: sentence-transformers>=2.0.0
Requires-Dist: einops>=0.6.0
Requires-Dist: click>=8.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Dynamic: license-file

# 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)

```bash
pip install code-rag-agent
```

#### From Source

```bash
# 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

```bash
# 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

```bash
# 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

```bash
$ 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

```bash
# 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.
