Agent
602 installs
langchain-fundamentals
by langchain-ai/langchain-skills
Create LangChain agents with create_agent, define tools, and use middleware for human-in-the-loop and error handling.
Skill content
<create_agent>
Creating Agents with create_agent
create_agent() is the recommended way to build agents. It handles the agent loop, tool execution, and state management.
Agent Configuration Options
Parameter
Purpose
Example
model
LLM to use
"anthropic:claude-sonnet-4-5" or model instance
tools
List of tools
[search, calculator]
system_prompt / systemPrompt
Agent instructions
"You are a helpful assistant"
checkpointer
State persistence
MemorySaver()
middleware
Processing hooks
[HumanInTheLoopMiddleware] (Python) / [humanInTheLoopMiddleware({...})] (TypeScript)
</create_agent>