Skip to main content

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 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.8.2.tar.gz (16.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.8.2-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rag_context_indexer-1.8.2.tar.gz
  • Upload date:
  • Size: 16.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.8.2.tar.gz
Algorithm Hash digest
SHA256 4b49d6af81c2ccb2175764ffd2316185e8798d65382ad1cfee073e139310b873
MD5 1fecac87e37604263908b6d1fcac5508
BLAKE2b-256 53bfe22e795b05dc2fe9b8bbb8ca0056272fbb91acd6bb0108857c009cd0a271

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rag_context_indexer-1.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6dda817cb5ccbd911dc95726d3ca6655174a3aa43285b0c53d469a8ec1de95cc
MD5 d2339d7657d324f7d7c7d419553b8112
BLAKE2b-256 1e8d47457a5ecb99210c718f9da189ac349bbf8abc6c4adb85e2813d47790086

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