/
© 2026 RiffOn. All rights reserved.
  1. Latent Space: The AI Engineer Podcast
  2. Context Engineering for Agents - Lance Martin, LangChain
Context Engineering for Agents - Lance Martin, LangChain

Context Engineering for Agents - Lance Martin, LangChain

Latent Space: The AI Engineer Podcast · Sep 11, 2025

LangChain's Lance Martin unpacks Context Engineering for agents, covering retrieval, multi-agent systems, and the Bitter Lesson in AI development.

The "Bitter Lesson" for AI Apps: Continuously Remove Hardcoded Structure to Leverage Model Improvements

Overly structured, workflow-based systems that work with today's models will become bottlenecks tomorrow. Engineers must be prepared to shed abstractions and rebuild simpler, more general systems to capture the gains from exponentially improving models.

Context Engineering for Agents - Lance Martin, LangChain thumbnail

Context Engineering for Agents - Lance Martin, LangChain

Latent Space: The AI Engineer Podcast·5 months ago

LangChain's Lance Martin Defines Context Engineering as Prompt Engineering Plus Tool-Sourced Inputs

While prompt engineering focuses on crafting the human message, context engineering is a broader discipline that also manages the flow of information from a potentially large number of tool calls, a key challenge in building effective agents.

Context Engineering for Agents - Lance Martin, LangChain thumbnail

Context Engineering for Agents - Lance Martin, LangChain

Latent Space: The AI Engineer Podcast·5 months ago

Offload Raw Tool Call Data to a File System to Drastically Cut Agent Token Costs

Don't pass the full, token-heavy output of every tool call back into an agent's message history. Instead, save the raw data to an external system (like a file system or agent state) and only provide the agent with a summary or pointer.

Context Engineering for Agents - Lance Martin, LangChain thumbnail

Context Engineering for Agents - Lance Martin, LangChain

Latent Space: The AI Engineer Podcast·5 months ago

Multi-Agent Systems Excel at Parallel "Read" Tasks, but Fail at Coordinated "Write" Tasks

Multi-agent systems work well for easily parallelizable, "read-only" tasks like research, where sub-agents gather context independently. They are much trickier for "write" tasks like coding, where conflicting decisions between agents create integration problems.

Context Engineering for Agents - Lance Martin, LangChain thumbnail

Context Engineering for Agents - Lance Martin, LangChain

Latent Space: The AI Engineer Podcast·5 months ago

Naive Agent Loops Rack Up Huge Costs and Hit Context Limits from Excessive Tool Call Data

The simple "tool calling in a loop" model for agents is deceptive. Without managing context, token-heavy tool calls quickly accumulate, leading to high costs ($1-2 per run), hitting context limits, and performance degradation known as "context rot."

Context Engineering for Agents - Lance Martin, LangChain thumbnail

Context Engineering for Agents - Lance Martin, LangChain

Latent Space: The AI Engineer Podcast·5 months ago

Use Low-Level Orchestration Frameworks, Not Opaque High-Level Agent Abstractions

Criticism against AI frameworks is nuanced. High-level abstractions like `import agent` can hide complexity and make systems hard to adapt. However, low-level orchestration frameworks providing building blocks like nodes and edges are valuable for their utility (e.g., checkpointing) without sacrificing transparency.

Context Engineering for Agents - Lance Martin, LangChain thumbnail

Context Engineering for Agents - Lance Martin, LangChain

Latent Space: The AI Engineer Podcast·5 months ago

Pruning Agent Mistakes is Debated: Keep Errors to Enable Self-Correction, Despite "Context Poisoning" Risk

There's a tension in agent design: should you prune failures from the message history? Pruning prevents a "poisoned" context where hallucinations persist, but keeping failures allows the agent to see the error and correct its approach. For tool call errors, the speaker prefers keeping them in.

Context Engineering for Agents - Lance Martin, LangChain thumbnail

Context Engineering for Agents - Lance Martin, LangChain

Latent Space: The AI Engineer Podcast·5 months ago

Agentic Search Often Beats Complex Vector DBs for Code Retrieval

While complex RAG pipelines with vector stores are popular, leading code agents like Anthropic's Claude Code demonstrate that simple "agentic retrieval" using basic file tools can be superior. Providing an agent a manifest file (like `lm.txt`) and a tool to fetch files can outperform pre-indexed semantic search.

Context Engineering for Agents - Lance Martin, LangChain thumbnail

Context Engineering for Agents - Lance Martin, LangChain

Latent Space: The AI Engineer Podcast·5 months ago