Skip to content

Conversation

sydney-runkle
Copy link
Collaborator

@sydney-runkle sydney-runkle commented Oct 14, 2025

Branching off #33405 to get deepagents middleware onto main

For SubAgentMiddleware, changes from the initial PR:

  • Removing is_async flag in favor of tool implementation via StructuredTool that supports both
  • Adding default_middleware as a configurable param (create_deep_agent can add its own), just like we do for model and tools.
  • Add flag for enabling / disabling the general purpose agent.
  • Making task tool description configurable
  • Full system prompt is now configurable

Questions:

  • Why not a different tool for each task? Could also allow more granular configuration of "handoff" messages.
  • Any reason for the omission of other operations like remove / rename / move?
  • We should make the default tools configurable
  • Should we have any notion of directory access limits?

nfcampos and others added 18 commits October 9, 2025 12:58
…memory, and file

search

Middleware Classes

Text Editor Tools
- StateClaudeTextEditorToolMiddleware: In-memory text editor using agent state
- FilesystemClaudeTextEditorToolMiddleware: Text editor operating on real filesystem

Implementing Claude's text editor tools
https://docs.claude.com/en/docs/agents-and-tools/tool-use/text-editor-tool Operations:
view, create, str_replace, insert

Memory Tools
- StateClaudeMemoryToolMiddleware: Memory persistence in agent state
- FilesystemClaudeMemoryToolMiddleware: Memory persistence on filesystem

Implementing Claude's memory tools
https://docs.claude.com/en/docs/agents-and-tools/tool-use/memory-tool Operations: Same
as text editor plus delete and rename

File Search Tools
- StateFileSearchMiddleware: Search state-based files
- FilesystemFileSearchMiddleware: Search real filesystem

Provides Glob and Grep tools with same schema as used by Claude Code (but compatible
with any model)
- Glob: Pattern matching (e.g., **/*.py, src/**/*.ts), sorted by modification time
- Grep: Regex content search with output modes (files_with_matches, content, count)

Usage

``` from langchain.agents import create_agent from langchain.agents.middleware import (
StateTextEditorToolMiddleware, StateFileSearchMiddleware, )

agent = create_agent( model=model, tools=[], middleware=[
StateTextEditorToolMiddleware(), StateFileSearchMiddleware(), ], ) ```
@github-actions github-actions bot added langchain Related to the package `langchain` feature dependencies Pull requests that update a dependency file v1 Issue specific to LangChain 1.0 labels Oct 14, 2025
@github-actions github-actions bot added feature and removed feature labels Oct 14, 2025
@github-actions github-actions bot removed the feature label Oct 14, 2025
@github-actions github-actions bot added feature and removed feature labels Oct 14, 2025
@github-actions github-actions bot added feature and removed feature labels Oct 14, 2025
@github-actions github-actions bot added feature and removed feature labels Oct 15, 2025
@github-actions github-actions bot added feature and removed feature labels Oct 15, 2025
@github-actions github-actions bot added feature and removed feature labels Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file feature langchain Related to the package `langchain` v1 Issue specific to LangChain 1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants