Indexador de contexto enriquecido para optimización de RAG en LLMs con soporte Agentic Scaffolding y Auto-Sync
Project description
RAG Context Indexer
Indexador de contexto enriquecido para optimización de RAG en LLMs. Motor agnóstico que inyecta metadatos semánticos en el código fuente y genera un arbol_de_archivos_comentado.json para que los LLMs entiendan arquitecturas complejas ahorrando millones de tokens.
Instalación
pip install rag-context-indexer
Uso
# En la raíz de tu proyecto:
# 1. Instalar el pre-commit hook (una sola vez)
rag-indexer init
# 2. Ejecutar indexación manual
rag-indexer run
Configuración
Crea un archivo .env en la raíz de tu proyecto:
# LLM activo: openai | anthropic | gemini | deepseek
ACTIVE_LLM=openai
# API Keys (solo la del LLM activo es necesaria)
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GEMINI_API_KEY=AIza...
DEEPSEEK_API_KEY=sk-...
# Opcional: usar modelos de razonamiento pesados
USE_CODE_MODEL=false
Modelos soportados
| LLM | Tier Default | Tier Code |
|---|---|---|
| OpenAI | gpt-4o-mini | gpt-4o |
| Anthropic | claude-3-haiku | claude-3-5-sonnet-latest |
| Gemini | gemini-2.5-flash | gemini-2.5-pro |
| DeepSeek | deepseek-chat | deepseek-coder |
Plantilla JSON inyectada por archivo
{
"archivo": "ruta/relativa/al/archivo.ext",
"lineas": 0,
"tokens_estimados": 0,
"hash_contenido": "sha256_del_codigo_limpio",
"creacion": "YYYY-MM-DD",
"modificacion": "YYYY-MM-DD",
"tags": ["dependencia1", "exportacion_principal"],
"descripcion_corta": "Máx 50 chars.",
"descripcion_larga": "100-500 chars, técnico."
}
Principios de diseño
- Idempotencia: el hash SHA256 del código limpio evita llamadas innecesarias a la API
- Anti vendor lock-in: sin SDKs de terceros, solo
requestsvía REST - Control de costos: variable
USE_CODE_MODELalterna entre tiers de modelos - Contexto de ejecución: siempre escanea
os.getcwd(), no la ubicación del script
Licencia
MIT
Project details
Release history Release notifications | RSS feed
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 rag_context_indexer-1.8.4.tar.gz.
File metadata
- Download URL: rag_context_indexer-1.8.4.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92d3c15398baddcb1398f334a32a61ab2e8a4796b52834d13e39b348eb1d4e23
|
|
| MD5 |
ced4565a6eaa011910456badfcf30470
|
|
| BLAKE2b-256 |
cec7b2b17eaed39c1428cc905524c07ac2124a6c9c0415f1530d65643ebb6065
|
File details
Details for the file rag_context_indexer-1.8.4-py3-none-any.whl.
File metadata
- Download URL: rag_context_indexer-1.8.4-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc9d58da9da092749398a2c215431b7d47f5e6f5a4b47097896c6d7726cb90ac
|
|
| MD5 |
225a50c2a329e760ab0c19819e7abb08
|
|
| BLAKE2b-256 |
47c47d108328552942a9375114cd28e5baf0497529db1afcc4fbce50114ea23f
|