EP229: 8 Chunking strategies for RAG-based agents
The article outlines eight distinct chunking strategies designed for retrieval-augmented generation (RAG) agent pipelines. These techniques span simple programmatic approaches like fixed-size and recursive splitting, structural methods like document-based and hierarchical chunking, and advanced AI-driven workflows such as semantic similarity thresholds, LLM-based proposition generation, agentic routing, and late chunking. Selecting the appropriate strategy involves balancing computational cost, processing speed, and the contextual fidelity required for specific document types. The section outlines the common architectural workflow underlying neural machine translation systems such as Google Translate. The pipeline begins with a lightweight classifier that quickly detects the source language, followed by subword tokenization via BPE and the addition of a target language token. A Transformer encoder maps these tokens into vector representations, which the decoder uses to calculate next-token probability distributions. Finally, beam search is applied instead of greedy decoding to track multiple translation candidates and select the sequence with the highest overall probability. Long prompts often degrade agent performance, making a modular approach to instructions necessary. Instead of massive prompts, Agent Skills function as reusable playbooks dynamically loaded only when required. During the workflow, an agent runtime provides a lightweight skills index to the LLM, which selects the appropriate skill for the runtime to inject into its active context. This dynamic loading minimizes context size and promotes consistent agent behavior.
Read the original ↗Contents
8 Chunking strategies for RAG-based agents
The article outlines eight distinct chunking strategies designed for retrieval-augmented generation (RAG) agent pipelines. These techniques span simple programmatic approaches like fixed-size and recursive splitting, structural methods like document-based and hierarchical chunking, and advanced AI-driven workflows such as semantic similarity thresholds, LLM-based proposition generation, agentic routing, and late chunking. Selecting the appropriate strategy involves balancing computational cost, processing speed, and the contextual fidelity required for specific document types.
- Fixed-size chunking divides text by a predefined token count with overlap, while recursive chunking successively attempts paragraph, line, word, and character splits.
- Document-based chunking preserves native boundaries such as headings, chapters, or HTML tags.
- Semantic chunking evaluates sentence-level embedding similarity to split text at topic transitions rather than fixed character lengths.
- LLM-based chunking breaks text into standalone proposition lines, yielding high accuracy at high computational cost.
- Agentic chunking uses an AI agent to classify document formats (e.g., contracts, tables) and dynamically select the optimal chunking method.
- Late chunking computes embeddings across the complete document first, applying split boundaries and mean-pooling afterward.
- Hierarchical chunking decomposes documents into layered levels spanning sections, paragraphs, and sentences.
Google Translate: The Ideas Behind Neural Translation
The section outlines the common architectural workflow underlying neural machine translation systems such as Google Translate. The pipeline begins with a lightweight classifier that quickly detects the source language, followed by subword tokenization via BPE and the addition of a target language token. A Transformer encoder maps these tokens into vector representations, which the decoder uses to calculate next-token probability distributions. Finally, beam search is applied instead of greedy decoding to track multiple translation candidates and select the sequence with the highest overall probability.
- A fast classifier identifies the source language in milliseconds before translation begins.
- A BPE tokenizer segments input text into subword units, enabling multilingual support.
- A prepended target token (such as <2es>) directs the model toward the intended output language.
- A Transformer encoder-decoder architecture generates vector representations and predicts conditional next-token probabilities.
- Beam search tracks multiple candidate sequences during decoding to select the highest-probability output.
Agent Skills, Clearly Explained
Long prompts often degrade agent performance, making a modular approach to instructions necessary. Instead of massive prompts, Agent Skills function as reusable playbooks dynamically loaded only when required. During the workflow, an agent runtime provides a lightweight skills index to the LLM, which selects the appropriate skill for the runtime to inject into its active context. This dynamic loading minimizes context size and promotes consistent agent behavior.
- Long prompts hurt agent performance, necessitating modular instruction management.
- Agent Skills are reusable playbooks with clear instructions maintained in a small catalog.
- The agent runtime presents an initial lightweight skills index containing metadata and short descriptions to the LLM.
- The LLM reasons over the query and dynamically selects the specific skill needed for the task.
- The runtime loads the designated skill file (such as SKILL.md) into active context on demand to keep the context window compact and outputs consistent.
PostgreSQL versus MySQL
PostgreSQL and MySQL differ fundamentally in their concurrency and system architectures. PostgreSQL is built using C and employs a process-based model, where the Postmaster manager coordinates individual processes per connection alongside independent background workers and shared memory. Conversely, MySQL adopts a thread-based architecture where a single server handles multiple connections via threads. Furthermore, MySQL utilizes a layered design featuring pluggable storage engines such as InnoDB and MyISAM.
- PostgreSQL is implemented in the C programming language and utilizes a process-based architecture.
- In PostgreSQL, a Postmaster process coordinates dedicated worker processes per connection, sharing a common memory pool.
- PostgreSQL uses independent background workers for maintenance tasks such as logging, writing data, and vacuuming.
- MySQL follows a thread-based concurrency model where one server handles multiple client connections through threads.
- MySQL features a modular, layered design that supports swappable storage engines like InnoDB and MyISAM.