Developer

LangChain's Deep Agents v0.7 Cuts Token Use by 65% With Leaner Prompts

LangChain released Deep Agents v0.7 on July 29, 2026, an open-source agent harness update that cuts base input tokens by 65% on a default-agent turn, from roughly 6,000 to about 2,000 tokens. The release trims the built-in prompt, shortens tool descriptions, and makes the todo list middleware optional. It also adds middleware configurability and filesystem improvements that users have requested for months.

Neura News

Neura News

Neura Market Editorial

August 3, 20266 min read
LangChain's Deep Agents v0.7 Cuts Token Use by 65% With Leaner Prompts

LangChain released Deep Agents v0.7 on July 29, 2026, an open-source agent harness update that cuts base input tokens by 65% on a default-agent turn, from roughly 6,000 to about 2,000 tokens. The release trims the built-in prompt, shortens tool descriptions, and makes the todo list middleware optional. It also adds middleware configurability and filesystem improvements that users have requested for months.

The update reflects a broader shift in how AI companies think about agent prompts. OpenAI, Anthropic, and Google all publish prompting guides that have been rewritten as models improved. Anthropic recently published an updated context engineering guide and reported cutting Claude Code's system prompt by over 80% for models like Opus 5 and Fable 5, with no measurable drop in coding evals. LangChain's new release follows that same logic.

Why the Prompt Got Smaller

Deep Agents is an open-source agent architecture, and the harness assembles the prompt given to the model. Base input tokens come from the built-in prompt, tools, and middleware. In v0.7, LangChain made three changes to shrink that footprint.

First, the team removed the base system prompt entirely in PR #4859. That prompt included general guidelines and tool-usage prose. Second, they trimmed builtin tool descriptions by 43% in PR #5009. Third, they made TodoListMiddleware opt-in in PR #4929.

The removals were backed by evals. The planning prompt and the write_todos tool did not significantly improve performance, so LangChain cut them. The company argues that models have outgrown old prompting guidance. Removing hidden prompting also makes custom prompting more effective, since there is no bloating or conflicting instructions to fight against.

Interfaces beat examples, the team wrote. Good tool schemas teach usage better than few-shot examples. And repeating instructions in both the system prompt and tool description does not offer meaningful reinforcement.

Eval Results Show Token and Cost Gains

LangChain ran a new eval suite with three categories: Autonomous, Conversational, and Long-context. The matrix compared v0.7 against v0.6.12 across four models: gpt-5.6-luna, gemini-3.6-flash, claude-sonnet-4-6, and claude-opus-4-8.

Reward held steady overall, while tokens and cost generally dropped. For gpt-5.6-luna, tokens fell 34%, cost dropped 15%, and reward rose 4%. Luna and Opus showed statistically clear token reductions, and Luna also showed a statistically clear cost reduction.

The exception was claude-sonnet-4-6, which saw a significant cost increase. LangSmith traces showed that increase was largely driven by two challenging autonomous tasks. Reward confidence intervals span zero for every model, meaning there was no statistically significant reward change.

The todo list removal also held up in testing. Evals across three categories and three models showed slightly better rewards and lower cost with todos disabled. Still, TodoListMiddleware earns its keep in long multi-step tasks, with less capable models, and in UI-facing use cases. To re-enable todos, users can set middleware=[TodoListMiddleware()].

Middleware Is Now Configurable

Configurability was the top user ask over the last six months. Users wanted to override FilesystemMiddleware, customize SummarizationMiddleware thresholds, and override the base prompt globally. v0.7 delivers on that.

The release allows overriding built-in middleware by passing a middleware instance with a matching .name, via PR #4251. That change came from direct user feedback. One user put it plainly: "We [used to do] some hacky stuff to remove some of the default middleware. Overriding middleware is a very welcome addition."

SummarizationMiddleware is now customizable. Its default trigger sits at 85% of the context window. An example in the release shows a custom trigger at 50%, using the model anthropic:claude-sonnet-5 and the summarization model fireworks:accounts/fireworks/models/kimi-k3. The example instruction reads: "Summarize the conversation so far, keeping any file paths and decisions verbatim..."

