mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 10:17:00 +00:00
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 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(), ], ) ``` --------- Co-authored-by: Nuno Campos <nuno@boringbits.io>
langchain-anthropic
Looking for the JS/TS version? Check out LangChain.js.
Quick Install
pip install langchain-anthropic
🤔 What is this?
This package contains the LangChain integration for Anthropic's generative models.
📖 Documentation
View the documentation for more details.