LangChain Academy: agent context engineering starts with retrieval — search small, offload, delegate

LangChain · x · 2026-10-24

LangChain Academy published a tutorial on how agents retrieve the right info at the right time within a limited context window.

Three failure modes: inefficient searching (clumsy queries burn tokens before finding anything), too much context at once (one search dumping full data exports), and irrelevant or stale context.

Deep Agents' defaults: built-in filesystem tools search before they read — glob matches filenames, grep finds lines, readfile goes page by page. Oversized tool results are offloaded to files, with the agent getting just a path and preview.

For custom search tools (e.g. RAG): the "retrieve, offload, delegate" pattern — save results to files, return paths, and let subagents read them so the main agent only sees what's relevant.

Original post →

More from coding & agent

coding & agent channel →