The #1 Newsletter in AI

Stay ahead of the AI curve

The most important updates, news, and content — delivered weekly.

No spam. Unsubscribe anytime.

Customizing summarization helps agents stay ahead of context rot and what LangChain calls the "dumb zone," where models lose focus as context fills up.

Filesystem Tools Get Smarter

The filesystem is the core context management layer for Deep Agents, and real usage from dcode, LangChain's coding agent, informed the optimizations. Several tools changed behavior in v0.7.

The write_file tool now overwrites an existing file instead of erroring, per PR #4109. The paginated read_file tool reports total and remaining lines plus the next offset, per PR #4540. The grep and glob tools return partial results with a truncated flag instead of hanging. Grep has a 1,000-match cap, streams output, and supports optional context lines, via PRs #4063, #4570, and #4706.

A delete tool was added to the default filesystem tool list, and FilesystemMiddleware accepts a tool allowlist to opt out, per PRs #4325 and #4698.

Breaking Changes and Migration Notes

Deep Agents v0.7 includes breaking changes. TodoListMiddleware is no longer on by default, per PR #4929. Support for backend factories, deprecated in v0.5, has been removed, and concrete BackendProtocol instances are now required, per PR #4541. Other file format and backend protocol deprecations from v0.5 were also removed.

The changelog includes migration notes and an "upgrade" prompt for coding agents. Users can install the update with uv pip install -U deepagents from PyPI or npm install deepagents@latest from npm. Feedback can go through GitHub issues, the LangChain forum, or X and LinkedIn.

The v0.7 release fits a pattern across the AI industry. Prompting guides from OpenAI, Anthropic, and Google have all been rewritten as models improved. Anthropic's updated context engineering guide reported cutting Claude Code's system prompt by over 80%, with no measurable drop in coding evals for models like Opus 5 and Fable 5.

LangChain's 65% token reduction on a default-agent turn is in the same spirit. The harness assembles the prompt given to the model, and the company argues that leaner prompts work better with modern models. The eval suite backs that up, with reward holding steady and tokens and cost generally dropping.

The release also addresses a long-standing user complaint. For six months, configurability was the top request. Users wanted to override FilesystemMiddleware, customize SummarizationMiddleware thresholds, and override the base prompt globally. v0.7 delivers all three.

The filesystem changes came from real usage. dcode, LangChain's coding agent, informed the optimizations. The write_file overwrite behavior, paginated read_file reporting, and partial grep and glob results all make the tools more practical for long-running agents.

The todo list removal is the most visible change. Evals showed slightly better rewards and lower cost with todos disabled, but the feature remains useful for long multi-step tasks, less capable models, and UI-facing use cases. Users who want it back can re-enable it with one line of code.

The release is available now on PyPI and npm. The changelog includes migration notes and an upgrade prompt for coding agents. Feedback channels include GitHub issues, the forum, and social media.

Related on Neura Market

More from Neura News

AI Tools

The Agent Engineer: A New Role Emerges From the Production Bottleneck

Enterprises are moving beyond single-shot AI features to multi-step, production-grade agentic systems, creating demand for a new role: the Agent Engineer. This role focuses on designing, building, and maintaining autonomous AI systems that reason, plan, and act with minimal human intervention. Hiring data shows it as the fastest-growing role of 2026, with companies like General Motors posting explicit job titles, though some argue it's a set of responsibilities rather than a standalone title.

Aug 6·12 min read
AI Models

Mistral's Shieldstral Packs Big-Model Safety Into a 3-Billion-Parameter Package

Mistral has released Shieldstral, a 3-billion-parameter open-weight safety classifier that matches the performance of much larger models on text safety benchmarks and sets a new high score for joint text and image classification. The model uses a runtime-definable yes/no question format, allowing operators to write custom screening rules in plain language. Shieldstral is designed to be fast and cost-effective, making it practical for real-time content moderation.

Aug 5·5 min read