Skip to main content

Indexador de contexto enriquecido para optimización de RAG en LLMs con soporte Agentic Scaffolding

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 requests vía REST
  • Control de costos: variable USE_CODE_MODEL alterna entre tiers de modelos
  • Contexto de ejecución: siempre escanea os.getcwd(), no la ubicación del script

Licencia

MIT

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

rag_context_indexer-1.2.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rag_context_indexer-1.2.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file rag_context_indexer-1.2.0.tar.gz.

File metadata

  • Download URL: rag_context_indexer-1.2.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for rag_context_indexer-1.2.0.tar.gz
Algorithm Hash digest
SHA256 e1c6f7eede01510e9feca320392320d7fb9d08856733a2115a6257f50592c863
MD5 f0a4c5a0a8abaef057f768335f33b1fc
BLAKE2b-256 b13c4cd491357ff2cd9a80fb4a20cd82ce2898659a79dff8a40ad3fc3868c8b0

See more details on using hashes here.

File details

Details for the file rag_context_indexer-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rag_context_indexer-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a69942ed97ece62c95fc1b97e9f8300a965257f8e4e25b620cfc9e76041231c
MD5 714fbbe852bd0265e68b2220f068d161
BLAKE2b-256 cf27fadab169c33128f663dbc41de213508f430e50c467b2f9ed6a7264053611

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page