Skip to content

Dominar la ingeniería RAG2 / 10

Chunking — The Decision That Sets Your Ceiling

You can't retrieve what you chunked badly. Chunking is the most under-rated lever in RAG — and the cheapest to get right.

Chunking — The Decision That Sets Your Ceiling

Retrieval can only return the chunks you created. If a chunk splits an idea in half, no embedding model on earth will retrieve it whole. Chunking sets the ceiling on everything downstream.

Three strategies

  • Fixed-size — split every N tokens with overlap. Simple, fast, dumb. Fine for uniform prose, bad for structured docs.
  • Structural — split on the document's own boundaries: headings, sections, list items, code blocks. Respects meaning for free.
  • Semantic — split where the topic shifts (embedding-distance based). Best quality, higher cost.

Start structural; it captures most of the win at near-zero cost.

Size and overlap

Too small and a chunk loses context; too big and retrieval gets noisy and the prompt gets expensive. A pragmatic default: 300–600 tokens with ~15% overlap, then tune against your eval set (article 7).

Metadata is the quiet superpower

Attach metadata to every chunk: source, title, section, date, URL. It powers filtered retrieval (only this product, only docs after this date) and lets the generator cite precisely.

Next: turning these chunks into vectors, and where to store them.

Compartir este artículo

#RAG #VectorDB #AI

LinkedInX / TwitterBlueskyThreadsRedditHacker NewsWhatsAppCorreo

Serie — Dominar la ingeniería RAG

  1. Parte 01Por qué el RAG Ingenuo Falla en ProducciónLa demostración de búsqueda vectorial de 50 líneas que impresiona en un notebook se desmorona en el momento en que usuarios reales hacen preguntas reales. Aquí te mostramos por qué — y el mapa para salir.
  2. Parte 02Chunking — The Decision That Sets Your Ceilingestás aquíYou can't retrieve what you chunked badly. Chunking is the most under-rated lever in RAG — and the cheapest to get right.
  3. Parte 03Embeddings & Vector Stores 101Un embedding convierte significado en geometría. Un vector store hace esa geometría buscable en milisegundos. Acertar en ambos hace que la recuperación sea sencilla.
  4. Parte 04Búsqueda Híbrida — Palabra clave + VectorLa búsqueda vectorial entiende significado pero falla con términos exactos, IDs y palabras raras. La búsqueda por palabra clave los domina y pierde la paráfrasis. Usa ambas.
  5. Parte 05Re-Ranking — The Cheap Quality WinLa recuperación te obtiene 30 fragmentos plausibles. Un re-ranker los lee contra la pregunta actual y eleva los verdaderamente relevantes a la cima.
  6. Parte 06Prompting the Generator — Grounding & CitationsGreat retrieval is wasted if the model ignores it or can't point to its sources. Grounding is a prompt-design discipline, not an afterthought.
  7. Parte 07Evaluación — No puedes mejorar lo que no midesSin un conjunto de evaluación, cada cambio en RAG es una corazonada. Con uno, ajustas chunking, retrieval y prompts con un número que te dice si ayudaste o perjudicaste.
  8. Parte 08Handling Hallucinations & GuardrailsWhen retrieval comes up empty, a helpful model invents. Guardrails turn 'confidently wrong' into 'honestly unsure' — the difference users actually trust.
  9. Parte 09Disciplina de Costo y LatenciaUna consulta RAG toca embeddings, una base de datos vectorial, un re-ranker y un LLM. Cada uno suma milisegundos y centavos. A escala, la disciplina aquí es la diferencia entre un margen y un incendio.
  10. Parte 10La arquitectura de referencia RAG para producciónCada pieza, ensamblada: ingesta, recuperación híbrida, re-ranking, generación fundamentada, guardarraíles, evaluación y caché — el plano que puedes desplegar.

Sigue aprendiendo

Curso

El curso Claude Mastery

12 módulos · 5 idiomas · certificado · prueba de 3 días gratis.

Ver planes →
LinkedInX / TwitterBlueskyThreads