# Context Engineering for AI Agents Starts with Retrieval

DevFeed: [Context Engineering for AI Agents Starts with Retrieval](<https://devfeed.tech/articles/context-engineering-for-ai-agents-starts-with-retrieval-97758.md>)

Original publisher: [Read original article](<https://www.langchain.com/blog/context-engineering-starts-with-retrieval>)

Author: LangChain Accounts

Published: 2026-10-23T17:19:57Z

Content type: article

Language: en

Sources: [LangChain Blog](<https://devfeed.tech/sources/langchain-blog.md>)

Topics: [information retrieval](<https://devfeed.tech/topics/information-retrieval.md>), [Retrieval Augmented Generation (RAG)](<https://devfeed.tech/topics/retrieval-augmented-generation-rag.md>), [Agent Harness](<https://devfeed.tech/topics/agent-harness.md>), [context window](<https://devfeed.tech/topics/context-window.md>), [LangChain](<https://devfeed.tech/topics/langchain.md>), [AI-driven information retrieval](<https://devfeed.tech/topics/ai-driven-information-retrieval.md>), [AI Context Management](<https://devfeed.tech/topics/ai-context-management.md>)

Tags: [agents](<https://devfeed.tech/tags/agents.md>), [context](<https://devfeed.tech/tags/context.md>), [context-engineering](<https://devfeed.tech/tags/context-engineering.md>), [retrieval](<https://devfeed.tech/tags/retrieval.md>)

## AI overview

The excerpt recommends giving agents only the information they need at each step. In LangChain's Deep Agents, `glob` searches filenames, `grep` finds exact text, and `read_file` reads pages in limited chunks; semantic retrieval is useful when wording varies, while SQL, search APIs, or MCP servers can serve other data needs. For oversized results, the harness can save content to files and return a preview and path. A custom retrieval tool can return paths directly, then subagents can read and summarize those files so the main agent receives key facts and sources. Freshness still requires current sources or date filtering, and retrieved text should be treated as untrusted and checked against expected sources. The excerpt presents these as ways to reduce wasted searches and context use, while noting that stale or irrelevant results can still mislead.

## Source excerpt

Agents waste time and context on clumsy searches, oversized results and stale data. Learn the retrieval techniques LangChain's Deep Agents harness uses to get the right context in.