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.1.0.tar.gz (8.7 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.1.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rag_context_indexer-1.1.0.tar.gz
  • Upload date:
  • Size: 8.7 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.1.0.tar.gz
Algorithm Hash digest
SHA256 1fdffd5661f34547527264374d9ad9d54c9cf243a01471cdc0654983ca82f0cb
MD5 6af3778e3a0de4bac5d32c26a2701bb2
BLAKE2b-256 b53a725f27de53277a7ff22b60176755620cf710c69fce6868f5b48b9966d67f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rag_context_indexer-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6851f6bab3279cddd380241be6e86ccaca364a41af270dfb51f30430f7c798f4
MD5 92c5f0f8a4373a3e806524d30fb88bff
BLAKE2b-256 511c3130829308a51453ecd58c75764546a6771b6351a2354c51df61e8272149

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