Lightweight semantic code search and distillation utility for AI coding agents. It solves the API knowledge gap via real-time local signature extraction and intent analysis without PyTorch. Optimized for token efficiency, it compresses codebase context into compact semantic summaries stored in a local DuckDB vector similarity index.
Project description
Agent-CodeRAG
Fast. Local. Agent-First. Token-Efficient. Bridge the gap between AI coding agents and your local environment.
Table of Contents
- Why Agent-CodeRAG?
- Quick Start
- Features
- How It Works
- API Discovery
- For AI Agents
- Development
- Contributing
- License
Why Agent-CodeRAG?
AI coding agents often hallucinate when calling library APIs because their training data is static. This leads to a "Fail-Fix-Fail" cycle — broken code, token waste, and frustration.
The Problem: Your agent knows Pydantic v1 (model.dict()), but your environment uses v2 (model.model_dump()). Result: 5000+ wasted tokens trying to "fix" something it doesn't understand.
The Solution: Agent-CodeRAG extracts actual API signatures from your installed libraries and provides the LLM with real-time, environment-specific context — saving up to 80% of context window tokens.
Quick Start
# 1. Install
pip install agent-coderag
# 2. Setup (download ONNX model)
agent-coderag setup
# 3. Configure LLM (optional, for AI distillation)
agent-coderag config --url "http://localhost:11434" --provider "ollama" --model "qwen2.5-coder:7b"
# 4. Index your project
agent-coderag sync --all
# 5. Search
agent-coderag search "how to handle errors"
Docker:
docker build -t agent-coderag .
docker run -v ~/.cache/agent-coderag:/root/.cache/agent-coderag agent-coderag setup
✨ Features
- ⚡ No PyTorch — Uses
onnxruntimeandtokenizers(Rust) for instant startup - 💾 DuckDB VSS — High-performance vector search in a single local file
- 🏗️ Multi-Language — Native indexing for Python (AST) and Java (javalang)
- 🔄 Delta-Sync — SHA-256 hashing re-distills only changed code
- 🔌 Hybrid Intelligence — Works offline; adds AI-distilled reasoning when LLM is connected
- 📡 API Discovery — Extract live API signatures from Python modules or Java JARs
🛠 How It Works
graph TD
A[Local Python Code] --> B[AST Parser]
B --> C{Delta-Sync}
C -- Changed/New --> D[LLM Distiller]
C -- Unchanged --> E[Local Cache]
D --> F[Semantic Summary]
E --> F
F --> G[ONNX Embedder]
G --> H[(DuckDB VSS)]
H --> I[Semantic Search / JSON API]
- AST Parser — Parses your Python code
- Delta-Sync — Uses SHA-256 to detect changes
- LLM Distiller — Generates semantic summaries (optional)
- ONNX Embedder — Creates embeddings locally
- DuckDB VSS — Stores vectors for fast similarity search
📡 API Discovery
agent-coderag api pydantic
Returns the live public API, methods, and signatures for any installed library.
🤖 For AI Agents
Agent-CodeRAG is built for programmatic consumption:
- Search First:
agent-coderag --json search "topic" --limit 1 - Use Intent: The
summaryfield provides technical intent — skip reading unnecessary files
🔧 Development
# Run tests
pytest tests/
pytest e2e_tests/
# Setup pre-commit hooks
pip install pre-commit
pre-commit install
🤝 Contributing
Contributions are welcome! Here's how to get started:
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/agent-coderag.git - Create a branch:
git checkout -b feature/your-feature - Make changes and commit with Conventional Commits
- Run tests:
pytest tests/ - Push to your fork and create a Pull Request
See CONTRIBUTING.md for detailed guidelines.
📄 License
MIT © 2026 Igor Boloban
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 agent_coderag-1.2.1.tar.gz.
File metadata
- Download URL: agent_coderag-1.2.1.tar.gz
- Upload date:
- Size: 24.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8b042908dfba28965dfce9064596143aa95d8316f9ca96c3d187a46a7969226
|
|
| MD5 |
3bb9e03cf9afa7a570515e5bd454183a
|
|
| BLAKE2b-256 |
f3e379dcb715b08c84e0aa325ef051ac935fb63b291daf947904747bb17d95b7
|
Provenance
The following attestation bundles were made for agent_coderag-1.2.1.tar.gz:
Publisher:
release.yml on naranor/agent-coderag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_coderag-1.2.1.tar.gz -
Subject digest:
c8b042908dfba28965dfce9064596143aa95d8316f9ca96c3d187a46a7969226 - Sigstore transparency entry: 1478941454
- Sigstore integration time:
-
Permalink:
naranor/agent-coderag@0c1708e7eee48b87036d81deb1091d7222fb4f66 -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/naranor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0c1708e7eee48b87036d81deb1091d7222fb4f66 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agent_coderag-1.2.1-py3-none-any.whl.
File metadata
- Download URL: agent_coderag-1.2.1-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b9a86c2ac85ed4da74fabc27f220cd941bb08013f56ed9915ae530ec571eee5
|
|
| MD5 |
0efc18149ff6dcdee9a40dc4670789d8
|
|
| BLAKE2b-256 |
4fdb81decc6c4777191fa69869f974a54f0070c588791acd2ab45fef990905af
|
Provenance
The following attestation bundles were made for agent_coderag-1.2.1-py3-none-any.whl:
Publisher:
release.yml on naranor/agent-coderag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_coderag-1.2.1-py3-none-any.whl -
Subject digest:
4b9a86c2ac85ed4da74fabc27f220cd941bb08013f56ed9915ae530ec571eee5 - Sigstore transparency entry: 1478941617
- Sigstore integration time:
-
Permalink:
naranor/agent-coderag@0c1708e7eee48b87036d81deb1091d7222fb4f66 -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/naranor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0c1708e7eee48b87036d81deb1091d7222fb4f66 -
Trigger Event:
push
-
Statement type: