[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-langchain-langchain-fundamentals":3,"mdc-3bvesk-key":34,"related-repo-langchain-langchain-fundamentals":5803,"related-org-langchain-langchain-fundamentals":5907},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":24,"repoUrl":25,"updatedAt":26,"license":27,"forks":28,"topics":29,"repo":30,"sourceUrl":32,"mdContent":33},"langchain-fundamentals","build LangChain agents and tools","Create LangChain agents with create_agent, define tools, and use middleware for human-in-the-loop and error handling.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"langchain","LangChain","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Flangchain.png","langchain-ai",[13,17,18,21],{"name":14,"slug":15,"type":16},"LLM","llm","tag",{"name":9,"slug":8,"type":16},{"name":19,"slug":20,"type":16},"Agents","agents",{"name":22,"slug":23,"type":16},"API Development","api-development",877,"https:\u002F\u002Fgithub.com\u002Flangchain-ai\u002Flangchain-skills","2026-04-06T18:26:29.746246",null,77,[],{"repoUrl":25,"stars":24,"forks":28,"topics":31,"description":27},[],"https:\u002F\u002Fgithub.com\u002Flangchain-ai\u002Flangchain-skills\u002Ftree\u002FHEAD\u002Fconfig\u002Fskills\u002Flangchain-fundamentals","---\nname: langchain-fundamentals\ndescription: Create LangChain agents with create_agent, define tools, and use middleware for human-in-the-loop and error handling.\n---\n\n\u003Coneliner>\nBuild production agents using `create_agent()`, middleware patterns, and the `@tool` decorator \u002F `tool()` function. When creating LangChain agents, you MUST use create_agent(), with middleware for custom flows. All other alternatives are outdated.\n\u003C\u002Foneliner>\n\n\u003Ccreate_agent>\n## Creating Agents with create_agent\n\n`create_agent()` is the recommended way to build agents. It handles the agent loop, tool execution, and state management.\n\n### Agent Configuration Options\n\n| Parameter | Purpose | Example |\n|-----------|---------|---------|\n| `model` | LLM to use | `\"anthropic:claude-sonnet-4-5\"` or model instance |\n| `tools` | List of tools | `[search, calculator]` |\n| `system_prompt` \u002F `systemPrompt` | Agent instructions | `\"You are a helpful assistant\"` |\n| `checkpointer` | State persistence | `MemorySaver()` |\n| `middleware` | Processing hooks | `[HumanInTheLoopMiddleware]` (Python) \u002F `[humanInTheLoopMiddleware({...})]` (TypeScript) |\n\u003C\u002Fcreate_agent>\n\n\u003Cex-basic-agent>\n\u003Cpython>\n\n```python\nfrom langchain.agents import create_agent\nfrom langchain_core.tools import tool\n\n@tool\ndef get_weather(location: str) -> str:\n    \"\"\"Get current weather for a location.\n\n    Args:\n        location: City name\n    \"\"\"\n    return f\"Weather in {location}: Sunny, 72F\"\n\nagent = create_agent(\n    model=\"anthropic:claude-sonnet-4-5\",\n    tools=[get_weather],\n    system_prompt=\"You are a helpful assistant.\"\n)\n\nresult = agent.invoke({\n    \"messages\": [{\"role\": \"user\", \"content\": \"What's the weather in Paris?\"}]\n})\nprint(result[\"messages\"][-1].content)\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\n\n```typescript\nimport { createAgent } from \"langchain\";\nimport { tool } from \"@langchain\u002Fcore\u002Ftools\";\nimport { z } from \"zod\";\n\nconst getWeather = tool(\n  async ({ location }) => `Weather in ${location}: Sunny, 72F`,\n  {\n    name: \"get_weather\",\n    description: \"Get current weather for a location.\",\n    schema: z.object({ location: z.string().describe(\"City name\") }),\n  }\n);\n\nconst agent = createAgent({\n  model: \"anthropic:claude-sonnet-4-5\",\n  tools: [getWeather],\n  systemPrompt: \"You are a helpful assistant.\",\n});\n\nconst result = await agent.invoke({\n  messages: [{ role: \"user\", content: \"What's the weather in Paris?\" }],\n});\nconsole.log(result.messages[result.messages.length - 1].content);\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-basic-agent>\n\n\u003Cex-agent-with-persistence>\n\u003Cpython>\nAdd MemorySaver checkpointer to maintain conversation state across invocations.\n\n```python\nfrom langchain.agents import create_agent\nfrom langgraph.checkpoint.memory import MemorySaver\n\ncheckpointer = MemorySaver()\n\nagent = create_agent(\n    model=\"anthropic:claude-sonnet-4-5\",\n    tools=[search],\n    checkpointer=checkpointer,\n)\n\nconfig = {\"configurable\": {\"thread_id\": \"user-123\"}}\nagent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"My name is Alice\"}]}, config=config)\nresult = agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"What's my name?\"}]}, config=config)\n# Agent remembers: \"Your name is Alice\"\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nAdd MemorySaver checkpointer to maintain conversation state across invocations.\n\n```typescript\nimport { createAgent } from \"langchain\";\nimport { MemorySaver } from \"@langchain\u002Flanggraph\";\n\nconst checkpointer = new MemorySaver();\n\nconst agent = createAgent({\n  model: \"anthropic:claude-sonnet-4-5\",\n  tools: [search],\n  checkpointer,\n});\n\nconst config = { configurable: { thread_id: \"user-123\" } };\nawait agent.invoke({ messages: [{ role: \"user\", content: \"My name is Alice\" }] }, config);\nconst result = await agent.invoke({ messages: [{ role: \"user\", content: \"What's my name?\" }] }, config);\n\u002F\u002F Agent remembers: \"Your name is Alice\"\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-agent-with-persistence>\n\n\u003Ctools>\n## Defining Tools\n\nTools are functions that agents can call. Use the `@tool` decorator (Python) or `tool()` function (TypeScript).\n\u003C\u002Ftools>\n\n\u003Cex-basic-tool>\n\u003Cpython>\n\n```python\nfrom langchain_core.tools import tool\n\n@tool\ndef add(a: float, b: float) -> float:\n    \"\"\"Add two numbers.\n\n    Args:\n        a: First number\n        b: Second number\n    \"\"\"\n    return a + b\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\n\n```typescript\nimport { tool } from \"@langchain\u002Fcore\u002Ftools\";\nimport { z } from \"zod\";\n\nconst add = tool(\n  async ({ a, b }) => a + b,\n  {\n    name: \"add\",\n    description: \"Add two numbers.\",\n    schema: z.object({\n      a: z.number().describe(\"First number\"),\n      b: z.number().describe(\"Second number\"),\n    }),\n  }\n);\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fex-basic-tool>\n\n\u003Cmiddleware>\n## Middleware for Agent Control\n\nMiddleware intercepts the agent loop to add human approval, error handling, logging, and more. A deep understanding of middleware is essential for production agents — use `HumanInTheLoopMiddleware` (Python) \u002F `humanInTheLoopMiddleware` (TypeScript) for approval workflows, and `@wrap_tool_call` (Python) \u002F `createMiddleware` (TypeScript) for custom hooks.\n\nKey imports:\n\n```python\nfrom langchain.agents.middleware import HumanInTheLoopMiddleware, wrap_tool_call\n```\n\n```typescript\nimport { humanInTheLoopMiddleware, createMiddleware } from \"langchain\";\n```\n\nKey patterns:\n- **HITL**: `middleware=[HumanInTheLoopMiddleware(interrupt_on={\"dangerous_tool\": True})]` — requires `checkpointer` + `thread_id`\n- **Resume after interrupt**: `agent.invoke(Command(resume={\"decisions\": [{\"type\": \"approve\"}]}), config=config)`\n- **Custom middleware**: `@wrap_tool_call` decorator (Python) or `createMiddleware({ wrapToolCall: ... })` (TypeScript)\n\u003C\u002Fmiddleware>\n\n\u003Cstructured_output>\n## Structured Output\n\nGet typed, validated responses from agents using `response_format` or `with_structured_output()`.\n\n\u003Cpython>\n\n```python\nfrom langchain.agents import create_agent\nfrom pydantic import BaseModel, Field\n\nclass ContactInfo(BaseModel):\n    name: str\n    email: str\n    phone: str = Field(description=\"Phone number with area code\")\n\n# Option 1: Agent with structured output\nagent = create_agent(model=\"gpt-4.1\", tools=[search], response_format=ContactInfo)\nresult = agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"Find contact for John\"}]})\nprint(result[\"structured_response\"])  # ContactInfo(name='John', ...)\n\n# Option 2: Model-level structured output (no agent needed)\nfrom langchain_openai import ChatOpenAI\nmodel = ChatOpenAI(model=\"gpt-4.1\")\nstructured_model = model.with_structured_output(ContactInfo)\nresponse = structured_model.invoke(\"Extract: John, john@example.com, 555-1234\")\n# ContactInfo(name='John', email='john@example.com', phone='555-1234')\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\n\n```typescript\nimport { ChatOpenAI } from \"@langchain\u002Fopenai\";\nimport { z } from \"zod\";\n\nconst ContactInfo = z.object({\n  name: z.string(),\n  email: z.string().email(),\n  phone: z.string().describe(\"Phone number with area code\"),\n});\n\n\u002F\u002F Model-level structured output\nconst model = new ChatOpenAI({ model: \"gpt-4.1\" });\nconst structuredModel = model.withStructuredOutput(ContactInfo);\nconst response = await structuredModel.invoke(\"Extract: John, john@example.com, 555-1234\");\n\u002F\u002F { name: 'John', email: 'john@example.com', phone: '555-1234' }\n```\n\u003C\u002Ftypescript>\n\u003C\u002Fstructured_output>\n\n\u003Cmodel_config>\n## Model Configuration\n\n`create_agent` accepts model strings (`\"anthropic:claude-sonnet-4-5\"`, `\"openai:gpt-4.1\"`) or model instances for custom settings:\n\n```python\nfrom langchain_anthropic import ChatAnthropic\nagent = create_agent(model=ChatAnthropic(model=\"claude-sonnet-4-5\", temperature=0), tools=[...])\n```\n\u003C\u002Fmodel_config>\n\n\n\u003Cfix-missing-tool-description>\n\u003Cpython>\nClear descriptions help the agent know when to use each tool.\n\n```python\n# WRONG: Vague or missing description\n@tool\ndef bad_tool(input: str) -> str:\n    \"\"\"Does stuff.\"\"\"\n    return \"result\"\n\n# CORRECT: Clear, specific description with Args\n@tool\ndef search(query: str) -> str:\n    \"\"\"Search the web for current information about a topic.\n\n    Use this when you need recent data or facts.\n\n    Args:\n        query: The search query (2-10 words recommended)\n    \"\"\"\n    return web_search(query)\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nClear descriptions help the agent know when to use each tool.\n\n```typescript\n\u002F\u002F WRONG: Vague description\nconst badTool = tool(async ({ input }) => \"result\", {\n  name: \"bad_tool\",\n  description: \"Does stuff.\", \u002F\u002F Too vague!\n  schema: z.object({ input: z.string() }),\n});\n\n\u002F\u002F CORRECT: Clear, specific description\nconst search = tool(async ({ query }) => webSearch(query), {\n  name: \"search\",\n  description: \"Search the web for current information about a topic. Use this when you need recent data or facts.\",\n  schema: z.object({\n    query: z.string().describe(\"The search query (2-10 words recommended)\"),\n  }),\n});\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-missing-tool-description>\n\n\u003Cfix-no-checkpointer>\n\u003Cpython>\nAdd checkpointer and thread_id for conversation memory across invocations.\n\n```python\n# WRONG: No persistence - agent forgets between calls\nagent = create_agent(model=\"anthropic:claude-sonnet-4-5\", tools=[search])\nagent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"I'm Bob\"}]})\nagent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"What's my name?\"}]})\n# Agent doesn't remember!\n\n# CORRECT: Add checkpointer and thread_id\nfrom langgraph.checkpoint.memory import MemorySaver\n\nagent = create_agent(\n    model=\"anthropic:claude-sonnet-4-5\",\n    tools=[search],\n    checkpointer=MemorySaver(),\n)\nconfig = {\"configurable\": {\"thread_id\": \"session-1\"}}\nagent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"I'm Bob\"}]}, config=config)\nagent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"What's my name?\"}]}, config=config)\n# Agent remembers: \"Your name is Bob\"\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nAdd checkpointer and thread_id for conversation memory across invocations.\n\n```typescript\n\u002F\u002F WRONG: No persistence\nconst agent = createAgent({ model: \"anthropic:claude-sonnet-4-5\", tools: [search] });\nawait agent.invoke({ messages: [{ role: \"user\", content: \"I'm Bob\" }] });\nawait agent.invoke({ messages: [{ role: \"user\", content: \"What's my name?\" }] });\n\u002F\u002F Agent doesn't remember!\n\n\u002F\u002F CORRECT: Add checkpointer and thread_id\nimport { MemorySaver } from \"@langchain\u002Flanggraph\";\n\nconst agent = createAgent({\n  model: \"anthropic:claude-sonnet-4-5\",\n  tools: [search],\n  checkpointer: new MemorySaver(),\n});\nconst config = { configurable: { thread_id: \"session-1\" } };\nawait agent.invoke({ messages: [{ role: \"user\", content: \"I'm Bob\" }] }, config);\nawait agent.invoke({ messages: [{ role: \"user\", content: \"What's my name?\" }] }, config);\n\u002F\u002F Agent remembers: \"Your name is Bob\"\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-no-checkpointer>\n\n\u003Cfix-infinite-loop>\n\u003Cpython>\nSet recursion_limit in the invoke config to prevent runaway agent loops.\n\n```python\n# WRONG: No iteration limit - could loop forever\nresult = agent.invoke({\"messages\": [(\"user\", \"Do research\")]})\n\n# CORRECT: Set recursion_limit in config\nresult = agent.invoke(\n    {\"messages\": [(\"user\", \"Do research\")]},\n    config={\"recursion_limit\": 10},  # Stop after 10 steps\n)\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nSet recursionLimit in the invoke config to prevent runaway agent loops.\n\n```typescript\n\u002F\u002F WRONG: No iteration limit\nconst result = await agent.invoke({ messages: [[\"user\", \"Do research\"]] });\n\n\u002F\u002F CORRECT: Set recursionLimit in config\nconst result = await agent.invoke(\n  { messages: [[\"user\", \"Do research\"]] },\n  { recursionLimit: 10 }, \u002F\u002F Stop after 10 steps\n);\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-infinite-loop>\n\n\u003Cfix-accessing-result-wrong>\n\u003Cpython>\nAccess the messages array from the result, not result.content directly.\n\n```python\n# WRONG: Trying to access result.content directly\nresult = agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]})\nprint(result.content)  # AttributeError!\n\n# CORRECT: Access messages from result dict\nresult = agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]})\nprint(result[\"messages\"][-1].content)  # Last message content\n```\n\u003C\u002Fpython>\n\u003Ctypescript>\nAccess the messages array from the result, not result.content directly.\n\n```typescript\n\u002F\u002F WRONG: Trying to access result.content directly\nconst result = await agent.invoke({ messages: [{ role: \"user\", content: \"Hello\" }] });\nconsole.log(result.content); \u002F\u002F undefined!\n\n\u002F\u002F CORRECT: Access messages from result object\nconst result = await agent.invoke({ messages: [{ role: \"user\", content: \"Hello\" }] });\nconsole.log(result.messages[result.messages.length - 1].content); \u002F\u002F Last message content\n```\n\u003C\u002Ftypescript>\n\u003C\u002Ffix-accessing-result-wrong>\n",{"data":35,"body":36},{"name":4,"description":6},{"type":37,"children":38},"root",[39,47,53,60,72,79,276,1291,1972,5797],{"type":40,"tag":41,"props":42,"children":43},"element","oneliner",{},[44],{"type":45,"value":46},"text","\nBuild production agents using `create_agent()`, middleware patterns, and the `@tool` decorator \u002F `tool()` function. When creating LangChain agents, you MUST use create_agent(), with middleware for custom flows. All other alternatives are outdated.\n",{"type":40,"tag":48,"props":49,"children":50},"p",{},[51],{"type":45,"value":52},"\u003Ccreate_agent>",{"type":40,"tag":54,"props":55,"children":57},"h2",{"id":56},"creating-agents-with-create_agent",[58],{"type":45,"value":59},"Creating Agents with create_agent",{"type":40,"tag":48,"props":61,"children":62},{},[63,70],{"type":40,"tag":64,"props":65,"children":67},"code",{"className":66},[],[68],{"type":45,"value":69},"create_agent()",{"type":45,"value":71}," is the recommended way to build agents. It handles the agent loop, tool execution, and state management.",{"type":40,"tag":73,"props":74,"children":76},"h3",{"id":75},"agent-configuration-options",[77],{"type":45,"value":78},"Agent Configuration Options",{"type":40,"tag":80,"props":81,"children":82},"table",{},[83,107],{"type":40,"tag":84,"props":85,"children":86},"thead",{},[87],{"type":40,"tag":88,"props":89,"children":90},"tr",{},[91,97,102],{"type":40,"tag":92,"props":93,"children":94},"th",{},[95],{"type":45,"value":96},"Parameter",{"type":40,"tag":92,"props":98,"children":99},{},[100],{"type":45,"value":101},"Purpose",{"type":40,"tag":92,"props":103,"children":104},{},[105],{"type":45,"value":106},"Example",{"type":40,"tag":108,"props":109,"children":110},"tbody",{},[111,140,166,200,226,262],{"type":40,"tag":88,"props":112,"children":113},{},[114,124,129],{"type":40,"tag":115,"props":116,"children":117},"td",{},[118],{"type":40,"tag":64,"props":119,"children":121},{"className":120},[],[122],{"type":45,"value":123},"model",{"type":40,"tag":115,"props":125,"children":126},{},[127],{"type":45,"value":128},"LLM to use",{"type":40,"tag":115,"props":130,"children":131},{},[132,138],{"type":40,"tag":64,"props":133,"children":135},{"className":134},[],[136],{"type":45,"value":137},"\"anthropic:claude-sonnet-4-5\"",{"type":45,"value":139}," or model instance",{"type":40,"tag":88,"props":141,"children":142},{},[143,152,157],{"type":40,"tag":115,"props":144,"children":145},{},[146],{"type":40,"tag":64,"props":147,"children":149},{"className":148},[],[150],{"type":45,"value":151},"tools",{"type":40,"tag":115,"props":153,"children":154},{},[155],{"type":45,"value":156},"List of tools",{"type":40,"tag":115,"props":158,"children":159},{},[160],{"type":40,"tag":64,"props":161,"children":163},{"className":162},[],[164],{"type":45,"value":165},"[search, calculator]",{"type":40,"tag":88,"props":167,"children":168},{},[169,186,191],{"type":40,"tag":115,"props":170,"children":171},{},[172,178,180],{"type":40,"tag":64,"props":173,"children":175},{"className":174},[],[176],{"type":45,"value":177},"system_prompt",{"type":45,"value":179}," \u002F ",{"type":40,"tag":64,"props":181,"children":183},{"className":182},[],[184],{"type":45,"value":185},"systemPrompt",{"type":40,"tag":115,"props":187,"children":188},{},[189],{"type":45,"value":190},"Agent instructions",{"type":40,"tag":115,"props":192,"children":193},{},[194],{"type":40,"tag":64,"props":195,"children":197},{"className":196},[],[198],{"type":45,"value":199},"\"You are a helpful assistant\"",{"type":40,"tag":88,"props":201,"children":202},{},[203,212,217],{"type":40,"tag":115,"props":204,"children":205},{},[206],{"type":40,"tag":64,"props":207,"children":209},{"className":208},[],[210],{"type":45,"value":211},"checkpointer",{"type":40,"tag":115,"props":213,"children":214},{},[215],{"type":45,"value":216},"State persistence",{"type":40,"tag":115,"props":218,"children":219},{},[220],{"type":40,"tag":64,"props":221,"children":223},{"className":222},[],[224],{"type":45,"value":225},"MemorySaver()",{"type":40,"tag":88,"props":227,"children":228},{},[229,238,243],{"type":40,"tag":115,"props":230,"children":231},{},[232],{"type":40,"tag":64,"props":233,"children":235},{"className":234},[],[236],{"type":45,"value":237},"middleware",{"type":40,"tag":115,"props":239,"children":240},{},[241],{"type":45,"value":242},"Processing hooks",{"type":40,"tag":115,"props":244,"children":245},{},[246,252,254,260],{"type":40,"tag":64,"props":247,"children":249},{"className":248},[],[250],{"type":45,"value":251},"[HumanInTheLoopMiddleware]",{"type":45,"value":253}," (Python) \u002F ",{"type":40,"tag":64,"props":255,"children":257},{"className":256},[],[258],{"type":45,"value":259},"[humanInTheLoopMiddleware({...})]",{"type":45,"value":261}," (TypeScript)",{"type":40,"tag":88,"props":263,"children":264},{},[265,270,273],{"type":40,"tag":115,"props":266,"children":267},{},[268],{"type":45,"value":269},"\u003C\u002Fcreate_agent>",{"type":40,"tag":115,"props":271,"children":272},{},[],{"type":40,"tag":115,"props":274,"children":275},{},[],{"type":40,"tag":277,"props":278,"children":279},"ex-basic-agent",{},[280,492],{"type":40,"tag":281,"props":282,"children":283},"python",{},[284],{"type":40,"tag":285,"props":286,"children":290},"pre",{"className":287,"code":288,"language":281,"meta":289,"style":289},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","from langchain.agents import create_agent\nfrom langchain_core.tools import tool\n\n@tool\ndef get_weather(location: str) -> str:\n    \"\"\"Get current weather for a location.\n\n    Args:\n        location: City name\n    \"\"\"\n    return f\"Weather in {location}: Sunny, 72F\"\n\nagent = create_agent(\n    model=\"anthropic:claude-sonnet-4-5\",\n    tools=[get_weather],\n    system_prompt=\"You are a helpful assistant.\"\n)\n\nresult = agent.invoke({\n    \"messages\": [{\"role\": \"user\", \"content\": \"What's the weather in Paris?\"}]\n})\nprint(result[\"messages\"][-1].content)\n","",[291],{"type":40,"tag":64,"props":292,"children":293},{"__ignoreMap":289},[294,305,314,324,333,342,351,359,368,377,386,395,403,412,421,430,439,448,456,465,474,483],{"type":40,"tag":295,"props":296,"children":299},"span",{"class":297,"line":298},"line",1,[300],{"type":40,"tag":295,"props":301,"children":302},{},[303],{"type":45,"value":304},"from langchain.agents import create_agent\n",{"type":40,"tag":295,"props":306,"children":308},{"class":297,"line":307},2,[309],{"type":40,"tag":295,"props":310,"children":311},{},[312],{"type":45,"value":313},"from langchain_core.tools import tool\n",{"type":40,"tag":295,"props":315,"children":317},{"class":297,"line":316},3,[318],{"type":40,"tag":295,"props":319,"children":321},{"emptyLinePlaceholder":320},true,[322],{"type":45,"value":323},"\n",{"type":40,"tag":295,"props":325,"children":327},{"class":297,"line":326},4,[328],{"type":40,"tag":295,"props":329,"children":330},{},[331],{"type":45,"value":332},"@tool\n",{"type":40,"tag":295,"props":334,"children":336},{"class":297,"line":335},5,[337],{"type":40,"tag":295,"props":338,"children":339},{},[340],{"type":45,"value":341},"def get_weather(location: str) -> str:\n",{"type":40,"tag":295,"props":343,"children":345},{"class":297,"line":344},6,[346],{"type":40,"tag":295,"props":347,"children":348},{},[349],{"type":45,"value":350},"    \"\"\"Get current weather for a location.\n",{"type":40,"tag":295,"props":352,"children":354},{"class":297,"line":353},7,[355],{"type":40,"tag":295,"props":356,"children":357},{"emptyLinePlaceholder":320},[358],{"type":45,"value":323},{"type":40,"tag":295,"props":360,"children":362},{"class":297,"line":361},8,[363],{"type":40,"tag":295,"props":364,"children":365},{},[366],{"type":45,"value":367},"    Args:\n",{"type":40,"tag":295,"props":369,"children":371},{"class":297,"line":370},9,[372],{"type":40,"tag":295,"props":373,"children":374},{},[375],{"type":45,"value":376},"        location: City name\n",{"type":40,"tag":295,"props":378,"children":380},{"class":297,"line":379},10,[381],{"type":40,"tag":295,"props":382,"children":383},{},[384],{"type":45,"value":385},"    \"\"\"\n",{"type":40,"tag":295,"props":387,"children":389},{"class":297,"line":388},11,[390],{"type":40,"tag":295,"props":391,"children":392},{},[393],{"type":45,"value":394},"    return f\"Weather in {location}: Sunny, 72F\"\n",{"type":40,"tag":295,"props":396,"children":398},{"class":297,"line":397},12,[399],{"type":40,"tag":295,"props":400,"children":401},{"emptyLinePlaceholder":320},[402],{"type":45,"value":323},{"type":40,"tag":295,"props":404,"children":406},{"class":297,"line":405},13,[407],{"type":40,"tag":295,"props":408,"children":409},{},[410],{"type":45,"value":411},"agent = create_agent(\n",{"type":40,"tag":295,"props":413,"children":415},{"class":297,"line":414},14,[416],{"type":40,"tag":295,"props":417,"children":418},{},[419],{"type":45,"value":420},"    model=\"anthropic:claude-sonnet-4-5\",\n",{"type":40,"tag":295,"props":422,"children":424},{"class":297,"line":423},15,[425],{"type":40,"tag":295,"props":426,"children":427},{},[428],{"type":45,"value":429},"    tools=[get_weather],\n",{"type":40,"tag":295,"props":431,"children":433},{"class":297,"line":432},16,[434],{"type":40,"tag":295,"props":435,"children":436},{},[437],{"type":45,"value":438},"    system_prompt=\"You are a helpful assistant.\"\n",{"type":40,"tag":295,"props":440,"children":442},{"class":297,"line":441},17,[443],{"type":40,"tag":295,"props":444,"children":445},{},[446],{"type":45,"value":447},")\n",{"type":40,"tag":295,"props":449,"children":451},{"class":297,"line":450},18,[452],{"type":40,"tag":295,"props":453,"children":454},{"emptyLinePlaceholder":320},[455],{"type":45,"value":323},{"type":40,"tag":295,"props":457,"children":459},{"class":297,"line":458},19,[460],{"type":40,"tag":295,"props":461,"children":462},{},[463],{"type":45,"value":464},"result = agent.invoke({\n",{"type":40,"tag":295,"props":466,"children":468},{"class":297,"line":467},20,[469],{"type":40,"tag":295,"props":470,"children":471},{},[472],{"type":45,"value":473},"    \"messages\": [{\"role\": \"user\", \"content\": \"What's the weather in Paris?\"}]\n",{"type":40,"tag":295,"props":475,"children":477},{"class":297,"line":476},21,[478],{"type":40,"tag":295,"props":479,"children":480},{},[481],{"type":45,"value":482},"})\n",{"type":40,"tag":295,"props":484,"children":486},{"class":297,"line":485},22,[487],{"type":40,"tag":295,"props":488,"children":489},{},[490],{"type":45,"value":491},"print(result[\"messages\"][-1].content)\n",{"type":40,"tag":493,"props":494,"children":495},"typescript",{},[496],{"type":40,"tag":285,"props":497,"children":500},{"className":498,"code":499,"language":493,"meta":289,"style":289},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createAgent } from \"langchain\";\nimport { tool } from \"@langchain\u002Fcore\u002Ftools\";\nimport { z } from \"zod\";\n\nconst getWeather = tool(\n  async ({ location }) => `Weather in ${location}: Sunny, 72F`,\n  {\n    name: \"get_weather\",\n    description: \"Get current weather for a location.\",\n    schema: z.object({ location: z.string().describe(\"City name\") }),\n  }\n);\n\nconst agent = createAgent({\n  model: \"anthropic:claude-sonnet-4-5\",\n  tools: [getWeather],\n  systemPrompt: \"You are a helpful assistant.\",\n});\n\nconst result = await agent.invoke({\n  messages: [{ role: \"user\", content: \"What's the weather in Paris?\" }],\n});\nconsole.log(result.messages[result.messages.length - 1].content);\n",[501],{"type":40,"tag":64,"props":502,"children":503},{"__ignoreMap":289},[504,555,596,637,644,673,742,750,781,810,916,924,935,942,971,1000,1021,1050,1065,1072,1115,1198,1213],{"type":40,"tag":295,"props":505,"children":506},{"class":297,"line":298},[507,513,519,525,530,535,540,545,550],{"type":40,"tag":295,"props":508,"children":510},{"style":509},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[511],{"type":45,"value":512},"import",{"type":40,"tag":295,"props":514,"children":516},{"style":515},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[517],{"type":45,"value":518}," {",{"type":40,"tag":295,"props":520,"children":522},{"style":521},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[523],{"type":45,"value":524}," createAgent",{"type":40,"tag":295,"props":526,"children":527},{"style":515},[528],{"type":45,"value":529}," }",{"type":40,"tag":295,"props":531,"children":532},{"style":509},[533],{"type":45,"value":534}," from",{"type":40,"tag":295,"props":536,"children":537},{"style":515},[538],{"type":45,"value":539}," \"",{"type":40,"tag":295,"props":541,"children":543},{"style":542},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[544],{"type":45,"value":8},{"type":40,"tag":295,"props":546,"children":547},{"style":515},[548],{"type":45,"value":549},"\"",{"type":40,"tag":295,"props":551,"children":552},{"style":515},[553],{"type":45,"value":554},";\n",{"type":40,"tag":295,"props":556,"children":557},{"class":297,"line":307},[558,562,566,571,575,579,583,588,592],{"type":40,"tag":295,"props":559,"children":560},{"style":509},[561],{"type":45,"value":512},{"type":40,"tag":295,"props":563,"children":564},{"style":515},[565],{"type":45,"value":518},{"type":40,"tag":295,"props":567,"children":568},{"style":521},[569],{"type":45,"value":570}," tool",{"type":40,"tag":295,"props":572,"children":573},{"style":515},[574],{"type":45,"value":529},{"type":40,"tag":295,"props":576,"children":577},{"style":509},[578],{"type":45,"value":534},{"type":40,"tag":295,"props":580,"children":581},{"style":515},[582],{"type":45,"value":539},{"type":40,"tag":295,"props":584,"children":585},{"style":542},[586],{"type":45,"value":587},"@langchain\u002Fcore\u002Ftools",{"type":40,"tag":295,"props":589,"children":590},{"style":515},[591],{"type":45,"value":549},{"type":40,"tag":295,"props":593,"children":594},{"style":515},[595],{"type":45,"value":554},{"type":40,"tag":295,"props":597,"children":598},{"class":297,"line":316},[599,603,607,612,616,620,624,629,633],{"type":40,"tag":295,"props":600,"children":601},{"style":509},[602],{"type":45,"value":512},{"type":40,"tag":295,"props":604,"children":605},{"style":515},[606],{"type":45,"value":518},{"type":40,"tag":295,"props":608,"children":609},{"style":521},[610],{"type":45,"value":611}," z",{"type":40,"tag":295,"props":613,"children":614},{"style":515},[615],{"type":45,"value":529},{"type":40,"tag":295,"props":617,"children":618},{"style":509},[619],{"type":45,"value":534},{"type":40,"tag":295,"props":621,"children":622},{"style":515},[623],{"type":45,"value":539},{"type":40,"tag":295,"props":625,"children":626},{"style":542},[627],{"type":45,"value":628},"zod",{"type":40,"tag":295,"props":630,"children":631},{"style":515},[632],{"type":45,"value":549},{"type":40,"tag":295,"props":634,"children":635},{"style":515},[636],{"type":45,"value":554},{"type":40,"tag":295,"props":638,"children":639},{"class":297,"line":326},[640],{"type":40,"tag":295,"props":641,"children":642},{"emptyLinePlaceholder":320},[643],{"type":45,"value":323},{"type":40,"tag":295,"props":645,"children":646},{"class":297,"line":335},[647,653,658,663,668],{"type":40,"tag":295,"props":648,"children":650},{"style":649},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[651],{"type":45,"value":652},"const",{"type":40,"tag":295,"props":654,"children":655},{"style":521},[656],{"type":45,"value":657}," getWeather ",{"type":40,"tag":295,"props":659,"children":660},{"style":515},[661],{"type":45,"value":662},"=",{"type":40,"tag":295,"props":664,"children":666},{"style":665},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[667],{"type":45,"value":570},{"type":40,"tag":295,"props":669,"children":670},{"style":521},[671],{"type":45,"value":672},"(\n",{"type":40,"tag":295,"props":674,"children":675},{"class":297,"line":344},[676,681,686,692,697,702,707,712,717,722,727,732,737],{"type":40,"tag":295,"props":677,"children":678},{"style":649},[679],{"type":45,"value":680},"  async",{"type":40,"tag":295,"props":682,"children":683},{"style":515},[684],{"type":45,"value":685}," ({",{"type":40,"tag":295,"props":687,"children":689},{"style":688},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[690],{"type":45,"value":691}," location",{"type":40,"tag":295,"props":693,"children":694},{"style":515},[695],{"type":45,"value":696}," })",{"type":40,"tag":295,"props":698,"children":699},{"style":649},[700],{"type":45,"value":701}," =>",{"type":40,"tag":295,"props":703,"children":704},{"style":515},[705],{"type":45,"value":706}," `",{"type":40,"tag":295,"props":708,"children":709},{"style":542},[710],{"type":45,"value":711},"Weather in ",{"type":40,"tag":295,"props":713,"children":714},{"style":515},[715],{"type":45,"value":716},"${",{"type":40,"tag":295,"props":718,"children":719},{"style":521},[720],{"type":45,"value":721},"location",{"type":40,"tag":295,"props":723,"children":724},{"style":515},[725],{"type":45,"value":726},"}",{"type":40,"tag":295,"props":728,"children":729},{"style":542},[730],{"type":45,"value":731},": Sunny, 72F",{"type":40,"tag":295,"props":733,"children":734},{"style":515},[735],{"type":45,"value":736},"`",{"type":40,"tag":295,"props":738,"children":739},{"style":515},[740],{"type":45,"value":741},",\n",{"type":40,"tag":295,"props":743,"children":744},{"class":297,"line":353},[745],{"type":40,"tag":295,"props":746,"children":747},{"style":515},[748],{"type":45,"value":749},"  {\n",{"type":40,"tag":295,"props":751,"children":752},{"class":297,"line":361},[753,759,764,768,773,777],{"type":40,"tag":295,"props":754,"children":756},{"style":755},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[757],{"type":45,"value":758},"    name",{"type":40,"tag":295,"props":760,"children":761},{"style":515},[762],{"type":45,"value":763},":",{"type":40,"tag":295,"props":765,"children":766},{"style":515},[767],{"type":45,"value":539},{"type":40,"tag":295,"props":769,"children":770},{"style":542},[771],{"type":45,"value":772},"get_weather",{"type":40,"tag":295,"props":774,"children":775},{"style":515},[776],{"type":45,"value":549},{"type":40,"tag":295,"props":778,"children":779},{"style":515},[780],{"type":45,"value":741},{"type":40,"tag":295,"props":782,"children":783},{"class":297,"line":370},[784,789,793,797,802,806],{"type":40,"tag":295,"props":785,"children":786},{"style":755},[787],{"type":45,"value":788},"    description",{"type":40,"tag":295,"props":790,"children":791},{"style":515},[792],{"type":45,"value":763},{"type":40,"tag":295,"props":794,"children":795},{"style":515},[796],{"type":45,"value":539},{"type":40,"tag":295,"props":798,"children":799},{"style":542},[800],{"type":45,"value":801},"Get current weather for a location.",{"type":40,"tag":295,"props":803,"children":804},{"style":515},[805],{"type":45,"value":549},{"type":40,"tag":295,"props":807,"children":808},{"style":515},[809],{"type":45,"value":741},{"type":40,"tag":295,"props":811,"children":812},{"class":297,"line":379},[813,818,822,826,831,836,841,846,850,854,858,862,867,872,876,881,885,889,894,898,903,907,912],{"type":40,"tag":295,"props":814,"children":815},{"style":755},[816],{"type":45,"value":817},"    schema",{"type":40,"tag":295,"props":819,"children":820},{"style":515},[821],{"type":45,"value":763},{"type":40,"tag":295,"props":823,"children":824},{"style":521},[825],{"type":45,"value":611},{"type":40,"tag":295,"props":827,"children":828},{"style":515},[829],{"type":45,"value":830},".",{"type":40,"tag":295,"props":832,"children":833},{"style":665},[834],{"type":45,"value":835},"object",{"type":40,"tag":295,"props":837,"children":838},{"style":521},[839],{"type":45,"value":840},"(",{"type":40,"tag":295,"props":842,"children":843},{"style":515},[844],{"type":45,"value":845},"{",{"type":40,"tag":295,"props":847,"children":848},{"style":755},[849],{"type":45,"value":691},{"type":40,"tag":295,"props":851,"children":852},{"style":515},[853],{"type":45,"value":763},{"type":40,"tag":295,"props":855,"children":856},{"style":521},[857],{"type":45,"value":611},{"type":40,"tag":295,"props":859,"children":860},{"style":515},[861],{"type":45,"value":830},{"type":40,"tag":295,"props":863,"children":864},{"style":665},[865],{"type":45,"value":866},"string",{"type":40,"tag":295,"props":868,"children":869},{"style":521},[870],{"type":45,"value":871},"()",{"type":40,"tag":295,"props":873,"children":874},{"style":515},[875],{"type":45,"value":830},{"type":40,"tag":295,"props":877,"children":878},{"style":665},[879],{"type":45,"value":880},"describe",{"type":40,"tag":295,"props":882,"children":883},{"style":521},[884],{"type":45,"value":840},{"type":40,"tag":295,"props":886,"children":887},{"style":515},[888],{"type":45,"value":549},{"type":40,"tag":295,"props":890,"children":891},{"style":542},[892],{"type":45,"value":893},"City name",{"type":40,"tag":295,"props":895,"children":896},{"style":515},[897],{"type":45,"value":549},{"type":40,"tag":295,"props":899,"children":900},{"style":521},[901],{"type":45,"value":902},") ",{"type":40,"tag":295,"props":904,"children":905},{"style":515},[906],{"type":45,"value":726},{"type":40,"tag":295,"props":908,"children":909},{"style":521},[910],{"type":45,"value":911},")",{"type":40,"tag":295,"props":913,"children":914},{"style":515},[915],{"type":45,"value":741},{"type":40,"tag":295,"props":917,"children":918},{"class":297,"line":388},[919],{"type":40,"tag":295,"props":920,"children":921},{"style":515},[922],{"type":45,"value":923},"  }\n",{"type":40,"tag":295,"props":925,"children":926},{"class":297,"line":397},[927,931],{"type":40,"tag":295,"props":928,"children":929},{"style":521},[930],{"type":45,"value":911},{"type":40,"tag":295,"props":932,"children":933},{"style":515},[934],{"type":45,"value":554},{"type":40,"tag":295,"props":936,"children":937},{"class":297,"line":405},[938],{"type":40,"tag":295,"props":939,"children":940},{"emptyLinePlaceholder":320},[941],{"type":45,"value":323},{"type":40,"tag":295,"props":943,"children":944},{"class":297,"line":414},[945,949,954,958,962,966],{"type":40,"tag":295,"props":946,"children":947},{"style":649},[948],{"type":45,"value":652},{"type":40,"tag":295,"props":950,"children":951},{"style":521},[952],{"type":45,"value":953}," agent ",{"type":40,"tag":295,"props":955,"children":956},{"style":515},[957],{"type":45,"value":662},{"type":40,"tag":295,"props":959,"children":960},{"style":665},[961],{"type":45,"value":524},{"type":40,"tag":295,"props":963,"children":964},{"style":521},[965],{"type":45,"value":840},{"type":40,"tag":295,"props":967,"children":968},{"style":515},[969],{"type":45,"value":970},"{\n",{"type":40,"tag":295,"props":972,"children":973},{"class":297,"line":423},[974,979,983,987,992,996],{"type":40,"tag":295,"props":975,"children":976},{"style":755},[977],{"type":45,"value":978},"  model",{"type":40,"tag":295,"props":980,"children":981},{"style":515},[982],{"type":45,"value":763},{"type":40,"tag":295,"props":984,"children":985},{"style":515},[986],{"type":45,"value":539},{"type":40,"tag":295,"props":988,"children":989},{"style":542},[990],{"type":45,"value":991},"anthropic:claude-sonnet-4-5",{"type":40,"tag":295,"props":993,"children":994},{"style":515},[995],{"type":45,"value":549},{"type":40,"tag":295,"props":997,"children":998},{"style":515},[999],{"type":45,"value":741},{"type":40,"tag":295,"props":1001,"children":1002},{"class":297,"line":432},[1003,1008,1012,1017],{"type":40,"tag":295,"props":1004,"children":1005},{"style":755},[1006],{"type":45,"value":1007},"  tools",{"type":40,"tag":295,"props":1009,"children":1010},{"style":515},[1011],{"type":45,"value":763},{"type":40,"tag":295,"props":1013,"children":1014},{"style":521},[1015],{"type":45,"value":1016}," [getWeather]",{"type":40,"tag":295,"props":1018,"children":1019},{"style":515},[1020],{"type":45,"value":741},{"type":40,"tag":295,"props":1022,"children":1023},{"class":297,"line":441},[1024,1029,1033,1037,1042,1046],{"type":40,"tag":295,"props":1025,"children":1026},{"style":755},[1027],{"type":45,"value":1028},"  systemPrompt",{"type":40,"tag":295,"props":1030,"children":1031},{"style":515},[1032],{"type":45,"value":763},{"type":40,"tag":295,"props":1034,"children":1035},{"style":515},[1036],{"type":45,"value":539},{"type":40,"tag":295,"props":1038,"children":1039},{"style":542},[1040],{"type":45,"value":1041},"You are a helpful assistant.",{"type":40,"tag":295,"props":1043,"children":1044},{"style":515},[1045],{"type":45,"value":549},{"type":40,"tag":295,"props":1047,"children":1048},{"style":515},[1049],{"type":45,"value":741},{"type":40,"tag":295,"props":1051,"children":1052},{"class":297,"line":450},[1053,1057,1061],{"type":40,"tag":295,"props":1054,"children":1055},{"style":515},[1056],{"type":45,"value":726},{"type":40,"tag":295,"props":1058,"children":1059},{"style":521},[1060],{"type":45,"value":911},{"type":40,"tag":295,"props":1062,"children":1063},{"style":515},[1064],{"type":45,"value":554},{"type":40,"tag":295,"props":1066,"children":1067},{"class":297,"line":458},[1068],{"type":40,"tag":295,"props":1069,"children":1070},{"emptyLinePlaceholder":320},[1071],{"type":45,"value":323},{"type":40,"tag":295,"props":1073,"children":1074},{"class":297,"line":467},[1075,1079,1084,1088,1093,1098,1102,1107,1111],{"type":40,"tag":295,"props":1076,"children":1077},{"style":649},[1078],{"type":45,"value":652},{"type":40,"tag":295,"props":1080,"children":1081},{"style":521},[1082],{"type":45,"value":1083}," result ",{"type":40,"tag":295,"props":1085,"children":1086},{"style":515},[1087],{"type":45,"value":662},{"type":40,"tag":295,"props":1089,"children":1090},{"style":509},[1091],{"type":45,"value":1092}," await",{"type":40,"tag":295,"props":1094,"children":1095},{"style":521},[1096],{"type":45,"value":1097}," agent",{"type":40,"tag":295,"props":1099,"children":1100},{"style":515},[1101],{"type":45,"value":830},{"type":40,"tag":295,"props":1103,"children":1104},{"style":665},[1105],{"type":45,"value":1106},"invoke",{"type":40,"tag":295,"props":1108,"children":1109},{"style":521},[1110],{"type":45,"value":840},{"type":40,"tag":295,"props":1112,"children":1113},{"style":515},[1114],{"type":45,"value":970},{"type":40,"tag":295,"props":1116,"children":1117},{"class":297,"line":476},[1118,1123,1127,1132,1136,1141,1145,1149,1154,1158,1163,1168,1172,1176,1181,1185,1189,1194],{"type":40,"tag":295,"props":1119,"children":1120},{"style":755},[1121],{"type":45,"value":1122},"  messages",{"type":40,"tag":295,"props":1124,"children":1125},{"style":515},[1126],{"type":45,"value":763},{"type":40,"tag":295,"props":1128,"children":1129},{"style":521},[1130],{"type":45,"value":1131}," [",{"type":40,"tag":295,"props":1133,"children":1134},{"style":515},[1135],{"type":45,"value":845},{"type":40,"tag":295,"props":1137,"children":1138},{"style":755},[1139],{"type":45,"value":1140}," role",{"type":40,"tag":295,"props":1142,"children":1143},{"style":515},[1144],{"type":45,"value":763},{"type":40,"tag":295,"props":1146,"children":1147},{"style":515},[1148],{"type":45,"value":539},{"type":40,"tag":295,"props":1150,"children":1151},{"style":542},[1152],{"type":45,"value":1153},"user",{"type":40,"tag":295,"props":1155,"children":1156},{"style":515},[1157],{"type":45,"value":549},{"type":40,"tag":295,"props":1159,"children":1160},{"style":515},[1161],{"type":45,"value":1162},",",{"type":40,"tag":295,"props":1164,"children":1165},{"style":755},[1166],{"type":45,"value":1167}," content",{"type":40,"tag":295,"props":1169,"children":1170},{"style":515},[1171],{"type":45,"value":763},{"type":40,"tag":295,"props":1173,"children":1174},{"style":515},[1175],{"type":45,"value":539},{"type":40,"tag":295,"props":1177,"children":1178},{"style":542},[1179],{"type":45,"value":1180},"What's the weather in Paris?",{"type":40,"tag":295,"props":1182,"children":1183},{"style":515},[1184],{"type":45,"value":549},{"type":40,"tag":295,"props":1186,"children":1187},{"style":515},[1188],{"type":45,"value":529},{"type":40,"tag":295,"props":1190,"children":1191},{"style":521},[1192],{"type":45,"value":1193},"]",{"type":40,"tag":295,"props":1195,"children":1196},{"style":515},[1197],{"type":45,"value":741},{"type":40,"tag":295,"props":1199,"children":1200},{"class":297,"line":485},[1201,1205,1209],{"type":40,"tag":295,"props":1202,"children":1203},{"style":515},[1204],{"type":45,"value":726},{"type":40,"tag":295,"props":1206,"children":1207},{"style":521},[1208],{"type":45,"value":911},{"type":40,"tag":295,"props":1210,"children":1211},{"style":515},[1212],{"type":45,"value":554},{"type":40,"tag":295,"props":1214,"children":1216},{"class":297,"line":1215},23,[1217,1222,1226,1231,1236,1240,1245,1249,1254,1258,1263,1268,1274,1278,1282,1287],{"type":40,"tag":295,"props":1218,"children":1219},{"style":521},[1220],{"type":45,"value":1221},"console",{"type":40,"tag":295,"props":1223,"children":1224},{"style":515},[1225],{"type":45,"value":830},{"type":40,"tag":295,"props":1227,"children":1228},{"style":665},[1229],{"type":45,"value":1230},"log",{"type":40,"tag":295,"props":1232,"children":1233},{"style":521},[1234],{"type":45,"value":1235},"(result",{"type":40,"tag":295,"props":1237,"children":1238},{"style":515},[1239],{"type":45,"value":830},{"type":40,"tag":295,"props":1241,"children":1242},{"style":521},[1243],{"type":45,"value":1244},"messages[result",{"type":40,"tag":295,"props":1246,"children":1247},{"style":515},[1248],{"type":45,"value":830},{"type":40,"tag":295,"props":1250,"children":1251},{"style":521},[1252],{"type":45,"value":1253},"messages",{"type":40,"tag":295,"props":1255,"children":1256},{"style":515},[1257],{"type":45,"value":830},{"type":40,"tag":295,"props":1259,"children":1260},{"style":521},[1261],{"type":45,"value":1262},"length ",{"type":40,"tag":295,"props":1264,"children":1265},{"style":515},[1266],{"type":45,"value":1267},"-",{"type":40,"tag":295,"props":1269,"children":1271},{"style":1270},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1272],{"type":45,"value":1273}," 1",{"type":40,"tag":295,"props":1275,"children":1276},{"style":521},[1277],{"type":45,"value":1193},{"type":40,"tag":295,"props":1279,"children":1280},{"style":515},[1281],{"type":45,"value":830},{"type":40,"tag":295,"props":1283,"children":1284},{"style":521},[1285],{"type":45,"value":1286},"content)",{"type":40,"tag":295,"props":1288,"children":1289},{"style":515},[1290],{"type":45,"value":554},{"type":40,"tag":1292,"props":1293,"children":1294},"ex-agent-with-persistence",{},[1295,1420],{"type":40,"tag":281,"props":1296,"children":1297},{},[1298,1300],{"type":45,"value":1299},"\nAdd MemorySaver checkpointer to maintain conversation state across invocations.\n",{"type":40,"tag":285,"props":1301,"children":1303},{"className":287,"code":1302,"language":281,"meta":289,"style":289},"from langchain.agents import create_agent\nfrom langgraph.checkpoint.memory import MemorySaver\n\ncheckpointer = MemorySaver()\n\nagent = create_agent(\n    model=\"anthropic:claude-sonnet-4-5\",\n    tools=[search],\n    checkpointer=checkpointer,\n)\n\nconfig = {\"configurable\": {\"thread_id\": \"user-123\"}}\nagent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"My name is Alice\"}]}, config=config)\nresult = agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"What's my name?\"}]}, config=config)\n# Agent remembers: \"Your name is Alice\"\n",[1304],{"type":40,"tag":64,"props":1305,"children":1306},{"__ignoreMap":289},[1307,1314,1322,1329,1337,1344,1351,1358,1366,1374,1381,1388,1396,1404,1412],{"type":40,"tag":295,"props":1308,"children":1309},{"class":297,"line":298},[1310],{"type":40,"tag":295,"props":1311,"children":1312},{},[1313],{"type":45,"value":304},{"type":40,"tag":295,"props":1315,"children":1316},{"class":297,"line":307},[1317],{"type":40,"tag":295,"props":1318,"children":1319},{},[1320],{"type":45,"value":1321},"from langgraph.checkpoint.memory import MemorySaver\n",{"type":40,"tag":295,"props":1323,"children":1324},{"class":297,"line":316},[1325],{"type":40,"tag":295,"props":1326,"children":1327},{"emptyLinePlaceholder":320},[1328],{"type":45,"value":323},{"type":40,"tag":295,"props":1330,"children":1331},{"class":297,"line":326},[1332],{"type":40,"tag":295,"props":1333,"children":1334},{},[1335],{"type":45,"value":1336},"checkpointer = MemorySaver()\n",{"type":40,"tag":295,"props":1338,"children":1339},{"class":297,"line":335},[1340],{"type":40,"tag":295,"props":1341,"children":1342},{"emptyLinePlaceholder":320},[1343],{"type":45,"value":323},{"type":40,"tag":295,"props":1345,"children":1346},{"class":297,"line":344},[1347],{"type":40,"tag":295,"props":1348,"children":1349},{},[1350],{"type":45,"value":411},{"type":40,"tag":295,"props":1352,"children":1353},{"class":297,"line":353},[1354],{"type":40,"tag":295,"props":1355,"children":1356},{},[1357],{"type":45,"value":420},{"type":40,"tag":295,"props":1359,"children":1360},{"class":297,"line":361},[1361],{"type":40,"tag":295,"props":1362,"children":1363},{},[1364],{"type":45,"value":1365},"    tools=[search],\n",{"type":40,"tag":295,"props":1367,"children":1368},{"class":297,"line":370},[1369],{"type":40,"tag":295,"props":1370,"children":1371},{},[1372],{"type":45,"value":1373},"    checkpointer=checkpointer,\n",{"type":40,"tag":295,"props":1375,"children":1376},{"class":297,"line":379},[1377],{"type":40,"tag":295,"props":1378,"children":1379},{},[1380],{"type":45,"value":447},{"type":40,"tag":295,"props":1382,"children":1383},{"class":297,"line":388},[1384],{"type":40,"tag":295,"props":1385,"children":1386},{"emptyLinePlaceholder":320},[1387],{"type":45,"value":323},{"type":40,"tag":295,"props":1389,"children":1390},{"class":297,"line":397},[1391],{"type":40,"tag":295,"props":1392,"children":1393},{},[1394],{"type":45,"value":1395},"config = {\"configurable\": {\"thread_id\": \"user-123\"}}\n",{"type":40,"tag":295,"props":1397,"children":1398},{"class":297,"line":405},[1399],{"type":40,"tag":295,"props":1400,"children":1401},{},[1402],{"type":45,"value":1403},"agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"My name is Alice\"}]}, config=config)\n",{"type":40,"tag":295,"props":1405,"children":1406},{"class":297,"line":414},[1407],{"type":40,"tag":295,"props":1408,"children":1409},{},[1410],{"type":45,"value":1411},"result = agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"What's my name?\"}]}, config=config)\n",{"type":40,"tag":295,"props":1413,"children":1414},{"class":297,"line":423},[1415],{"type":40,"tag":295,"props":1416,"children":1417},{},[1418],{"type":45,"value":1419},"# Agent remembers: \"Your name is Alice\"\n",{"type":40,"tag":493,"props":1421,"children":1422},{},[1423,1424],{"type":45,"value":1299},{"type":40,"tag":285,"props":1425,"children":1427},{"className":498,"code":1426,"language":493,"meta":289,"style":289},"import { createAgent } from \"langchain\";\nimport { MemorySaver } from \"@langchain\u002Flanggraph\";\n\nconst checkpointer = new MemorySaver();\n\nconst agent = createAgent({\n  model: \"anthropic:claude-sonnet-4-5\",\n  tools: [search],\n  checkpointer,\n});\n\nconst config = { configurable: { thread_id: \"user-123\" } };\nawait agent.invoke({ messages: [{ role: \"user\", content: \"My name is Alice\" }] }, config);\nconst result = await agent.invoke({ messages: [{ role: \"user\", content: \"What's my name?\" }] }, config);\n\u002F\u002F Agent remembers: \"Your name is Alice\"\n",[1428],{"type":40,"tag":64,"props":1429,"children":1430},{"__ignoreMap":289},[1431,1470,1511,1518,1551,1558,1585,1612,1632,1644,1659,1666,1730,1843,1963],{"type":40,"tag":295,"props":1432,"children":1433},{"class":297,"line":298},[1434,1438,1442,1446,1450,1454,1458,1462,1466],{"type":40,"tag":295,"props":1435,"children":1436},{"style":509},[1437],{"type":45,"value":512},{"type":40,"tag":295,"props":1439,"children":1440},{"style":515},[1441],{"type":45,"value":518},{"type":40,"tag":295,"props":1443,"children":1444},{"style":521},[1445],{"type":45,"value":524},{"type":40,"tag":295,"props":1447,"children":1448},{"style":515},[1449],{"type":45,"value":529},{"type":40,"tag":295,"props":1451,"children":1452},{"style":509},[1453],{"type":45,"value":534},{"type":40,"tag":295,"props":1455,"children":1456},{"style":515},[1457],{"type":45,"value":539},{"type":40,"tag":295,"props":1459,"children":1460},{"style":542},[1461],{"type":45,"value":8},{"type":40,"tag":295,"props":1463,"children":1464},{"style":515},[1465],{"type":45,"value":549},{"type":40,"tag":295,"props":1467,"children":1468},{"style":515},[1469],{"type":45,"value":554},{"type":40,"tag":295,"props":1471,"children":1472},{"class":297,"line":307},[1473,1477,1481,1486,1490,1494,1498,1503,1507],{"type":40,"tag":295,"props":1474,"children":1475},{"style":509},[1476],{"type":45,"value":512},{"type":40,"tag":295,"props":1478,"children":1479},{"style":515},[1480],{"type":45,"value":518},{"type":40,"tag":295,"props":1482,"children":1483},{"style":521},[1484],{"type":45,"value":1485}," MemorySaver",{"type":40,"tag":295,"props":1487,"children":1488},{"style":515},[1489],{"type":45,"value":529},{"type":40,"tag":295,"props":1491,"children":1492},{"style":509},[1493],{"type":45,"value":534},{"type":40,"tag":295,"props":1495,"children":1496},{"style":515},[1497],{"type":45,"value":539},{"type":40,"tag":295,"props":1499,"children":1500},{"style":542},[1501],{"type":45,"value":1502},"@langchain\u002Flanggraph",{"type":40,"tag":295,"props":1504,"children":1505},{"style":515},[1506],{"type":45,"value":549},{"type":40,"tag":295,"props":1508,"children":1509},{"style":515},[1510],{"type":45,"value":554},{"type":40,"tag":295,"props":1512,"children":1513},{"class":297,"line":316},[1514],{"type":40,"tag":295,"props":1515,"children":1516},{"emptyLinePlaceholder":320},[1517],{"type":45,"value":323},{"type":40,"tag":295,"props":1519,"children":1520},{"class":297,"line":326},[1521,1525,1530,1534,1539,1543,1547],{"type":40,"tag":295,"props":1522,"children":1523},{"style":649},[1524],{"type":45,"value":652},{"type":40,"tag":295,"props":1526,"children":1527},{"style":521},[1528],{"type":45,"value":1529}," checkpointer ",{"type":40,"tag":295,"props":1531,"children":1532},{"style":515},[1533],{"type":45,"value":662},{"type":40,"tag":295,"props":1535,"children":1536},{"style":515},[1537],{"type":45,"value":1538}," new",{"type":40,"tag":295,"props":1540,"children":1541},{"style":665},[1542],{"type":45,"value":1485},{"type":40,"tag":295,"props":1544,"children":1545},{"style":521},[1546],{"type":45,"value":871},{"type":40,"tag":295,"props":1548,"children":1549},{"style":515},[1550],{"type":45,"value":554},{"type":40,"tag":295,"props":1552,"children":1553},{"class":297,"line":335},[1554],{"type":40,"tag":295,"props":1555,"children":1556},{"emptyLinePlaceholder":320},[1557],{"type":45,"value":323},{"type":40,"tag":295,"props":1559,"children":1560},{"class":297,"line":344},[1561,1565,1569,1573,1577,1581],{"type":40,"tag":295,"props":1562,"children":1563},{"style":649},[1564],{"type":45,"value":652},{"type":40,"tag":295,"props":1566,"children":1567},{"style":521},[1568],{"type":45,"value":953},{"type":40,"tag":295,"props":1570,"children":1571},{"style":515},[1572],{"type":45,"value":662},{"type":40,"tag":295,"props":1574,"children":1575},{"style":665},[1576],{"type":45,"value":524},{"type":40,"tag":295,"props":1578,"children":1579},{"style":521},[1580],{"type":45,"value":840},{"type":40,"tag":295,"props":1582,"children":1583},{"style":515},[1584],{"type":45,"value":970},{"type":40,"tag":295,"props":1586,"children":1587},{"class":297,"line":353},[1588,1592,1596,1600,1604,1608],{"type":40,"tag":295,"props":1589,"children":1590},{"style":755},[1591],{"type":45,"value":978},{"type":40,"tag":295,"props":1593,"children":1594},{"style":515},[1595],{"type":45,"value":763},{"type":40,"tag":295,"props":1597,"children":1598},{"style":515},[1599],{"type":45,"value":539},{"type":40,"tag":295,"props":1601,"children":1602},{"style":542},[1603],{"type":45,"value":991},{"type":40,"tag":295,"props":1605,"children":1606},{"style":515},[1607],{"type":45,"value":549},{"type":40,"tag":295,"props":1609,"children":1610},{"style":515},[1611],{"type":45,"value":741},{"type":40,"tag":295,"props":1613,"children":1614},{"class":297,"line":361},[1615,1619,1623,1628],{"type":40,"tag":295,"props":1616,"children":1617},{"style":755},[1618],{"type":45,"value":1007},{"type":40,"tag":295,"props":1620,"children":1621},{"style":515},[1622],{"type":45,"value":763},{"type":40,"tag":295,"props":1624,"children":1625},{"style":521},[1626],{"type":45,"value":1627}," [search]",{"type":40,"tag":295,"props":1629,"children":1630},{"style":515},[1631],{"type":45,"value":741},{"type":40,"tag":295,"props":1633,"children":1634},{"class":297,"line":370},[1635,1640],{"type":40,"tag":295,"props":1636,"children":1637},{"style":521},[1638],{"type":45,"value":1639},"  checkpointer",{"type":40,"tag":295,"props":1641,"children":1642},{"style":515},[1643],{"type":45,"value":741},{"type":40,"tag":295,"props":1645,"children":1646},{"class":297,"line":379},[1647,1651,1655],{"type":40,"tag":295,"props":1648,"children":1649},{"style":515},[1650],{"type":45,"value":726},{"type":40,"tag":295,"props":1652,"children":1653},{"style":521},[1654],{"type":45,"value":911},{"type":40,"tag":295,"props":1656,"children":1657},{"style":515},[1658],{"type":45,"value":554},{"type":40,"tag":295,"props":1660,"children":1661},{"class":297,"line":388},[1662],{"type":40,"tag":295,"props":1663,"children":1664},{"emptyLinePlaceholder":320},[1665],{"type":45,"value":323},{"type":40,"tag":295,"props":1667,"children":1668},{"class":297,"line":397},[1669,1673,1678,1682,1686,1691,1695,1699,1704,1708,1712,1717,1721,1725],{"type":40,"tag":295,"props":1670,"children":1671},{"style":649},[1672],{"type":45,"value":652},{"type":40,"tag":295,"props":1674,"children":1675},{"style":521},[1676],{"type":45,"value":1677}," config ",{"type":40,"tag":295,"props":1679,"children":1680},{"style":515},[1681],{"type":45,"value":662},{"type":40,"tag":295,"props":1683,"children":1684},{"style":515},[1685],{"type":45,"value":518},{"type":40,"tag":295,"props":1687,"children":1688},{"style":755},[1689],{"type":45,"value":1690}," configurable",{"type":40,"tag":295,"props":1692,"children":1693},{"style":515},[1694],{"type":45,"value":763},{"type":40,"tag":295,"props":1696,"children":1697},{"style":515},[1698],{"type":45,"value":518},{"type":40,"tag":295,"props":1700,"children":1701},{"style":755},[1702],{"type":45,"value":1703}," thread_id",{"type":40,"tag":295,"props":1705,"children":1706},{"style":515},[1707],{"type":45,"value":763},{"type":40,"tag":295,"props":1709,"children":1710},{"style":515},[1711],{"type":45,"value":539},{"type":40,"tag":295,"props":1713,"children":1714},{"style":542},[1715],{"type":45,"value":1716},"user-123",{"type":40,"tag":295,"props":1718,"children":1719},{"style":515},[1720],{"type":45,"value":549},{"type":40,"tag":295,"props":1722,"children":1723},{"style":515},[1724],{"type":45,"value":529},{"type":40,"tag":295,"props":1726,"children":1727},{"style":515},[1728],{"type":45,"value":1729}," };\n",{"type":40,"tag":295,"props":1731,"children":1732},{"class":297,"line":405},[1733,1738,1742,1746,1750,1754,1758,1763,1767,1771,1775,1779,1783,1787,1791,1795,1799,1803,1807,1811,1816,1820,1824,1829,1834,1839],{"type":40,"tag":295,"props":1734,"children":1735},{"style":509},[1736],{"type":45,"value":1737},"await",{"type":40,"tag":295,"props":1739,"children":1740},{"style":521},[1741],{"type":45,"value":1097},{"type":40,"tag":295,"props":1743,"children":1744},{"style":515},[1745],{"type":45,"value":830},{"type":40,"tag":295,"props":1747,"children":1748},{"style":665},[1749],{"type":45,"value":1106},{"type":40,"tag":295,"props":1751,"children":1752},{"style":521},[1753],{"type":45,"value":840},{"type":40,"tag":295,"props":1755,"children":1756},{"style":515},[1757],{"type":45,"value":845},{"type":40,"tag":295,"props":1759,"children":1760},{"style":755},[1761],{"type":45,"value":1762}," messages",{"type":40,"tag":295,"props":1764,"children":1765},{"style":515},[1766],{"type":45,"value":763},{"type":40,"tag":295,"props":1768,"children":1769},{"style":521},[1770],{"type":45,"value":1131},{"type":40,"tag":295,"props":1772,"children":1773},{"style":515},[1774],{"type":45,"value":845},{"type":40,"tag":295,"props":1776,"children":1777},{"style":755},[1778],{"type":45,"value":1140},{"type":40,"tag":295,"props":1780,"children":1781},{"style":515},[1782],{"type":45,"value":763},{"type":40,"tag":295,"props":1784,"children":1785},{"style":515},[1786],{"type":45,"value":539},{"type":40,"tag":295,"props":1788,"children":1789},{"style":542},[1790],{"type":45,"value":1153},{"type":40,"tag":295,"props":1792,"children":1793},{"style":515},[1794],{"type":45,"value":549},{"type":40,"tag":295,"props":1796,"children":1797},{"style":515},[1798],{"type":45,"value":1162},{"type":40,"tag":295,"props":1800,"children":1801},{"style":755},[1802],{"type":45,"value":1167},{"type":40,"tag":295,"props":1804,"children":1805},{"style":515},[1806],{"type":45,"value":763},{"type":40,"tag":295,"props":1808,"children":1809},{"style":515},[1810],{"type":45,"value":539},{"type":40,"tag":295,"props":1812,"children":1813},{"style":542},[1814],{"type":45,"value":1815},"My name is Alice",{"type":40,"tag":295,"props":1817,"children":1818},{"style":515},[1819],{"type":45,"value":549},{"type":40,"tag":295,"props":1821,"children":1822},{"style":515},[1823],{"type":45,"value":529},{"type":40,"tag":295,"props":1825,"children":1826},{"style":521},[1827],{"type":45,"value":1828},"] ",{"type":40,"tag":295,"props":1830,"children":1831},{"style":515},[1832],{"type":45,"value":1833},"},",{"type":40,"tag":295,"props":1835,"children":1836},{"style":521},[1837],{"type":45,"value":1838}," config)",{"type":40,"tag":295,"props":1840,"children":1841},{"style":515},[1842],{"type":45,"value":554},{"type":40,"tag":295,"props":1844,"children":1845},{"class":297,"line":414},[1846,1850,1854,1858,1862,1866,1870,1874,1878,1882,1886,1890,1894,1898,1902,1906,1910,1914,1918,1922,1926,1930,1934,1939,1943,1947,1951,1955,1959],{"type":40,"tag":295,"props":1847,"children":1848},{"style":649},[1849],{"type":45,"value":652},{"type":40,"tag":295,"props":1851,"children":1852},{"style":521},[1853],{"type":45,"value":1083},{"type":40,"tag":295,"props":1855,"children":1856},{"style":515},[1857],{"type":45,"value":662},{"type":40,"tag":295,"props":1859,"children":1860},{"style":509},[1861],{"type":45,"value":1092},{"type":40,"tag":295,"props":1863,"children":1864},{"style":521},[1865],{"type":45,"value":1097},{"type":40,"tag":295,"props":1867,"children":1868},{"style":515},[1869],{"type":45,"value":830},{"type":40,"tag":295,"props":1871,"children":1872},{"style":665},[1873],{"type":45,"value":1106},{"type":40,"tag":295,"props":1875,"children":1876},{"style":521},[1877],{"type":45,"value":840},{"type":40,"tag":295,"props":1879,"children":1880},{"style":515},[1881],{"type":45,"value":845},{"type":40,"tag":295,"props":1883,"children":1884},{"style":755},[1885],{"type":45,"value":1762},{"type":40,"tag":295,"props":1887,"children":1888},{"style":515},[1889],{"type":45,"value":763},{"type":40,"tag":295,"props":1891,"children":1892},{"style":521},[1893],{"type":45,"value":1131},{"type":40,"tag":295,"props":1895,"children":1896},{"style":515},[1897],{"type":45,"value":845},{"type":40,"tag":295,"props":1899,"children":1900},{"style":755},[1901],{"type":45,"value":1140},{"type":40,"tag":295,"props":1903,"children":1904},{"style":515},[1905],{"type":45,"value":763},{"type":40,"tag":295,"props":1907,"children":1908},{"style":515},[1909],{"type":45,"value":539},{"type":40,"tag":295,"props":1911,"children":1912},{"style":542},[1913],{"type":45,"value":1153},{"type":40,"tag":295,"props":1915,"children":1916},{"style":515},[1917],{"type":45,"value":549},{"type":40,"tag":295,"props":1919,"children":1920},{"style":515},[1921],{"type":45,"value":1162},{"type":40,"tag":295,"props":1923,"children":1924},{"style":755},[1925],{"type":45,"value":1167},{"type":40,"tag":295,"props":1927,"children":1928},{"style":515},[1929],{"type":45,"value":763},{"type":40,"tag":295,"props":1931,"children":1932},{"style":515},[1933],{"type":45,"value":539},{"type":40,"tag":295,"props":1935,"children":1936},{"style":542},[1937],{"type":45,"value":1938},"What's my name?",{"type":40,"tag":295,"props":1940,"children":1941},{"style":515},[1942],{"type":45,"value":549},{"type":40,"tag":295,"props":1944,"children":1945},{"style":515},[1946],{"type":45,"value":529},{"type":40,"tag":295,"props":1948,"children":1949},{"style":521},[1950],{"type":45,"value":1828},{"type":40,"tag":295,"props":1952,"children":1953},{"style":515},[1954],{"type":45,"value":1833},{"type":40,"tag":295,"props":1956,"children":1957},{"style":521},[1958],{"type":45,"value":1838},{"type":40,"tag":295,"props":1960,"children":1961},{"style":515},[1962],{"type":45,"value":554},{"type":40,"tag":295,"props":1964,"children":1965},{"class":297,"line":423},[1966],{"type":40,"tag":295,"props":1967,"children":1969},{"style":1968},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[1970],{"type":45,"value":1971},"\u002F\u002F Agent remembers: \"Your name is Alice\"\n",{"type":40,"tag":151,"props":1973,"children":1974},{},[1975,1977,1998,2515],{"type":45,"value":1976},"\n## Defining Tools\n",{"type":40,"tag":48,"props":1978,"children":1979},{},[1980,1982,1988,1990,1996],{"type":45,"value":1981},"Tools are functions that agents can call. Use the ",{"type":40,"tag":64,"props":1983,"children":1985},{"className":1984},[],[1986],{"type":45,"value":1987},"@tool",{"type":45,"value":1989}," decorator (Python) or ",{"type":40,"tag":64,"props":1991,"children":1993},{"className":1992},[],[1994],{"type":45,"value":1995},"tool()",{"type":45,"value":1997}," function (TypeScript).\n",{"type":40,"tag":1999,"props":2000,"children":2001},"ex-basic-tool",{},[2002,2094],{"type":40,"tag":281,"props":2003,"children":2004},{},[2005],{"type":40,"tag":285,"props":2006,"children":2008},{"className":287,"code":2007,"language":281,"meta":289,"style":289},"from langchain_core.tools import tool\n\n@tool\ndef add(a: float, b: float) -> float:\n    \"\"\"Add two numbers.\n\n    Args:\n        a: First number\n        b: Second number\n    \"\"\"\n    return a + b\n",[2009],{"type":40,"tag":64,"props":2010,"children":2011},{"__ignoreMap":289},[2012,2019,2026,2033,2041,2049,2056,2063,2071,2079,2086],{"type":40,"tag":295,"props":2013,"children":2014},{"class":297,"line":298},[2015],{"type":40,"tag":295,"props":2016,"children":2017},{},[2018],{"type":45,"value":313},{"type":40,"tag":295,"props":2020,"children":2021},{"class":297,"line":307},[2022],{"type":40,"tag":295,"props":2023,"children":2024},{"emptyLinePlaceholder":320},[2025],{"type":45,"value":323},{"type":40,"tag":295,"props":2027,"children":2028},{"class":297,"line":316},[2029],{"type":40,"tag":295,"props":2030,"children":2031},{},[2032],{"type":45,"value":332},{"type":40,"tag":295,"props":2034,"children":2035},{"class":297,"line":326},[2036],{"type":40,"tag":295,"props":2037,"children":2038},{},[2039],{"type":45,"value":2040},"def add(a: float, b: float) -> float:\n",{"type":40,"tag":295,"props":2042,"children":2043},{"class":297,"line":335},[2044],{"type":40,"tag":295,"props":2045,"children":2046},{},[2047],{"type":45,"value":2048},"    \"\"\"Add two numbers.\n",{"type":40,"tag":295,"props":2050,"children":2051},{"class":297,"line":344},[2052],{"type":40,"tag":295,"props":2053,"children":2054},{"emptyLinePlaceholder":320},[2055],{"type":45,"value":323},{"type":40,"tag":295,"props":2057,"children":2058},{"class":297,"line":353},[2059],{"type":40,"tag":295,"props":2060,"children":2061},{},[2062],{"type":45,"value":367},{"type":40,"tag":295,"props":2064,"children":2065},{"class":297,"line":361},[2066],{"type":40,"tag":295,"props":2067,"children":2068},{},[2069],{"type":45,"value":2070},"        a: First number\n",{"type":40,"tag":295,"props":2072,"children":2073},{"class":297,"line":370},[2074],{"type":40,"tag":295,"props":2075,"children":2076},{},[2077],{"type":45,"value":2078},"        b: Second number\n",{"type":40,"tag":295,"props":2080,"children":2081},{"class":297,"line":379},[2082],{"type":40,"tag":295,"props":2083,"children":2084},{},[2085],{"type":45,"value":385},{"type":40,"tag":295,"props":2087,"children":2088},{"class":297,"line":388},[2089],{"type":40,"tag":295,"props":2090,"children":2091},{},[2092],{"type":45,"value":2093},"    return a + b\n",{"type":40,"tag":493,"props":2095,"children":2096},{},[2097],{"type":40,"tag":285,"props":2098,"children":2100},{"className":498,"code":2099,"language":493,"meta":289,"style":289},"import { tool } from \"@langchain\u002Fcore\u002Ftools\";\nimport { z } from \"zod\";\n\nconst add = tool(\n  async ({ a, b }) => a + b,\n  {\n    name: \"add\",\n    description: \"Add two numbers.\",\n    schema: z.object({\n      a: z.number().describe(\"First number\"),\n      b: z.number().describe(\"Second number\"),\n    }),\n  }\n);\n",[2101],{"type":40,"tag":64,"props":2102,"children":2103},{"__ignoreMap":289},[2104,2143,2182,2189,2213,2264,2271,2299,2327,2358,2420,2481,2497,2504],{"type":40,"tag":295,"props":2105,"children":2106},{"class":297,"line":298},[2107,2111,2115,2119,2123,2127,2131,2135,2139],{"type":40,"tag":295,"props":2108,"children":2109},{"style":509},[2110],{"type":45,"value":512},{"type":40,"tag":295,"props":2112,"children":2113},{"style":515},[2114],{"type":45,"value":518},{"type":40,"tag":295,"props":2116,"children":2117},{"style":521},[2118],{"type":45,"value":570},{"type":40,"tag":295,"props":2120,"children":2121},{"style":515},[2122],{"type":45,"value":529},{"type":40,"tag":295,"props":2124,"children":2125},{"style":509},[2126],{"type":45,"value":534},{"type":40,"tag":295,"props":2128,"children":2129},{"style":515},[2130],{"type":45,"value":539},{"type":40,"tag":295,"props":2132,"children":2133},{"style":542},[2134],{"type":45,"value":587},{"type":40,"tag":295,"props":2136,"children":2137},{"style":515},[2138],{"type":45,"value":549},{"type":40,"tag":295,"props":2140,"children":2141},{"style":515},[2142],{"type":45,"value":554},{"type":40,"tag":295,"props":2144,"children":2145},{"class":297,"line":307},[2146,2150,2154,2158,2162,2166,2170,2174,2178],{"type":40,"tag":295,"props":2147,"children":2148},{"style":509},[2149],{"type":45,"value":512},{"type":40,"tag":295,"props":2151,"children":2152},{"style":515},[2153],{"type":45,"value":518},{"type":40,"tag":295,"props":2155,"children":2156},{"style":521},[2157],{"type":45,"value":611},{"type":40,"tag":295,"props":2159,"children":2160},{"style":515},[2161],{"type":45,"value":529},{"type":40,"tag":295,"props":2163,"children":2164},{"style":509},[2165],{"type":45,"value":534},{"type":40,"tag":295,"props":2167,"children":2168},{"style":515},[2169],{"type":45,"value":539},{"type":40,"tag":295,"props":2171,"children":2172},{"style":542},[2173],{"type":45,"value":628},{"type":40,"tag":295,"props":2175,"children":2176},{"style":515},[2177],{"type":45,"value":549},{"type":40,"tag":295,"props":2179,"children":2180},{"style":515},[2181],{"type":45,"value":554},{"type":40,"tag":295,"props":2183,"children":2184},{"class":297,"line":316},[2185],{"type":40,"tag":295,"props":2186,"children":2187},{"emptyLinePlaceholder":320},[2188],{"type":45,"value":323},{"type":40,"tag":295,"props":2190,"children":2191},{"class":297,"line":326},[2192,2196,2201,2205,2209],{"type":40,"tag":295,"props":2193,"children":2194},{"style":649},[2195],{"type":45,"value":652},{"type":40,"tag":295,"props":2197,"children":2198},{"style":521},[2199],{"type":45,"value":2200}," add ",{"type":40,"tag":295,"props":2202,"children":2203},{"style":515},[2204],{"type":45,"value":662},{"type":40,"tag":295,"props":2206,"children":2207},{"style":665},[2208],{"type":45,"value":570},{"type":40,"tag":295,"props":2210,"children":2211},{"style":521},[2212],{"type":45,"value":672},{"type":40,"tag":295,"props":2214,"children":2215},{"class":297,"line":335},[2216,2220,2224,2229,2233,2238,2242,2246,2251,2256,2260],{"type":40,"tag":295,"props":2217,"children":2218},{"style":649},[2219],{"type":45,"value":680},{"type":40,"tag":295,"props":2221,"children":2222},{"style":515},[2223],{"type":45,"value":685},{"type":40,"tag":295,"props":2225,"children":2226},{"style":688},[2227],{"type":45,"value":2228}," a",{"type":40,"tag":295,"props":2230,"children":2231},{"style":515},[2232],{"type":45,"value":1162},{"type":40,"tag":295,"props":2234,"children":2235},{"style":688},[2236],{"type":45,"value":2237}," b",{"type":40,"tag":295,"props":2239,"children":2240},{"style":515},[2241],{"type":45,"value":696},{"type":40,"tag":295,"props":2243,"children":2244},{"style":649},[2245],{"type":45,"value":701},{"type":40,"tag":295,"props":2247,"children":2248},{"style":521},[2249],{"type":45,"value":2250}," a ",{"type":40,"tag":295,"props":2252,"children":2253},{"style":515},[2254],{"type":45,"value":2255},"+",{"type":40,"tag":295,"props":2257,"children":2258},{"style":521},[2259],{"type":45,"value":2237},{"type":40,"tag":295,"props":2261,"children":2262},{"style":515},[2263],{"type":45,"value":741},{"type":40,"tag":295,"props":2265,"children":2266},{"class":297,"line":344},[2267],{"type":40,"tag":295,"props":2268,"children":2269},{"style":515},[2270],{"type":45,"value":749},{"type":40,"tag":295,"props":2272,"children":2273},{"class":297,"line":353},[2274,2278,2282,2286,2291,2295],{"type":40,"tag":295,"props":2275,"children":2276},{"style":755},[2277],{"type":45,"value":758},{"type":40,"tag":295,"props":2279,"children":2280},{"style":515},[2281],{"type":45,"value":763},{"type":40,"tag":295,"props":2283,"children":2284},{"style":515},[2285],{"type":45,"value":539},{"type":40,"tag":295,"props":2287,"children":2288},{"style":542},[2289],{"type":45,"value":2290},"add",{"type":40,"tag":295,"props":2292,"children":2293},{"style":515},[2294],{"type":45,"value":549},{"type":40,"tag":295,"props":2296,"children":2297},{"style":515},[2298],{"type":45,"value":741},{"type":40,"tag":295,"props":2300,"children":2301},{"class":297,"line":361},[2302,2306,2310,2314,2319,2323],{"type":40,"tag":295,"props":2303,"children":2304},{"style":755},[2305],{"type":45,"value":788},{"type":40,"tag":295,"props":2307,"children":2308},{"style":515},[2309],{"type":45,"value":763},{"type":40,"tag":295,"props":2311,"children":2312},{"style":515},[2313],{"type":45,"value":539},{"type":40,"tag":295,"props":2315,"children":2316},{"style":542},[2317],{"type":45,"value":2318},"Add two numbers.",{"type":40,"tag":295,"props":2320,"children":2321},{"style":515},[2322],{"type":45,"value":549},{"type":40,"tag":295,"props":2324,"children":2325},{"style":515},[2326],{"type":45,"value":741},{"type":40,"tag":295,"props":2328,"children":2329},{"class":297,"line":370},[2330,2334,2338,2342,2346,2350,2354],{"type":40,"tag":295,"props":2331,"children":2332},{"style":755},[2333],{"type":45,"value":817},{"type":40,"tag":295,"props":2335,"children":2336},{"style":515},[2337],{"type":45,"value":763},{"type":40,"tag":295,"props":2339,"children":2340},{"style":521},[2341],{"type":45,"value":611},{"type":40,"tag":295,"props":2343,"children":2344},{"style":515},[2345],{"type":45,"value":830},{"type":40,"tag":295,"props":2347,"children":2348},{"style":665},[2349],{"type":45,"value":835},{"type":40,"tag":295,"props":2351,"children":2352},{"style":521},[2353],{"type":45,"value":840},{"type":40,"tag":295,"props":2355,"children":2356},{"style":515},[2357],{"type":45,"value":970},{"type":40,"tag":295,"props":2359,"children":2360},{"class":297,"line":379},[2361,2366,2370,2374,2378,2383,2387,2391,2395,2399,2403,2408,2412,2416],{"type":40,"tag":295,"props":2362,"children":2363},{"style":755},[2364],{"type":45,"value":2365},"      a",{"type":40,"tag":295,"props":2367,"children":2368},{"style":515},[2369],{"type":45,"value":763},{"type":40,"tag":295,"props":2371,"children":2372},{"style":521},[2373],{"type":45,"value":611},{"type":40,"tag":295,"props":2375,"children":2376},{"style":515},[2377],{"type":45,"value":830},{"type":40,"tag":295,"props":2379,"children":2380},{"style":665},[2381],{"type":45,"value":2382},"number",{"type":40,"tag":295,"props":2384,"children":2385},{"style":521},[2386],{"type":45,"value":871},{"type":40,"tag":295,"props":2388,"children":2389},{"style":515},[2390],{"type":45,"value":830},{"type":40,"tag":295,"props":2392,"children":2393},{"style":665},[2394],{"type":45,"value":880},{"type":40,"tag":295,"props":2396,"children":2397},{"style":521},[2398],{"type":45,"value":840},{"type":40,"tag":295,"props":2400,"children":2401},{"style":515},[2402],{"type":45,"value":549},{"type":40,"tag":295,"props":2404,"children":2405},{"style":542},[2406],{"type":45,"value":2407},"First number",{"type":40,"tag":295,"props":2409,"children":2410},{"style":515},[2411],{"type":45,"value":549},{"type":40,"tag":295,"props":2413,"children":2414},{"style":521},[2415],{"type":45,"value":911},{"type":40,"tag":295,"props":2417,"children":2418},{"style":515},[2419],{"type":45,"value":741},{"type":40,"tag":295,"props":2421,"children":2422},{"class":297,"line":388},[2423,2428,2432,2436,2440,2444,2448,2452,2456,2460,2464,2469,2473,2477],{"type":40,"tag":295,"props":2424,"children":2425},{"style":755},[2426],{"type":45,"value":2427},"      b",{"type":40,"tag":295,"props":2429,"children":2430},{"style":515},[2431],{"type":45,"value":763},{"type":40,"tag":295,"props":2433,"children":2434},{"style":521},[2435],{"type":45,"value":611},{"type":40,"tag":295,"props":2437,"children":2438},{"style":515},[2439],{"type":45,"value":830},{"type":40,"tag":295,"props":2441,"children":2442},{"style":665},[2443],{"type":45,"value":2382},{"type":40,"tag":295,"props":2445,"children":2446},{"style":521},[2447],{"type":45,"value":871},{"type":40,"tag":295,"props":2449,"children":2450},{"style":515},[2451],{"type":45,"value":830},{"type":40,"tag":295,"props":2453,"children":2454},{"style":665},[2455],{"type":45,"value":880},{"type":40,"tag":295,"props":2457,"children":2458},{"style":521},[2459],{"type":45,"value":840},{"type":40,"tag":295,"props":2461,"children":2462},{"style":515},[2463],{"type":45,"value":549},{"type":40,"tag":295,"props":2465,"children":2466},{"style":542},[2467],{"type":45,"value":2468},"Second number",{"type":40,"tag":295,"props":2470,"children":2471},{"style":515},[2472],{"type":45,"value":549},{"type":40,"tag":295,"props":2474,"children":2475},{"style":521},[2476],{"type":45,"value":911},{"type":40,"tag":295,"props":2478,"children":2479},{"style":515},[2480],{"type":45,"value":741},{"type":40,"tag":295,"props":2482,"children":2483},{"class":297,"line":397},[2484,2489,2493],{"type":40,"tag":295,"props":2485,"children":2486},{"style":515},[2487],{"type":45,"value":2488},"    }",{"type":40,"tag":295,"props":2490,"children":2491},{"style":521},[2492],{"type":45,"value":911},{"type":40,"tag":295,"props":2494,"children":2495},{"style":515},[2496],{"type":45,"value":741},{"type":40,"tag":295,"props":2498,"children":2499},{"class":297,"line":405},[2500],{"type":40,"tag":295,"props":2501,"children":2502},{"style":515},[2503],{"type":45,"value":923},{"type":40,"tag":295,"props":2505,"children":2506},{"class":297,"line":414},[2507,2511],{"type":40,"tag":295,"props":2508,"children":2509},{"style":521},[2510],{"type":45,"value":911},{"type":40,"tag":295,"props":2512,"children":2513},{"style":515},[2514],{"type":45,"value":554},{"type":40,"tag":237,"props":2516,"children":2517},{},[2518,2520,2555,2560,2574,2630,2635,2710,2715,2721,2741,2899,3370,3375,3381,3407,3430,3435,4070,5000,5345],{"type":45,"value":2519},"\n## Middleware for Agent Control\n",{"type":40,"tag":48,"props":2521,"children":2522},{},[2523,2525,2531,2532,2538,2540,2546,2547,2553],{"type":45,"value":2524},"Middleware intercepts the agent loop to add human approval, error handling, logging, and more. A deep understanding of middleware is essential for production agents — use ",{"type":40,"tag":64,"props":2526,"children":2528},{"className":2527},[],[2529],{"type":45,"value":2530},"HumanInTheLoopMiddleware",{"type":45,"value":253},{"type":40,"tag":64,"props":2533,"children":2535},{"className":2534},[],[2536],{"type":45,"value":2537},"humanInTheLoopMiddleware",{"type":45,"value":2539}," (TypeScript) for approval workflows, and ",{"type":40,"tag":64,"props":2541,"children":2543},{"className":2542},[],[2544],{"type":45,"value":2545},"@wrap_tool_call",{"type":45,"value":253},{"type":40,"tag":64,"props":2548,"children":2550},{"className":2549},[],[2551],{"type":45,"value":2552},"createMiddleware",{"type":45,"value":2554}," (TypeScript) for custom hooks.",{"type":40,"tag":48,"props":2556,"children":2557},{},[2558],{"type":45,"value":2559},"Key imports:",{"type":40,"tag":285,"props":2561,"children":2563},{"className":287,"code":2562,"language":281,"meta":289,"style":289},"from langchain.agents.middleware import HumanInTheLoopMiddleware, wrap_tool_call\n",[2564],{"type":40,"tag":64,"props":2565,"children":2566},{"__ignoreMap":289},[2567],{"type":40,"tag":295,"props":2568,"children":2569},{"class":297,"line":298},[2570],{"type":40,"tag":295,"props":2571,"children":2572},{},[2573],{"type":45,"value":2562},{"type":40,"tag":285,"props":2575,"children":2577},{"className":498,"code":2576,"language":493,"meta":289,"style":289},"import { humanInTheLoopMiddleware, createMiddleware } from \"langchain\";\n",[2578],{"type":40,"tag":64,"props":2579,"children":2580},{"__ignoreMap":289},[2581],{"type":40,"tag":295,"props":2582,"children":2583},{"class":297,"line":298},[2584,2588,2592,2597,2601,2606,2610,2614,2618,2622,2626],{"type":40,"tag":295,"props":2585,"children":2586},{"style":509},[2587],{"type":45,"value":512},{"type":40,"tag":295,"props":2589,"children":2590},{"style":515},[2591],{"type":45,"value":518},{"type":40,"tag":295,"props":2593,"children":2594},{"style":521},[2595],{"type":45,"value":2596}," humanInTheLoopMiddleware",{"type":40,"tag":295,"props":2598,"children":2599},{"style":515},[2600],{"type":45,"value":1162},{"type":40,"tag":295,"props":2602,"children":2603},{"style":521},[2604],{"type":45,"value":2605}," createMiddleware",{"type":40,"tag":295,"props":2607,"children":2608},{"style":515},[2609],{"type":45,"value":529},{"type":40,"tag":295,"props":2611,"children":2612},{"style":509},[2613],{"type":45,"value":534},{"type":40,"tag":295,"props":2615,"children":2616},{"style":515},[2617],{"type":45,"value":539},{"type":40,"tag":295,"props":2619,"children":2620},{"style":542},[2621],{"type":45,"value":8},{"type":40,"tag":295,"props":2623,"children":2624},{"style":515},[2625],{"type":45,"value":549},{"type":40,"tag":295,"props":2627,"children":2628},{"style":515},[2629],{"type":45,"value":554},{"type":40,"tag":48,"props":2631,"children":2632},{},[2633],{"type":45,"value":2634},"Key patterns:",{"type":40,"tag":2636,"props":2637,"children":2638},"ul",{},[2639,2672,2687],{"type":40,"tag":2640,"props":2641,"children":2642},"li",{},[2643,2649,2651,2657,2659,2664,2666],{"type":40,"tag":2644,"props":2645,"children":2646},"strong",{},[2647],{"type":45,"value":2648},"HITL",{"type":45,"value":2650},": ",{"type":40,"tag":64,"props":2652,"children":2654},{"className":2653},[],[2655],{"type":45,"value":2656},"middleware=[HumanInTheLoopMiddleware(interrupt_on={\"dangerous_tool\": True})]",{"type":45,"value":2658}," — requires ",{"type":40,"tag":64,"props":2660,"children":2662},{"className":2661},[],[2663],{"type":45,"value":211},{"type":45,"value":2665}," + ",{"type":40,"tag":64,"props":2667,"children":2669},{"className":2668},[],[2670],{"type":45,"value":2671},"thread_id",{"type":40,"tag":2640,"props":2673,"children":2674},{},[2675,2680,2681],{"type":40,"tag":2644,"props":2676,"children":2677},{},[2678],{"type":45,"value":2679},"Resume after interrupt",{"type":45,"value":2650},{"type":40,"tag":64,"props":2682,"children":2684},{"className":2683},[],[2685],{"type":45,"value":2686},"agent.invoke(Command(resume={\"decisions\": [{\"type\": \"approve\"}]}), config=config)",{"type":40,"tag":2640,"props":2688,"children":2689},{},[2690,2695,2696,2701,2702,2708],{"type":40,"tag":2644,"props":2691,"children":2692},{},[2693],{"type":45,"value":2694},"Custom middleware",{"type":45,"value":2650},{"type":40,"tag":64,"props":2697,"children":2699},{"className":2698},[],[2700],{"type":45,"value":2545},{"type":45,"value":1989},{"type":40,"tag":64,"props":2703,"children":2705},{"className":2704},[],[2706],{"type":45,"value":2707},"createMiddleware({ wrapToolCall: ... })",{"type":45,"value":2709}," (TypeScript)\n\n",{"type":40,"tag":48,"props":2711,"children":2712},{},[2713],{"type":45,"value":2714},"\u003Cstructured_output>",{"type":40,"tag":54,"props":2716,"children":2718},{"id":2717},"structured-output",[2719],{"type":45,"value":2720},"Structured Output",{"type":40,"tag":48,"props":2722,"children":2723},{},[2724,2726,2732,2734,2740],{"type":45,"value":2725},"Get typed, validated responses from agents using ",{"type":40,"tag":64,"props":2727,"children":2729},{"className":2728},[],[2730],{"type":45,"value":2731},"response_format",{"type":45,"value":2733}," or ",{"type":40,"tag":64,"props":2735,"children":2737},{"className":2736},[],[2738],{"type":45,"value":2739},"with_structured_output()",{"type":45,"value":830},{"type":40,"tag":281,"props":2742,"children":2743},{},[2744],{"type":40,"tag":285,"props":2745,"children":2747},{"className":287,"code":2746,"language":281,"meta":289,"style":289},"from langchain.agents import create_agent\nfrom pydantic import BaseModel, Field\n\nclass ContactInfo(BaseModel):\n    name: str\n    email: str\n    phone: str = Field(description=\"Phone number with area code\")\n\n# Option 1: Agent with structured output\nagent = create_agent(model=\"gpt-4.1\", tools=[search], response_format=ContactInfo)\nresult = agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"Find contact for John\"}]})\nprint(result[\"structured_response\"])  # ContactInfo(name='John', ...)\n\n# Option 2: Model-level structured output (no agent needed)\nfrom langchain_openai import ChatOpenAI\nmodel = ChatOpenAI(model=\"gpt-4.1\")\nstructured_model = model.with_structured_output(ContactInfo)\nresponse = structured_model.invoke(\"Extract: John, john@example.com, 555-1234\")\n# ContactInfo(name='John', email='john@example.com', phone='555-1234')\n",[2748],{"type":40,"tag":64,"props":2749,"children":2750},{"__ignoreMap":289},[2751,2758,2766,2773,2781,2789,2797,2805,2812,2820,2828,2836,2844,2851,2859,2867,2875,2883,2891],{"type":40,"tag":295,"props":2752,"children":2753},{"class":297,"line":298},[2754],{"type":40,"tag":295,"props":2755,"children":2756},{},[2757],{"type":45,"value":304},{"type":40,"tag":295,"props":2759,"children":2760},{"class":297,"line":307},[2761],{"type":40,"tag":295,"props":2762,"children":2763},{},[2764],{"type":45,"value":2765},"from pydantic import BaseModel, Field\n",{"type":40,"tag":295,"props":2767,"children":2768},{"class":297,"line":316},[2769],{"type":40,"tag":295,"props":2770,"children":2771},{"emptyLinePlaceholder":320},[2772],{"type":45,"value":323},{"type":40,"tag":295,"props":2774,"children":2775},{"class":297,"line":326},[2776],{"type":40,"tag":295,"props":2777,"children":2778},{},[2779],{"type":45,"value":2780},"class ContactInfo(BaseModel):\n",{"type":40,"tag":295,"props":2782,"children":2783},{"class":297,"line":335},[2784],{"type":40,"tag":295,"props":2785,"children":2786},{},[2787],{"type":45,"value":2788},"    name: str\n",{"type":40,"tag":295,"props":2790,"children":2791},{"class":297,"line":344},[2792],{"type":40,"tag":295,"props":2793,"children":2794},{},[2795],{"type":45,"value":2796},"    email: str\n",{"type":40,"tag":295,"props":2798,"children":2799},{"class":297,"line":353},[2800],{"type":40,"tag":295,"props":2801,"children":2802},{},[2803],{"type":45,"value":2804},"    phone: str = Field(description=\"Phone number with area code\")\n",{"type":40,"tag":295,"props":2806,"children":2807},{"class":297,"line":361},[2808],{"type":40,"tag":295,"props":2809,"children":2810},{"emptyLinePlaceholder":320},[2811],{"type":45,"value":323},{"type":40,"tag":295,"props":2813,"children":2814},{"class":297,"line":370},[2815],{"type":40,"tag":295,"props":2816,"children":2817},{},[2818],{"type":45,"value":2819},"# Option 1: Agent with structured output\n",{"type":40,"tag":295,"props":2821,"children":2822},{"class":297,"line":379},[2823],{"type":40,"tag":295,"props":2824,"children":2825},{},[2826],{"type":45,"value":2827},"agent = create_agent(model=\"gpt-4.1\", tools=[search], response_format=ContactInfo)\n",{"type":40,"tag":295,"props":2829,"children":2830},{"class":297,"line":388},[2831],{"type":40,"tag":295,"props":2832,"children":2833},{},[2834],{"type":45,"value":2835},"result = agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"Find contact for John\"}]})\n",{"type":40,"tag":295,"props":2837,"children":2838},{"class":297,"line":397},[2839],{"type":40,"tag":295,"props":2840,"children":2841},{},[2842],{"type":45,"value":2843},"print(result[\"structured_response\"])  # ContactInfo(name='John', ...)\n",{"type":40,"tag":295,"props":2845,"children":2846},{"class":297,"line":405},[2847],{"type":40,"tag":295,"props":2848,"children":2849},{"emptyLinePlaceholder":320},[2850],{"type":45,"value":323},{"type":40,"tag":295,"props":2852,"children":2853},{"class":297,"line":414},[2854],{"type":40,"tag":295,"props":2855,"children":2856},{},[2857],{"type":45,"value":2858},"# Option 2: Model-level structured output (no agent needed)\n",{"type":40,"tag":295,"props":2860,"children":2861},{"class":297,"line":423},[2862],{"type":40,"tag":295,"props":2863,"children":2864},{},[2865],{"type":45,"value":2866},"from langchain_openai import ChatOpenAI\n",{"type":40,"tag":295,"props":2868,"children":2869},{"class":297,"line":432},[2870],{"type":40,"tag":295,"props":2871,"children":2872},{},[2873],{"type":45,"value":2874},"model = ChatOpenAI(model=\"gpt-4.1\")\n",{"type":40,"tag":295,"props":2876,"children":2877},{"class":297,"line":441},[2878],{"type":40,"tag":295,"props":2879,"children":2880},{},[2881],{"type":45,"value":2882},"structured_model = model.with_structured_output(ContactInfo)\n",{"type":40,"tag":295,"props":2884,"children":2885},{"class":297,"line":450},[2886],{"type":40,"tag":295,"props":2887,"children":2888},{},[2889],{"type":45,"value":2890},"response = structured_model.invoke(\"Extract: John, john@example.com, 555-1234\")\n",{"type":40,"tag":295,"props":2892,"children":2893},{"class":297,"line":458},[2894],{"type":40,"tag":295,"props":2895,"children":2896},{},[2897],{"type":45,"value":2898},"# ContactInfo(name='John', email='john@example.com', phone='555-1234')\n",{"type":40,"tag":493,"props":2900,"children":2901},{},[2902],{"type":40,"tag":285,"props":2903,"children":2905},{"className":498,"code":2904,"language":493,"meta":289,"style":289},"import { ChatOpenAI } from \"@langchain\u002Fopenai\";\nimport { z } from \"zod\";\n\nconst ContactInfo = z.object({\n  name: z.string(),\n  email: z.string().email(),\n  phone: z.string().describe(\"Phone number with area code\"),\n});\n\n\u002F\u002F Model-level structured output\nconst model = new ChatOpenAI({ model: \"gpt-4.1\" });\nconst structuredModel = model.withStructuredOutput(ContactInfo);\nconst response = await structuredModel.invoke(\"Extract: John, john@example.com, 555-1234\");\n\u002F\u002F { name: 'John', email: 'john@example.com', phone: '555-1234' }\n",[2906],{"type":40,"tag":64,"props":2907,"children":2908},{"__ignoreMap":289},[2909,2950,2989,2996,3032,3064,3109,3170,3185,3192,3200,3266,3304,3362],{"type":40,"tag":295,"props":2910,"children":2911},{"class":297,"line":298},[2912,2916,2920,2925,2929,2933,2937,2942,2946],{"type":40,"tag":295,"props":2913,"children":2914},{"style":509},[2915],{"type":45,"value":512},{"type":40,"tag":295,"props":2917,"children":2918},{"style":515},[2919],{"type":45,"value":518},{"type":40,"tag":295,"props":2921,"children":2922},{"style":521},[2923],{"type":45,"value":2924}," ChatOpenAI",{"type":40,"tag":295,"props":2926,"children":2927},{"style":515},[2928],{"type":45,"value":529},{"type":40,"tag":295,"props":2930,"children":2931},{"style":509},[2932],{"type":45,"value":534},{"type":40,"tag":295,"props":2934,"children":2935},{"style":515},[2936],{"type":45,"value":539},{"type":40,"tag":295,"props":2938,"children":2939},{"style":542},[2940],{"type":45,"value":2941},"@langchain\u002Fopenai",{"type":40,"tag":295,"props":2943,"children":2944},{"style":515},[2945],{"type":45,"value":549},{"type":40,"tag":295,"props":2947,"children":2948},{"style":515},[2949],{"type":45,"value":554},{"type":40,"tag":295,"props":2951,"children":2952},{"class":297,"line":307},[2953,2957,2961,2965,2969,2973,2977,2981,2985],{"type":40,"tag":295,"props":2954,"children":2955},{"style":509},[2956],{"type":45,"value":512},{"type":40,"tag":295,"props":2958,"children":2959},{"style":515},[2960],{"type":45,"value":518},{"type":40,"tag":295,"props":2962,"children":2963},{"style":521},[2964],{"type":45,"value":611},{"type":40,"tag":295,"props":2966,"children":2967},{"style":515},[2968],{"type":45,"value":529},{"type":40,"tag":295,"props":2970,"children":2971},{"style":509},[2972],{"type":45,"value":534},{"type":40,"tag":295,"props":2974,"children":2975},{"style":515},[2976],{"type":45,"value":539},{"type":40,"tag":295,"props":2978,"children":2979},{"style":542},[2980],{"type":45,"value":628},{"type":40,"tag":295,"props":2982,"children":2983},{"style":515},[2984],{"type":45,"value":549},{"type":40,"tag":295,"props":2986,"children":2987},{"style":515},[2988],{"type":45,"value":554},{"type":40,"tag":295,"props":2990,"children":2991},{"class":297,"line":316},[2992],{"type":40,"tag":295,"props":2993,"children":2994},{"emptyLinePlaceholder":320},[2995],{"type":45,"value":323},{"type":40,"tag":295,"props":2997,"children":2998},{"class":297,"line":326},[2999,3003,3008,3012,3016,3020,3024,3028],{"type":40,"tag":295,"props":3000,"children":3001},{"style":649},[3002],{"type":45,"value":652},{"type":40,"tag":295,"props":3004,"children":3005},{"style":521},[3006],{"type":45,"value":3007}," ContactInfo ",{"type":40,"tag":295,"props":3009,"children":3010},{"style":515},[3011],{"type":45,"value":662},{"type":40,"tag":295,"props":3013,"children":3014},{"style":521},[3015],{"type":45,"value":611},{"type":40,"tag":295,"props":3017,"children":3018},{"style":515},[3019],{"type":45,"value":830},{"type":40,"tag":295,"props":3021,"children":3022},{"style":665},[3023],{"type":45,"value":835},{"type":40,"tag":295,"props":3025,"children":3026},{"style":521},[3027],{"type":45,"value":840},{"type":40,"tag":295,"props":3029,"children":3030},{"style":515},[3031],{"type":45,"value":970},{"type":40,"tag":295,"props":3033,"children":3034},{"class":297,"line":335},[3035,3040,3044,3048,3052,3056,3060],{"type":40,"tag":295,"props":3036,"children":3037},{"style":755},[3038],{"type":45,"value":3039},"  name",{"type":40,"tag":295,"props":3041,"children":3042},{"style":515},[3043],{"type":45,"value":763},{"type":40,"tag":295,"props":3045,"children":3046},{"style":521},[3047],{"type":45,"value":611},{"type":40,"tag":295,"props":3049,"children":3050},{"style":515},[3051],{"type":45,"value":830},{"type":40,"tag":295,"props":3053,"children":3054},{"style":665},[3055],{"type":45,"value":866},{"type":40,"tag":295,"props":3057,"children":3058},{"style":521},[3059],{"type":45,"value":871},{"type":40,"tag":295,"props":3061,"children":3062},{"style":515},[3063],{"type":45,"value":741},{"type":40,"tag":295,"props":3065,"children":3066},{"class":297,"line":344},[3067,3072,3076,3080,3084,3088,3092,3096,3101,3105],{"type":40,"tag":295,"props":3068,"children":3069},{"style":755},[3070],{"type":45,"value":3071},"  email",{"type":40,"tag":295,"props":3073,"children":3074},{"style":515},[3075],{"type":45,"value":763},{"type":40,"tag":295,"props":3077,"children":3078},{"style":521},[3079],{"type":45,"value":611},{"type":40,"tag":295,"props":3081,"children":3082},{"style":515},[3083],{"type":45,"value":830},{"type":40,"tag":295,"props":3085,"children":3086},{"style":665},[3087],{"type":45,"value":866},{"type":40,"tag":295,"props":3089,"children":3090},{"style":521},[3091],{"type":45,"value":871},{"type":40,"tag":295,"props":3093,"children":3094},{"style":515},[3095],{"type":45,"value":830},{"type":40,"tag":295,"props":3097,"children":3098},{"style":665},[3099],{"type":45,"value":3100},"email",{"type":40,"tag":295,"props":3102,"children":3103},{"style":521},[3104],{"type":45,"value":871},{"type":40,"tag":295,"props":3106,"children":3107},{"style":515},[3108],{"type":45,"value":741},{"type":40,"tag":295,"props":3110,"children":3111},{"class":297,"line":353},[3112,3117,3121,3125,3129,3133,3137,3141,3145,3149,3153,3158,3162,3166],{"type":40,"tag":295,"props":3113,"children":3114},{"style":755},[3115],{"type":45,"value":3116},"  phone",{"type":40,"tag":295,"props":3118,"children":3119},{"style":515},[3120],{"type":45,"value":763},{"type":40,"tag":295,"props":3122,"children":3123},{"style":521},[3124],{"type":45,"value":611},{"type":40,"tag":295,"props":3126,"children":3127},{"style":515},[3128],{"type":45,"value":830},{"type":40,"tag":295,"props":3130,"children":3131},{"style":665},[3132],{"type":45,"value":866},{"type":40,"tag":295,"props":3134,"children":3135},{"style":521},[3136],{"type":45,"value":871},{"type":40,"tag":295,"props":3138,"children":3139},{"style":515},[3140],{"type":45,"value":830},{"type":40,"tag":295,"props":3142,"children":3143},{"style":665},[3144],{"type":45,"value":880},{"type":40,"tag":295,"props":3146,"children":3147},{"style":521},[3148],{"type":45,"value":840},{"type":40,"tag":295,"props":3150,"children":3151},{"style":515},[3152],{"type":45,"value":549},{"type":40,"tag":295,"props":3154,"children":3155},{"style":542},[3156],{"type":45,"value":3157},"Phone number with area code",{"type":40,"tag":295,"props":3159,"children":3160},{"style":515},[3161],{"type":45,"value":549},{"type":40,"tag":295,"props":3163,"children":3164},{"style":521},[3165],{"type":45,"value":911},{"type":40,"tag":295,"props":3167,"children":3168},{"style":515},[3169],{"type":45,"value":741},{"type":40,"tag":295,"props":3171,"children":3172},{"class":297,"line":361},[3173,3177,3181],{"type":40,"tag":295,"props":3174,"children":3175},{"style":515},[3176],{"type":45,"value":726},{"type":40,"tag":295,"props":3178,"children":3179},{"style":521},[3180],{"type":45,"value":911},{"type":40,"tag":295,"props":3182,"children":3183},{"style":515},[3184],{"type":45,"value":554},{"type":40,"tag":295,"props":3186,"children":3187},{"class":297,"line":370},[3188],{"type":40,"tag":295,"props":3189,"children":3190},{"emptyLinePlaceholder":320},[3191],{"type":45,"value":323},{"type":40,"tag":295,"props":3193,"children":3194},{"class":297,"line":379},[3195],{"type":40,"tag":295,"props":3196,"children":3197},{"style":1968},[3198],{"type":45,"value":3199},"\u002F\u002F Model-level structured output\n",{"type":40,"tag":295,"props":3201,"children":3202},{"class":297,"line":388},[3203,3207,3212,3216,3220,3224,3228,3232,3237,3241,3245,3250,3254,3258,3262],{"type":40,"tag":295,"props":3204,"children":3205},{"style":649},[3206],{"type":45,"value":652},{"type":40,"tag":295,"props":3208,"children":3209},{"style":521},[3210],{"type":45,"value":3211}," model ",{"type":40,"tag":295,"props":3213,"children":3214},{"style":515},[3215],{"type":45,"value":662},{"type":40,"tag":295,"props":3217,"children":3218},{"style":515},[3219],{"type":45,"value":1538},{"type":40,"tag":295,"props":3221,"children":3222},{"style":665},[3223],{"type":45,"value":2924},{"type":40,"tag":295,"props":3225,"children":3226},{"style":521},[3227],{"type":45,"value":840},{"type":40,"tag":295,"props":3229,"children":3230},{"style":515},[3231],{"type":45,"value":845},{"type":40,"tag":295,"props":3233,"children":3234},{"style":755},[3235],{"type":45,"value":3236}," model",{"type":40,"tag":295,"props":3238,"children":3239},{"style":515},[3240],{"type":45,"value":763},{"type":40,"tag":295,"props":3242,"children":3243},{"style":515},[3244],{"type":45,"value":539},{"type":40,"tag":295,"props":3246,"children":3247},{"style":542},[3248],{"type":45,"value":3249},"gpt-4.1",{"type":40,"tag":295,"props":3251,"children":3252},{"style":515},[3253],{"type":45,"value":549},{"type":40,"tag":295,"props":3255,"children":3256},{"style":515},[3257],{"type":45,"value":529},{"type":40,"tag":295,"props":3259,"children":3260},{"style":521},[3261],{"type":45,"value":911},{"type":40,"tag":295,"props":3263,"children":3264},{"style":515},[3265],{"type":45,"value":554},{"type":40,"tag":295,"props":3267,"children":3268},{"class":297,"line":397},[3269,3273,3278,3282,3286,3290,3295,3300],{"type":40,"tag":295,"props":3270,"children":3271},{"style":649},[3272],{"type":45,"value":652},{"type":40,"tag":295,"props":3274,"children":3275},{"style":521},[3276],{"type":45,"value":3277}," structuredModel ",{"type":40,"tag":295,"props":3279,"children":3280},{"style":515},[3281],{"type":45,"value":662},{"type":40,"tag":295,"props":3283,"children":3284},{"style":521},[3285],{"type":45,"value":3236},{"type":40,"tag":295,"props":3287,"children":3288},{"style":515},[3289],{"type":45,"value":830},{"type":40,"tag":295,"props":3291,"children":3292},{"style":665},[3293],{"type":45,"value":3294},"withStructuredOutput",{"type":40,"tag":295,"props":3296,"children":3297},{"style":521},[3298],{"type":45,"value":3299},"(ContactInfo)",{"type":40,"tag":295,"props":3301,"children":3302},{"style":515},[3303],{"type":45,"value":554},{"type":40,"tag":295,"props":3305,"children":3306},{"class":297,"line":405},[3307,3311,3316,3320,3324,3329,3333,3337,3341,3345,3350,3354,3358],{"type":40,"tag":295,"props":3308,"children":3309},{"style":649},[3310],{"type":45,"value":652},{"type":40,"tag":295,"props":3312,"children":3313},{"style":521},[3314],{"type":45,"value":3315}," response ",{"type":40,"tag":295,"props":3317,"children":3318},{"style":515},[3319],{"type":45,"value":662},{"type":40,"tag":295,"props":3321,"children":3322},{"style":509},[3323],{"type":45,"value":1092},{"type":40,"tag":295,"props":3325,"children":3326},{"style":521},[3327],{"type":45,"value":3328}," structuredModel",{"type":40,"tag":295,"props":3330,"children":3331},{"style":515},[3332],{"type":45,"value":830},{"type":40,"tag":295,"props":3334,"children":3335},{"style":665},[3336],{"type":45,"value":1106},{"type":40,"tag":295,"props":3338,"children":3339},{"style":521},[3340],{"type":45,"value":840},{"type":40,"tag":295,"props":3342,"children":3343},{"style":515},[3344],{"type":45,"value":549},{"type":40,"tag":295,"props":3346,"children":3347},{"style":542},[3348],{"type":45,"value":3349},"Extract: John, john@example.com, 555-1234",{"type":40,"tag":295,"props":3351,"children":3352},{"style":515},[3353],{"type":45,"value":549},{"type":40,"tag":295,"props":3355,"children":3356},{"style":521},[3357],{"type":45,"value":911},{"type":40,"tag":295,"props":3359,"children":3360},{"style":515},[3361],{"type":45,"value":554},{"type":40,"tag":295,"props":3363,"children":3364},{"class":297,"line":414},[3365],{"type":40,"tag":295,"props":3366,"children":3367},{"style":1968},[3368],{"type":45,"value":3369},"\u002F\u002F { name: 'John', email: 'john@example.com', phone: '555-1234' }\n",{"type":40,"tag":48,"props":3371,"children":3372},{},[3373],{"type":45,"value":3374},"\u003Cmodel_config>",{"type":40,"tag":54,"props":3376,"children":3378},{"id":3377},"model-configuration",[3379],{"type":45,"value":3380},"Model Configuration",{"type":40,"tag":48,"props":3382,"children":3383},{},[3384,3390,3392,3397,3399,3405],{"type":40,"tag":64,"props":3385,"children":3387},{"className":3386},[],[3388],{"type":45,"value":3389},"create_agent",{"type":45,"value":3391}," accepts model strings (",{"type":40,"tag":64,"props":3393,"children":3395},{"className":3394},[],[3396],{"type":45,"value":137},{"type":45,"value":3398},", ",{"type":40,"tag":64,"props":3400,"children":3402},{"className":3401},[],[3403],{"type":45,"value":3404},"\"openai:gpt-4.1\"",{"type":45,"value":3406},") or model instances for custom settings:",{"type":40,"tag":285,"props":3408,"children":3410},{"className":287,"code":3409,"language":281,"meta":289,"style":289},"from langchain_anthropic import ChatAnthropic\nagent = create_agent(model=ChatAnthropic(model=\"claude-sonnet-4-5\", temperature=0), tools=[...])\n",[3411],{"type":40,"tag":64,"props":3412,"children":3413},{"__ignoreMap":289},[3414,3422],{"type":40,"tag":295,"props":3415,"children":3416},{"class":297,"line":298},[3417],{"type":40,"tag":295,"props":3418,"children":3419},{},[3420],{"type":45,"value":3421},"from langchain_anthropic import ChatAnthropic\n",{"type":40,"tag":295,"props":3423,"children":3424},{"class":297,"line":307},[3425],{"type":40,"tag":295,"props":3426,"children":3427},{},[3428],{"type":45,"value":3429},"agent = create_agent(model=ChatAnthropic(model=\"claude-sonnet-4-5\", temperature=0), tools=[...])\n",{"type":40,"tag":48,"props":3431,"children":3432},{},[3433],{"type":45,"value":3434},"\u003C\u002Fmodel_config>",{"type":40,"tag":3436,"props":3437,"children":3438},"fix-missing-tool-description",{},[3439,3580],{"type":40,"tag":281,"props":3440,"children":3441},{},[3442,3444],{"type":45,"value":3443},"\nClear descriptions help the agent know when to use each tool.\n",{"type":40,"tag":285,"props":3445,"children":3447},{"className":287,"code":3446,"language":281,"meta":289,"style":289},"# WRONG: Vague or missing description\n@tool\ndef bad_tool(input: str) -> str:\n    \"\"\"Does stuff.\"\"\"\n    return \"result\"\n\n# CORRECT: Clear, specific description with Args\n@tool\ndef search(query: str) -> str:\n    \"\"\"Search the web for current information about a topic.\n\n    Use this when you need recent data or facts.\n\n    Args:\n        query: The search query (2-10 words recommended)\n    \"\"\"\n    return web_search(query)\n",[3448],{"type":40,"tag":64,"props":3449,"children":3450},{"__ignoreMap":289},[3451,3459,3466,3474,3482,3490,3497,3505,3512,3520,3528,3535,3543,3550,3557,3565,3572],{"type":40,"tag":295,"props":3452,"children":3453},{"class":297,"line":298},[3454],{"type":40,"tag":295,"props":3455,"children":3456},{},[3457],{"type":45,"value":3458},"# WRONG: Vague or missing description\n",{"type":40,"tag":295,"props":3460,"children":3461},{"class":297,"line":307},[3462],{"type":40,"tag":295,"props":3463,"children":3464},{},[3465],{"type":45,"value":332},{"type":40,"tag":295,"props":3467,"children":3468},{"class":297,"line":316},[3469],{"type":40,"tag":295,"props":3470,"children":3471},{},[3472],{"type":45,"value":3473},"def bad_tool(input: str) -> str:\n",{"type":40,"tag":295,"props":3475,"children":3476},{"class":297,"line":326},[3477],{"type":40,"tag":295,"props":3478,"children":3479},{},[3480],{"type":45,"value":3481},"    \"\"\"Does stuff.\"\"\"\n",{"type":40,"tag":295,"props":3483,"children":3484},{"class":297,"line":335},[3485],{"type":40,"tag":295,"props":3486,"children":3487},{},[3488],{"type":45,"value":3489},"    return \"result\"\n",{"type":40,"tag":295,"props":3491,"children":3492},{"class":297,"line":344},[3493],{"type":40,"tag":295,"props":3494,"children":3495},{"emptyLinePlaceholder":320},[3496],{"type":45,"value":323},{"type":40,"tag":295,"props":3498,"children":3499},{"class":297,"line":353},[3500],{"type":40,"tag":295,"props":3501,"children":3502},{},[3503],{"type":45,"value":3504},"# CORRECT: Clear, specific description with Args\n",{"type":40,"tag":295,"props":3506,"children":3507},{"class":297,"line":361},[3508],{"type":40,"tag":295,"props":3509,"children":3510},{},[3511],{"type":45,"value":332},{"type":40,"tag":295,"props":3513,"children":3514},{"class":297,"line":370},[3515],{"type":40,"tag":295,"props":3516,"children":3517},{},[3518],{"type":45,"value":3519},"def search(query: str) -> str:\n",{"type":40,"tag":295,"props":3521,"children":3522},{"class":297,"line":379},[3523],{"type":40,"tag":295,"props":3524,"children":3525},{},[3526],{"type":45,"value":3527},"    \"\"\"Search the web for current information about a topic.\n",{"type":40,"tag":295,"props":3529,"children":3530},{"class":297,"line":388},[3531],{"type":40,"tag":295,"props":3532,"children":3533},{"emptyLinePlaceholder":320},[3534],{"type":45,"value":323},{"type":40,"tag":295,"props":3536,"children":3537},{"class":297,"line":397},[3538],{"type":40,"tag":295,"props":3539,"children":3540},{},[3541],{"type":45,"value":3542},"    Use this when you need recent data or facts.\n",{"type":40,"tag":295,"props":3544,"children":3545},{"class":297,"line":405},[3546],{"type":40,"tag":295,"props":3547,"children":3548},{"emptyLinePlaceholder":320},[3549],{"type":45,"value":323},{"type":40,"tag":295,"props":3551,"children":3552},{"class":297,"line":414},[3553],{"type":40,"tag":295,"props":3554,"children":3555},{},[3556],{"type":45,"value":367},{"type":40,"tag":295,"props":3558,"children":3559},{"class":297,"line":423},[3560],{"type":40,"tag":295,"props":3561,"children":3562},{},[3563],{"type":45,"value":3564},"        query: The search query (2-10 words recommended)\n",{"type":40,"tag":295,"props":3566,"children":3567},{"class":297,"line":432},[3568],{"type":40,"tag":295,"props":3569,"children":3570},{},[3571],{"type":45,"value":385},{"type":40,"tag":295,"props":3573,"children":3574},{"class":297,"line":441},[3575],{"type":40,"tag":295,"props":3576,"children":3577},{},[3578],{"type":45,"value":3579},"    return web_search(query)\n",{"type":40,"tag":493,"props":3581,"children":3582},{},[3583,3584],{"type":45,"value":3443},{"type":40,"tag":285,"props":3585,"children":3587},{"className":498,"code":3586,"language":493,"meta":289,"style":289},"\u002F\u002F WRONG: Vague description\nconst badTool = tool(async ({ input }) => \"result\", {\n  name: \"bad_tool\",\n  description: \"Does stuff.\", \u002F\u002F Too vague!\n  schema: z.object({ input: z.string() }),\n});\n\n\u002F\u002F CORRECT: Clear, specific description\nconst search = tool(async ({ query }) => webSearch(query), {\n  name: \"search\",\n  description: \"Search the web for current information about a topic. Use this when you need recent data or facts.\",\n  schema: z.object({\n    query: z.string().describe(\"The search query (2-10 words recommended)\"),\n  }),\n});\n",[3588],{"type":40,"tag":64,"props":3589,"children":3590},{"__ignoreMap":289},[3591,3599,3667,3695,3729,3798,3813,3820,3828,3891,3919,3947,3978,4039,4055],{"type":40,"tag":295,"props":3592,"children":3593},{"class":297,"line":298},[3594],{"type":40,"tag":295,"props":3595,"children":3596},{"style":1968},[3597],{"type":45,"value":3598},"\u002F\u002F WRONG: Vague description\n",{"type":40,"tag":295,"props":3600,"children":3601},{"class":297,"line":307},[3602,3606,3611,3615,3619,3623,3628,3632,3637,3641,3645,3649,3654,3658,3662],{"type":40,"tag":295,"props":3603,"children":3604},{"style":649},[3605],{"type":45,"value":652},{"type":40,"tag":295,"props":3607,"children":3608},{"style":521},[3609],{"type":45,"value":3610}," badTool ",{"type":40,"tag":295,"props":3612,"children":3613},{"style":515},[3614],{"type":45,"value":662},{"type":40,"tag":295,"props":3616,"children":3617},{"style":665},[3618],{"type":45,"value":570},{"type":40,"tag":295,"props":3620,"children":3621},{"style":521},[3622],{"type":45,"value":840},{"type":40,"tag":295,"props":3624,"children":3625},{"style":649},[3626],{"type":45,"value":3627},"async",{"type":40,"tag":295,"props":3629,"children":3630},{"style":515},[3631],{"type":45,"value":685},{"type":40,"tag":295,"props":3633,"children":3634},{"style":688},[3635],{"type":45,"value":3636}," input",{"type":40,"tag":295,"props":3638,"children":3639},{"style":515},[3640],{"type":45,"value":696},{"type":40,"tag":295,"props":3642,"children":3643},{"style":649},[3644],{"type":45,"value":701},{"type":40,"tag":295,"props":3646,"children":3647},{"style":515},[3648],{"type":45,"value":539},{"type":40,"tag":295,"props":3650,"children":3651},{"style":542},[3652],{"type":45,"value":3653},"result",{"type":40,"tag":295,"props":3655,"children":3656},{"style":515},[3657],{"type":45,"value":549},{"type":40,"tag":295,"props":3659,"children":3660},{"style":515},[3661],{"type":45,"value":1162},{"type":40,"tag":295,"props":3663,"children":3664},{"style":515},[3665],{"type":45,"value":3666}," {\n",{"type":40,"tag":295,"props":3668,"children":3669},{"class":297,"line":316},[3670,3674,3678,3682,3687,3691],{"type":40,"tag":295,"props":3671,"children":3672},{"style":755},[3673],{"type":45,"value":3039},{"type":40,"tag":295,"props":3675,"children":3676},{"style":515},[3677],{"type":45,"value":763},{"type":40,"tag":295,"props":3679,"children":3680},{"style":515},[3681],{"type":45,"value":539},{"type":40,"tag":295,"props":3683,"children":3684},{"style":542},[3685],{"type":45,"value":3686},"bad_tool",{"type":40,"tag":295,"props":3688,"children":3689},{"style":515},[3690],{"type":45,"value":549},{"type":40,"tag":295,"props":3692,"children":3693},{"style":515},[3694],{"type":45,"value":741},{"type":40,"tag":295,"props":3696,"children":3697},{"class":297,"line":326},[3698,3703,3707,3711,3716,3720,3724],{"type":40,"tag":295,"props":3699,"children":3700},{"style":755},[3701],{"type":45,"value":3702},"  description",{"type":40,"tag":295,"props":3704,"children":3705},{"style":515},[3706],{"type":45,"value":763},{"type":40,"tag":295,"props":3708,"children":3709},{"style":515},[3710],{"type":45,"value":539},{"type":40,"tag":295,"props":3712,"children":3713},{"style":542},[3714],{"type":45,"value":3715},"Does stuff.",{"type":40,"tag":295,"props":3717,"children":3718},{"style":515},[3719],{"type":45,"value":549},{"type":40,"tag":295,"props":3721,"children":3722},{"style":515},[3723],{"type":45,"value":1162},{"type":40,"tag":295,"props":3725,"children":3726},{"style":1968},[3727],{"type":45,"value":3728}," \u002F\u002F Too vague!\n",{"type":40,"tag":295,"props":3730,"children":3731},{"class":297,"line":335},[3732,3737,3741,3745,3749,3753,3757,3761,3765,3769,3773,3777,3781,3786,3790,3794],{"type":40,"tag":295,"props":3733,"children":3734},{"style":755},[3735],{"type":45,"value":3736},"  schema",{"type":40,"tag":295,"props":3738,"children":3739},{"style":515},[3740],{"type":45,"value":763},{"type":40,"tag":295,"props":3742,"children":3743},{"style":521},[3744],{"type":45,"value":611},{"type":40,"tag":295,"props":3746,"children":3747},{"style":515},[3748],{"type":45,"value":830},{"type":40,"tag":295,"props":3750,"children":3751},{"style":665},[3752],{"type":45,"value":835},{"type":40,"tag":295,"props":3754,"children":3755},{"style":521},[3756],{"type":45,"value":840},{"type":40,"tag":295,"props":3758,"children":3759},{"style":515},[3760],{"type":45,"value":845},{"type":40,"tag":295,"props":3762,"children":3763},{"style":755},[3764],{"type":45,"value":3636},{"type":40,"tag":295,"props":3766,"children":3767},{"style":515},[3768],{"type":45,"value":763},{"type":40,"tag":295,"props":3770,"children":3771},{"style":521},[3772],{"type":45,"value":611},{"type":40,"tag":295,"props":3774,"children":3775},{"style":515},[3776],{"type":45,"value":830},{"type":40,"tag":295,"props":3778,"children":3779},{"style":665},[3780],{"type":45,"value":866},{"type":40,"tag":295,"props":3782,"children":3783},{"style":521},[3784],{"type":45,"value":3785},"() ",{"type":40,"tag":295,"props":3787,"children":3788},{"style":515},[3789],{"type":45,"value":726},{"type":40,"tag":295,"props":3791,"children":3792},{"style":521},[3793],{"type":45,"value":911},{"type":40,"tag":295,"props":3795,"children":3796},{"style":515},[3797],{"type":45,"value":741},{"type":40,"tag":295,"props":3799,"children":3800},{"class":297,"line":344},[3801,3805,3809],{"type":40,"tag":295,"props":3802,"children":3803},{"style":515},[3804],{"type":45,"value":726},{"type":40,"tag":295,"props":3806,"children":3807},{"style":521},[3808],{"type":45,"value":911},{"type":40,"tag":295,"props":3810,"children":3811},{"style":515},[3812],{"type":45,"value":554},{"type":40,"tag":295,"props":3814,"children":3815},{"class":297,"line":353},[3816],{"type":40,"tag":295,"props":3817,"children":3818},{"emptyLinePlaceholder":320},[3819],{"type":45,"value":323},{"type":40,"tag":295,"props":3821,"children":3822},{"class":297,"line":361},[3823],{"type":40,"tag":295,"props":3824,"children":3825},{"style":1968},[3826],{"type":45,"value":3827},"\u002F\u002F CORRECT: Clear, specific description\n",{"type":40,"tag":295,"props":3829,"children":3830},{"class":297,"line":370},[3831,3835,3840,3844,3848,3852,3856,3860,3865,3869,3873,3878,3883,3887],{"type":40,"tag":295,"props":3832,"children":3833},{"style":649},[3834],{"type":45,"value":652},{"type":40,"tag":295,"props":3836,"children":3837},{"style":521},[3838],{"type":45,"value":3839}," search ",{"type":40,"tag":295,"props":3841,"children":3842},{"style":515},[3843],{"type":45,"value":662},{"type":40,"tag":295,"props":3845,"children":3846},{"style":665},[3847],{"type":45,"value":570},{"type":40,"tag":295,"props":3849,"children":3850},{"style":521},[3851],{"type":45,"value":840},{"type":40,"tag":295,"props":3853,"children":3854},{"style":649},[3855],{"type":45,"value":3627},{"type":40,"tag":295,"props":3857,"children":3858},{"style":515},[3859],{"type":45,"value":685},{"type":40,"tag":295,"props":3861,"children":3862},{"style":688},[3863],{"type":45,"value":3864}," query",{"type":40,"tag":295,"props":3866,"children":3867},{"style":515},[3868],{"type":45,"value":696},{"type":40,"tag":295,"props":3870,"children":3871},{"style":649},[3872],{"type":45,"value":701},{"type":40,"tag":295,"props":3874,"children":3875},{"style":665},[3876],{"type":45,"value":3877}," webSearch",{"type":40,"tag":295,"props":3879,"children":3880},{"style":521},[3881],{"type":45,"value":3882},"(query)",{"type":40,"tag":295,"props":3884,"children":3885},{"style":515},[3886],{"type":45,"value":1162},{"type":40,"tag":295,"props":3888,"children":3889},{"style":515},[3890],{"type":45,"value":3666},{"type":40,"tag":295,"props":3892,"children":3893},{"class":297,"line":379},[3894,3898,3902,3906,3911,3915],{"type":40,"tag":295,"props":3895,"children":3896},{"style":755},[3897],{"type":45,"value":3039},{"type":40,"tag":295,"props":3899,"children":3900},{"style":515},[3901],{"type":45,"value":763},{"type":40,"tag":295,"props":3903,"children":3904},{"style":515},[3905],{"type":45,"value":539},{"type":40,"tag":295,"props":3907,"children":3908},{"style":542},[3909],{"type":45,"value":3910},"search",{"type":40,"tag":295,"props":3912,"children":3913},{"style":515},[3914],{"type":45,"value":549},{"type":40,"tag":295,"props":3916,"children":3917},{"style":515},[3918],{"type":45,"value":741},{"type":40,"tag":295,"props":3920,"children":3921},{"class":297,"line":388},[3922,3926,3930,3934,3939,3943],{"type":40,"tag":295,"props":3923,"children":3924},{"style":755},[3925],{"type":45,"value":3702},{"type":40,"tag":295,"props":3927,"children":3928},{"style":515},[3929],{"type":45,"value":763},{"type":40,"tag":295,"props":3931,"children":3932},{"style":515},[3933],{"type":45,"value":539},{"type":40,"tag":295,"props":3935,"children":3936},{"style":542},[3937],{"type":45,"value":3938},"Search the web for current information about a topic. Use this when you need recent data or facts.",{"type":40,"tag":295,"props":3940,"children":3941},{"style":515},[3942],{"type":45,"value":549},{"type":40,"tag":295,"props":3944,"children":3945},{"style":515},[3946],{"type":45,"value":741},{"type":40,"tag":295,"props":3948,"children":3949},{"class":297,"line":397},[3950,3954,3958,3962,3966,3970,3974],{"type":40,"tag":295,"props":3951,"children":3952},{"style":755},[3953],{"type":45,"value":3736},{"type":40,"tag":295,"props":3955,"children":3956},{"style":515},[3957],{"type":45,"value":763},{"type":40,"tag":295,"props":3959,"children":3960},{"style":521},[3961],{"type":45,"value":611},{"type":40,"tag":295,"props":3963,"children":3964},{"style":515},[3965],{"type":45,"value":830},{"type":40,"tag":295,"props":3967,"children":3968},{"style":665},[3969],{"type":45,"value":835},{"type":40,"tag":295,"props":3971,"children":3972},{"style":521},[3973],{"type":45,"value":840},{"type":40,"tag":295,"props":3975,"children":3976},{"style":515},[3977],{"type":45,"value":970},{"type":40,"tag":295,"props":3979,"children":3980},{"class":297,"line":405},[3981,3986,3990,3994,3998,4002,4006,4010,4014,4018,4022,4027,4031,4035],{"type":40,"tag":295,"props":3982,"children":3983},{"style":755},[3984],{"type":45,"value":3985},"    query",{"type":40,"tag":295,"props":3987,"children":3988},{"style":515},[3989],{"type":45,"value":763},{"type":40,"tag":295,"props":3991,"children":3992},{"style":521},[3993],{"type":45,"value":611},{"type":40,"tag":295,"props":3995,"children":3996},{"style":515},[3997],{"type":45,"value":830},{"type":40,"tag":295,"props":3999,"children":4000},{"style":665},[4001],{"type":45,"value":866},{"type":40,"tag":295,"props":4003,"children":4004},{"style":521},[4005],{"type":45,"value":871},{"type":40,"tag":295,"props":4007,"children":4008},{"style":515},[4009],{"type":45,"value":830},{"type":40,"tag":295,"props":4011,"children":4012},{"style":665},[4013],{"type":45,"value":880},{"type":40,"tag":295,"props":4015,"children":4016},{"style":521},[4017],{"type":45,"value":840},{"type":40,"tag":295,"props":4019,"children":4020},{"style":515},[4021],{"type":45,"value":549},{"type":40,"tag":295,"props":4023,"children":4024},{"style":542},[4025],{"type":45,"value":4026},"The search query (2-10 words recommended)",{"type":40,"tag":295,"props":4028,"children":4029},{"style":515},[4030],{"type":45,"value":549},{"type":40,"tag":295,"props":4032,"children":4033},{"style":521},[4034],{"type":45,"value":911},{"type":40,"tag":295,"props":4036,"children":4037},{"style":515},[4038],{"type":45,"value":741},{"type":40,"tag":295,"props":4040,"children":4041},{"class":297,"line":414},[4042,4047,4051],{"type":40,"tag":295,"props":4043,"children":4044},{"style":515},[4045],{"type":45,"value":4046},"  }",{"type":40,"tag":295,"props":4048,"children":4049},{"style":521},[4050],{"type":45,"value":911},{"type":40,"tag":295,"props":4052,"children":4053},{"style":515},[4054],{"type":45,"value":741},{"type":40,"tag":295,"props":4056,"children":4057},{"class":297,"line":423},[4058,4062,4066],{"type":40,"tag":295,"props":4059,"children":4060},{"style":515},[4061],{"type":45,"value":726},{"type":40,"tag":295,"props":4063,"children":4064},{"style":521},[4065],{"type":45,"value":911},{"type":40,"tag":295,"props":4067,"children":4068},{"style":515},[4069],{"type":45,"value":554},{"type":40,"tag":4071,"props":4072,"children":4073},"fix-no-checkpointer",{},[4074,4223],{"type":40,"tag":281,"props":4075,"children":4076},{},[4077,4079],{"type":45,"value":4078},"\nAdd checkpointer and thread_id for conversation memory across invocations.\n",{"type":40,"tag":285,"props":4080,"children":4082},{"className":287,"code":4081,"language":281,"meta":289,"style":289},"# WRONG: No persistence - agent forgets between calls\nagent = create_agent(model=\"anthropic:claude-sonnet-4-5\", tools=[search])\nagent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"I'm Bob\"}]})\nagent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"What's my name?\"}]})\n# Agent doesn't remember!\n\n# CORRECT: Add checkpointer and thread_id\nfrom langgraph.checkpoint.memory import MemorySaver\n\nagent = create_agent(\n    model=\"anthropic:claude-sonnet-4-5\",\n    tools=[search],\n    checkpointer=MemorySaver(),\n)\nconfig = {\"configurable\": {\"thread_id\": \"session-1\"}}\nagent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"I'm Bob\"}]}, config=config)\nagent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"What's my name?\"}]}, config=config)\n# Agent remembers: \"Your name is Bob\"\n",[4083],{"type":40,"tag":64,"props":4084,"children":4085},{"__ignoreMap":289},[4086,4094,4102,4110,4118,4126,4133,4141,4148,4155,4162,4169,4176,4184,4191,4199,4207,4215],{"type":40,"tag":295,"props":4087,"children":4088},{"class":297,"line":298},[4089],{"type":40,"tag":295,"props":4090,"children":4091},{},[4092],{"type":45,"value":4093},"# WRONG: No persistence - agent forgets between calls\n",{"type":40,"tag":295,"props":4095,"children":4096},{"class":297,"line":307},[4097],{"type":40,"tag":295,"props":4098,"children":4099},{},[4100],{"type":45,"value":4101},"agent = create_agent(model=\"anthropic:claude-sonnet-4-5\", tools=[search])\n",{"type":40,"tag":295,"props":4103,"children":4104},{"class":297,"line":316},[4105],{"type":40,"tag":295,"props":4106,"children":4107},{},[4108],{"type":45,"value":4109},"agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"I'm Bob\"}]})\n",{"type":40,"tag":295,"props":4111,"children":4112},{"class":297,"line":326},[4113],{"type":40,"tag":295,"props":4114,"children":4115},{},[4116],{"type":45,"value":4117},"agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"What's my name?\"}]})\n",{"type":40,"tag":295,"props":4119,"children":4120},{"class":297,"line":335},[4121],{"type":40,"tag":295,"props":4122,"children":4123},{},[4124],{"type":45,"value":4125},"# Agent doesn't remember!\n",{"type":40,"tag":295,"props":4127,"children":4128},{"class":297,"line":344},[4129],{"type":40,"tag":295,"props":4130,"children":4131},{"emptyLinePlaceholder":320},[4132],{"type":45,"value":323},{"type":40,"tag":295,"props":4134,"children":4135},{"class":297,"line":353},[4136],{"type":40,"tag":295,"props":4137,"children":4138},{},[4139],{"type":45,"value":4140},"# CORRECT: Add checkpointer and thread_id\n",{"type":40,"tag":295,"props":4142,"children":4143},{"class":297,"line":361},[4144],{"type":40,"tag":295,"props":4145,"children":4146},{},[4147],{"type":45,"value":1321},{"type":40,"tag":295,"props":4149,"children":4150},{"class":297,"line":370},[4151],{"type":40,"tag":295,"props":4152,"children":4153},{"emptyLinePlaceholder":320},[4154],{"type":45,"value":323},{"type":40,"tag":295,"props":4156,"children":4157},{"class":297,"line":379},[4158],{"type":40,"tag":295,"props":4159,"children":4160},{},[4161],{"type":45,"value":411},{"type":40,"tag":295,"props":4163,"children":4164},{"class":297,"line":388},[4165],{"type":40,"tag":295,"props":4166,"children":4167},{},[4168],{"type":45,"value":420},{"type":40,"tag":295,"props":4170,"children":4171},{"class":297,"line":397},[4172],{"type":40,"tag":295,"props":4173,"children":4174},{},[4175],{"type":45,"value":1365},{"type":40,"tag":295,"props":4177,"children":4178},{"class":297,"line":405},[4179],{"type":40,"tag":295,"props":4180,"children":4181},{},[4182],{"type":45,"value":4183},"    checkpointer=MemorySaver(),\n",{"type":40,"tag":295,"props":4185,"children":4186},{"class":297,"line":414},[4187],{"type":40,"tag":295,"props":4188,"children":4189},{},[4190],{"type":45,"value":447},{"type":40,"tag":295,"props":4192,"children":4193},{"class":297,"line":423},[4194],{"type":40,"tag":295,"props":4195,"children":4196},{},[4197],{"type":45,"value":4198},"config = {\"configurable\": {\"thread_id\": \"session-1\"}}\n",{"type":40,"tag":295,"props":4200,"children":4201},{"class":297,"line":432},[4202],{"type":40,"tag":295,"props":4203,"children":4204},{},[4205],{"type":45,"value":4206},"agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"I'm Bob\"}]}, config=config)\n",{"type":40,"tag":295,"props":4208,"children":4209},{"class":297,"line":441},[4210],{"type":40,"tag":295,"props":4211,"children":4212},{},[4213],{"type":45,"value":4214},"agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"What's my name?\"}]}, config=config)\n",{"type":40,"tag":295,"props":4216,"children":4217},{"class":297,"line":450},[4218],{"type":40,"tag":295,"props":4219,"children":4220},{},[4221],{"type":45,"value":4222},"# Agent remembers: \"Your name is Bob\"\n",{"type":40,"tag":493,"props":4224,"children":4225},{},[4226,4227],{"type":45,"value":4078},{"type":40,"tag":285,"props":4228,"children":4230},{"className":498,"code":4229,"language":493,"meta":289,"style":289},"\u002F\u002F WRONG: No persistence\nconst agent = createAgent({ model: \"anthropic:claude-sonnet-4-5\", tools: [search] });\nawait agent.invoke({ messages: [{ role: \"user\", content: \"I'm Bob\" }] });\nawait agent.invoke({ messages: [{ role: \"user\", content: \"What's my name?\" }] });\n\u002F\u002F Agent doesn't remember!\n\n\u002F\u002F CORRECT: Add checkpointer and thread_id\nimport { MemorySaver } from \"@langchain\u002Flanggraph\";\n\nconst agent = createAgent({\n  model: \"anthropic:claude-sonnet-4-5\",\n  tools: [search],\n  checkpointer: new MemorySaver(),\n});\nconst config = { configurable: { thread_id: \"session-1\" } };\nawait agent.invoke({ messages: [{ role: \"user\", content: \"I'm Bob\" }] }, config);\nawait agent.invoke({ messages: [{ role: \"user\", content: \"What's my name?\" }] }, config);\n\u002F\u002F Agent remembers: \"Your name is Bob\"\n",[4231],{"type":40,"tag":64,"props":4232,"children":4233},{"__ignoreMap":289},[4234,4242,4319,4427,4534,4542,4549,4557,4596,4603,4630,4657,4676,4703,4718,4778,4885,4992],{"type":40,"tag":295,"props":4235,"children":4236},{"class":297,"line":298},[4237],{"type":40,"tag":295,"props":4238,"children":4239},{"style":1968},[4240],{"type":45,"value":4241},"\u002F\u002F WRONG: No persistence\n",{"type":40,"tag":295,"props":4243,"children":4244},{"class":297,"line":307},[4245,4249,4253,4257,4261,4265,4269,4273,4277,4281,4285,4289,4293,4298,4302,4307,4311,4315],{"type":40,"tag":295,"props":4246,"children":4247},{"style":649},[4248],{"type":45,"value":652},{"type":40,"tag":295,"props":4250,"children":4251},{"style":521},[4252],{"type":45,"value":953},{"type":40,"tag":295,"props":4254,"children":4255},{"style":515},[4256],{"type":45,"value":662},{"type":40,"tag":295,"props":4258,"children":4259},{"style":665},[4260],{"type":45,"value":524},{"type":40,"tag":295,"props":4262,"children":4263},{"style":521},[4264],{"type":45,"value":840},{"type":40,"tag":295,"props":4266,"children":4267},{"style":515},[4268],{"type":45,"value":845},{"type":40,"tag":295,"props":4270,"children":4271},{"style":755},[4272],{"type":45,"value":3236},{"type":40,"tag":295,"props":4274,"children":4275},{"style":515},[4276],{"type":45,"value":763},{"type":40,"tag":295,"props":4278,"children":4279},{"style":515},[4280],{"type":45,"value":539},{"type":40,"tag":295,"props":4282,"children":4283},{"style":542},[4284],{"type":45,"value":991},{"type":40,"tag":295,"props":4286,"children":4287},{"style":515},[4288],{"type":45,"value":549},{"type":40,"tag":295,"props":4290,"children":4291},{"style":515},[4292],{"type":45,"value":1162},{"type":40,"tag":295,"props":4294,"children":4295},{"style":755},[4296],{"type":45,"value":4297}," tools",{"type":40,"tag":295,"props":4299,"children":4300},{"style":515},[4301],{"type":45,"value":763},{"type":40,"tag":295,"props":4303,"children":4304},{"style":521},[4305],{"type":45,"value":4306}," [search] ",{"type":40,"tag":295,"props":4308,"children":4309},{"style":515},[4310],{"type":45,"value":726},{"type":40,"tag":295,"props":4312,"children":4313},{"style":521},[4314],{"type":45,"value":911},{"type":40,"tag":295,"props":4316,"children":4317},{"style":515},[4318],{"type":45,"value":554},{"type":40,"tag":295,"props":4320,"children":4321},{"class":297,"line":316},[4322,4326,4330,4334,4338,4342,4346,4350,4354,4358,4362,4366,4370,4374,4378,4382,4386,4390,4394,4398,4403,4407,4411,4415,4419,4423],{"type":40,"tag":295,"props":4323,"children":4324},{"style":509},[4325],{"type":45,"value":1737},{"type":40,"tag":295,"props":4327,"children":4328},{"style":521},[4329],{"type":45,"value":1097},{"type":40,"tag":295,"props":4331,"children":4332},{"style":515},[4333],{"type":45,"value":830},{"type":40,"tag":295,"props":4335,"children":4336},{"style":665},[4337],{"type":45,"value":1106},{"type":40,"tag":295,"props":4339,"children":4340},{"style":521},[4341],{"type":45,"value":840},{"type":40,"tag":295,"props":4343,"children":4344},{"style":515},[4345],{"type":45,"value":845},{"type":40,"tag":295,"props":4347,"children":4348},{"style":755},[4349],{"type":45,"value":1762},{"type":40,"tag":295,"props":4351,"children":4352},{"style":515},[4353],{"type":45,"value":763},{"type":40,"tag":295,"props":4355,"children":4356},{"style":521},[4357],{"type":45,"value":1131},{"type":40,"tag":295,"props":4359,"children":4360},{"style":515},[4361],{"type":45,"value":845},{"type":40,"tag":295,"props":4363,"children":4364},{"style":755},[4365],{"type":45,"value":1140},{"type":40,"tag":295,"props":4367,"children":4368},{"style":515},[4369],{"type":45,"value":763},{"type":40,"tag":295,"props":4371,"children":4372},{"style":515},[4373],{"type":45,"value":539},{"type":40,"tag":295,"props":4375,"children":4376},{"style":542},[4377],{"type":45,"value":1153},{"type":40,"tag":295,"props":4379,"children":4380},{"style":515},[4381],{"type":45,"value":549},{"type":40,"tag":295,"props":4383,"children":4384},{"style":515},[4385],{"type":45,"value":1162},{"type":40,"tag":295,"props":4387,"children":4388},{"style":755},[4389],{"type":45,"value":1167},{"type":40,"tag":295,"props":4391,"children":4392},{"style":515},[4393],{"type":45,"value":763},{"type":40,"tag":295,"props":4395,"children":4396},{"style":515},[4397],{"type":45,"value":539},{"type":40,"tag":295,"props":4399,"children":4400},{"style":542},[4401],{"type":45,"value":4402},"I'm Bob",{"type":40,"tag":295,"props":4404,"children":4405},{"style":515},[4406],{"type":45,"value":549},{"type":40,"tag":295,"props":4408,"children":4409},{"style":515},[4410],{"type":45,"value":529},{"type":40,"tag":295,"props":4412,"children":4413},{"style":521},[4414],{"type":45,"value":1828},{"type":40,"tag":295,"props":4416,"children":4417},{"style":515},[4418],{"type":45,"value":726},{"type":40,"tag":295,"props":4420,"children":4421},{"style":521},[4422],{"type":45,"value":911},{"type":40,"tag":295,"props":4424,"children":4425},{"style":515},[4426],{"type":45,"value":554},{"type":40,"tag":295,"props":4428,"children":4429},{"class":297,"line":326},[4430,4434,4438,4442,4446,4450,4454,4458,4462,4466,4470,4474,4478,4482,4486,4490,4494,4498,4502,4506,4510,4514,4518,4522,4526,4530],{"type":40,"tag":295,"props":4431,"children":4432},{"style":509},[4433],{"type":45,"value":1737},{"type":40,"tag":295,"props":4435,"children":4436},{"style":521},[4437],{"type":45,"value":1097},{"type":40,"tag":295,"props":4439,"children":4440},{"style":515},[4441],{"type":45,"value":830},{"type":40,"tag":295,"props":4443,"children":4444},{"style":665},[4445],{"type":45,"value":1106},{"type":40,"tag":295,"props":4447,"children":4448},{"style":521},[4449],{"type":45,"value":840},{"type":40,"tag":295,"props":4451,"children":4452},{"style":515},[4453],{"type":45,"value":845},{"type":40,"tag":295,"props":4455,"children":4456},{"style":755},[4457],{"type":45,"value":1762},{"type":40,"tag":295,"props":4459,"children":4460},{"style":515},[4461],{"type":45,"value":763},{"type":40,"tag":295,"props":4463,"children":4464},{"style":521},[4465],{"type":45,"value":1131},{"type":40,"tag":295,"props":4467,"children":4468},{"style":515},[4469],{"type":45,"value":845},{"type":40,"tag":295,"props":4471,"children":4472},{"style":755},[4473],{"type":45,"value":1140},{"type":40,"tag":295,"props":4475,"children":4476},{"style":515},[4477],{"type":45,"value":763},{"type":40,"tag":295,"props":4479,"children":4480},{"style":515},[4481],{"type":45,"value":539},{"type":40,"tag":295,"props":4483,"children":4484},{"style":542},[4485],{"type":45,"value":1153},{"type":40,"tag":295,"props":4487,"children":4488},{"style":515},[4489],{"type":45,"value":549},{"type":40,"tag":295,"props":4491,"children":4492},{"style":515},[4493],{"type":45,"value":1162},{"type":40,"tag":295,"props":4495,"children":4496},{"style":755},[4497],{"type":45,"value":1167},{"type":40,"tag":295,"props":4499,"children":4500},{"style":515},[4501],{"type":45,"value":763},{"type":40,"tag":295,"props":4503,"children":4504},{"style":515},[4505],{"type":45,"value":539},{"type":40,"tag":295,"props":4507,"children":4508},{"style":542},[4509],{"type":45,"value":1938},{"type":40,"tag":295,"props":4511,"children":4512},{"style":515},[4513],{"type":45,"value":549},{"type":40,"tag":295,"props":4515,"children":4516},{"style":515},[4517],{"type":45,"value":529},{"type":40,"tag":295,"props":4519,"children":4520},{"style":521},[4521],{"type":45,"value":1828},{"type":40,"tag":295,"props":4523,"children":4524},{"style":515},[4525],{"type":45,"value":726},{"type":40,"tag":295,"props":4527,"children":4528},{"style":521},[4529],{"type":45,"value":911},{"type":40,"tag":295,"props":4531,"children":4532},{"style":515},[4533],{"type":45,"value":554},{"type":40,"tag":295,"props":4535,"children":4536},{"class":297,"line":335},[4537],{"type":40,"tag":295,"props":4538,"children":4539},{"style":1968},[4540],{"type":45,"value":4541},"\u002F\u002F Agent doesn't remember!\n",{"type":40,"tag":295,"props":4543,"children":4544},{"class":297,"line":344},[4545],{"type":40,"tag":295,"props":4546,"children":4547},{"emptyLinePlaceholder":320},[4548],{"type":45,"value":323},{"type":40,"tag":295,"props":4550,"children":4551},{"class":297,"line":353},[4552],{"type":40,"tag":295,"props":4553,"children":4554},{"style":1968},[4555],{"type":45,"value":4556},"\u002F\u002F CORRECT: Add checkpointer and thread_id\n",{"type":40,"tag":295,"props":4558,"children":4559},{"class":297,"line":361},[4560,4564,4568,4572,4576,4580,4584,4588,4592],{"type":40,"tag":295,"props":4561,"children":4562},{"style":509},[4563],{"type":45,"value":512},{"type":40,"tag":295,"props":4565,"children":4566},{"style":515},[4567],{"type":45,"value":518},{"type":40,"tag":295,"props":4569,"children":4570},{"style":521},[4571],{"type":45,"value":1485},{"type":40,"tag":295,"props":4573,"children":4574},{"style":515},[4575],{"type":45,"value":529},{"type":40,"tag":295,"props":4577,"children":4578},{"style":509},[4579],{"type":45,"value":534},{"type":40,"tag":295,"props":4581,"children":4582},{"style":515},[4583],{"type":45,"value":539},{"type":40,"tag":295,"props":4585,"children":4586},{"style":542},[4587],{"type":45,"value":1502},{"type":40,"tag":295,"props":4589,"children":4590},{"style":515},[4591],{"type":45,"value":549},{"type":40,"tag":295,"props":4593,"children":4594},{"style":515},[4595],{"type":45,"value":554},{"type":40,"tag":295,"props":4597,"children":4598},{"class":297,"line":370},[4599],{"type":40,"tag":295,"props":4600,"children":4601},{"emptyLinePlaceholder":320},[4602],{"type":45,"value":323},{"type":40,"tag":295,"props":4604,"children":4605},{"class":297,"line":379},[4606,4610,4614,4618,4622,4626],{"type":40,"tag":295,"props":4607,"children":4608},{"style":649},[4609],{"type":45,"value":652},{"type":40,"tag":295,"props":4611,"children":4612},{"style":521},[4613],{"type":45,"value":953},{"type":40,"tag":295,"props":4615,"children":4616},{"style":515},[4617],{"type":45,"value":662},{"type":40,"tag":295,"props":4619,"children":4620},{"style":665},[4621],{"type":45,"value":524},{"type":40,"tag":295,"props":4623,"children":4624},{"style":521},[4625],{"type":45,"value":840},{"type":40,"tag":295,"props":4627,"children":4628},{"style":515},[4629],{"type":45,"value":970},{"type":40,"tag":295,"props":4631,"children":4632},{"class":297,"line":388},[4633,4637,4641,4645,4649,4653],{"type":40,"tag":295,"props":4634,"children":4635},{"style":755},[4636],{"type":45,"value":978},{"type":40,"tag":295,"props":4638,"children":4639},{"style":515},[4640],{"type":45,"value":763},{"type":40,"tag":295,"props":4642,"children":4643},{"style":515},[4644],{"type":45,"value":539},{"type":40,"tag":295,"props":4646,"children":4647},{"style":542},[4648],{"type":45,"value":991},{"type":40,"tag":295,"props":4650,"children":4651},{"style":515},[4652],{"type":45,"value":549},{"type":40,"tag":295,"props":4654,"children":4655},{"style":515},[4656],{"type":45,"value":741},{"type":40,"tag":295,"props":4658,"children":4659},{"class":297,"line":397},[4660,4664,4668,4672],{"type":40,"tag":295,"props":4661,"children":4662},{"style":755},[4663],{"type":45,"value":1007},{"type":40,"tag":295,"props":4665,"children":4666},{"style":515},[4667],{"type":45,"value":763},{"type":40,"tag":295,"props":4669,"children":4670},{"style":521},[4671],{"type":45,"value":1627},{"type":40,"tag":295,"props":4673,"children":4674},{"style":515},[4675],{"type":45,"value":741},{"type":40,"tag":295,"props":4677,"children":4678},{"class":297,"line":405},[4679,4683,4687,4691,4695,4699],{"type":40,"tag":295,"props":4680,"children":4681},{"style":755},[4682],{"type":45,"value":1639},{"type":40,"tag":295,"props":4684,"children":4685},{"style":515},[4686],{"type":45,"value":763},{"type":40,"tag":295,"props":4688,"children":4689},{"style":515},[4690],{"type":45,"value":1538},{"type":40,"tag":295,"props":4692,"children":4693},{"style":665},[4694],{"type":45,"value":1485},{"type":40,"tag":295,"props":4696,"children":4697},{"style":521},[4698],{"type":45,"value":871},{"type":40,"tag":295,"props":4700,"children":4701},{"style":515},[4702],{"type":45,"value":741},{"type":40,"tag":295,"props":4704,"children":4705},{"class":297,"line":414},[4706,4710,4714],{"type":40,"tag":295,"props":4707,"children":4708},{"style":515},[4709],{"type":45,"value":726},{"type":40,"tag":295,"props":4711,"children":4712},{"style":521},[4713],{"type":45,"value":911},{"type":40,"tag":295,"props":4715,"children":4716},{"style":515},[4717],{"type":45,"value":554},{"type":40,"tag":295,"props":4719,"children":4720},{"class":297,"line":423},[4721,4725,4729,4733,4737,4741,4745,4749,4753,4757,4761,4766,4770,4774],{"type":40,"tag":295,"props":4722,"children":4723},{"style":649},[4724],{"type":45,"value":652},{"type":40,"tag":295,"props":4726,"children":4727},{"style":521},[4728],{"type":45,"value":1677},{"type":40,"tag":295,"props":4730,"children":4731},{"style":515},[4732],{"type":45,"value":662},{"type":40,"tag":295,"props":4734,"children":4735},{"style":515},[4736],{"type":45,"value":518},{"type":40,"tag":295,"props":4738,"children":4739},{"style":755},[4740],{"type":45,"value":1690},{"type":40,"tag":295,"props":4742,"children":4743},{"style":515},[4744],{"type":45,"value":763},{"type":40,"tag":295,"props":4746,"children":4747},{"style":515},[4748],{"type":45,"value":518},{"type":40,"tag":295,"props":4750,"children":4751},{"style":755},[4752],{"type":45,"value":1703},{"type":40,"tag":295,"props":4754,"children":4755},{"style":515},[4756],{"type":45,"value":763},{"type":40,"tag":295,"props":4758,"children":4759},{"style":515},[4760],{"type":45,"value":539},{"type":40,"tag":295,"props":4762,"children":4763},{"style":542},[4764],{"type":45,"value":4765},"session-1",{"type":40,"tag":295,"props":4767,"children":4768},{"style":515},[4769],{"type":45,"value":549},{"type":40,"tag":295,"props":4771,"children":4772},{"style":515},[4773],{"type":45,"value":529},{"type":40,"tag":295,"props":4775,"children":4776},{"style":515},[4777],{"type":45,"value":1729},{"type":40,"tag":295,"props":4779,"children":4780},{"class":297,"line":432},[4781,4785,4789,4793,4797,4801,4805,4809,4813,4817,4821,4825,4829,4833,4837,4841,4845,4849,4853,4857,4861,4865,4869,4873,4877,4881],{"type":40,"tag":295,"props":4782,"children":4783},{"style":509},[4784],{"type":45,"value":1737},{"type":40,"tag":295,"props":4786,"children":4787},{"style":521},[4788],{"type":45,"value":1097},{"type":40,"tag":295,"props":4790,"children":4791},{"style":515},[4792],{"type":45,"value":830},{"type":40,"tag":295,"props":4794,"children":4795},{"style":665},[4796],{"type":45,"value":1106},{"type":40,"tag":295,"props":4798,"children":4799},{"style":521},[4800],{"type":45,"value":840},{"type":40,"tag":295,"props":4802,"children":4803},{"style":515},[4804],{"type":45,"value":845},{"type":40,"tag":295,"props":4806,"children":4807},{"style":755},[4808],{"type":45,"value":1762},{"type":40,"tag":295,"props":4810,"children":4811},{"style":515},[4812],{"type":45,"value":763},{"type":40,"tag":295,"props":4814,"children":4815},{"style":521},[4816],{"type":45,"value":1131},{"type":40,"tag":295,"props":4818,"children":4819},{"style":515},[4820],{"type":45,"value":845},{"type":40,"tag":295,"props":4822,"children":4823},{"style":755},[4824],{"type":45,"value":1140},{"type":40,"tag":295,"props":4826,"children":4827},{"style":515},[4828],{"type":45,"value":763},{"type":40,"tag":295,"props":4830,"children":4831},{"style":515},[4832],{"type":45,"value":539},{"type":40,"tag":295,"props":4834,"children":4835},{"style":542},[4836],{"type":45,"value":1153},{"type":40,"tag":295,"props":4838,"children":4839},{"style":515},[4840],{"type":45,"value":549},{"type":40,"tag":295,"props":4842,"children":4843},{"style":515},[4844],{"type":45,"value":1162},{"type":40,"tag":295,"props":4846,"children":4847},{"style":755},[4848],{"type":45,"value":1167},{"type":40,"tag":295,"props":4850,"children":4851},{"style":515},[4852],{"type":45,"value":763},{"type":40,"tag":295,"props":4854,"children":4855},{"style":515},[4856],{"type":45,"value":539},{"type":40,"tag":295,"props":4858,"children":4859},{"style":542},[4860],{"type":45,"value":4402},{"type":40,"tag":295,"props":4862,"children":4863},{"style":515},[4864],{"type":45,"value":549},{"type":40,"tag":295,"props":4866,"children":4867},{"style":515},[4868],{"type":45,"value":529},{"type":40,"tag":295,"props":4870,"children":4871},{"style":521},[4872],{"type":45,"value":1828},{"type":40,"tag":295,"props":4874,"children":4875},{"style":515},[4876],{"type":45,"value":1833},{"type":40,"tag":295,"props":4878,"children":4879},{"style":521},[4880],{"type":45,"value":1838},{"type":40,"tag":295,"props":4882,"children":4883},{"style":515},[4884],{"type":45,"value":554},{"type":40,"tag":295,"props":4886,"children":4887},{"class":297,"line":441},[4888,4892,4896,4900,4904,4908,4912,4916,4920,4924,4928,4932,4936,4940,4944,4948,4952,4956,4960,4964,4968,4972,4976,4980,4984,4988],{"type":40,"tag":295,"props":4889,"children":4890},{"style":509},[4891],{"type":45,"value":1737},{"type":40,"tag":295,"props":4893,"children":4894},{"style":521},[4895],{"type":45,"value":1097},{"type":40,"tag":295,"props":4897,"children":4898},{"style":515},[4899],{"type":45,"value":830},{"type":40,"tag":295,"props":4901,"children":4902},{"style":665},[4903],{"type":45,"value":1106},{"type":40,"tag":295,"props":4905,"children":4906},{"style":521},[4907],{"type":45,"value":840},{"type":40,"tag":295,"props":4909,"children":4910},{"style":515},[4911],{"type":45,"value":845},{"type":40,"tag":295,"props":4913,"children":4914},{"style":755},[4915],{"type":45,"value":1762},{"type":40,"tag":295,"props":4917,"children":4918},{"style":515},[4919],{"type":45,"value":763},{"type":40,"tag":295,"props":4921,"children":4922},{"style":521},[4923],{"type":45,"value":1131},{"type":40,"tag":295,"props":4925,"children":4926},{"style":515},[4927],{"type":45,"value":845},{"type":40,"tag":295,"props":4929,"children":4930},{"style":755},[4931],{"type":45,"value":1140},{"type":40,"tag":295,"props":4933,"children":4934},{"style":515},[4935],{"type":45,"value":763},{"type":40,"tag":295,"props":4937,"children":4938},{"style":515},[4939],{"type":45,"value":539},{"type":40,"tag":295,"props":4941,"children":4942},{"style":542},[4943],{"type":45,"value":1153},{"type":40,"tag":295,"props":4945,"children":4946},{"style":515},[4947],{"type":45,"value":549},{"type":40,"tag":295,"props":4949,"children":4950},{"style":515},[4951],{"type":45,"value":1162},{"type":40,"tag":295,"props":4953,"children":4954},{"style":755},[4955],{"type":45,"value":1167},{"type":40,"tag":295,"props":4957,"children":4958},{"style":515},[4959],{"type":45,"value":763},{"type":40,"tag":295,"props":4961,"children":4962},{"style":515},[4963],{"type":45,"value":539},{"type":40,"tag":295,"props":4965,"children":4966},{"style":542},[4967],{"type":45,"value":1938},{"type":40,"tag":295,"props":4969,"children":4970},{"style":515},[4971],{"type":45,"value":549},{"type":40,"tag":295,"props":4973,"children":4974},{"style":515},[4975],{"type":45,"value":529},{"type":40,"tag":295,"props":4977,"children":4978},{"style":521},[4979],{"type":45,"value":1828},{"type":40,"tag":295,"props":4981,"children":4982},{"style":515},[4983],{"type":45,"value":1833},{"type":40,"tag":295,"props":4985,"children":4986},{"style":521},[4987],{"type":45,"value":1838},{"type":40,"tag":295,"props":4989,"children":4990},{"style":515},[4991],{"type":45,"value":554},{"type":40,"tag":295,"props":4993,"children":4994},{"class":297,"line":450},[4995],{"type":40,"tag":295,"props":4996,"children":4997},{"style":1968},[4998],{"type":45,"value":4999},"\u002F\u002F Agent remembers: \"Your name is Bob\"\n",{"type":40,"tag":5001,"props":5002,"children":5003},"fix-infinite-loop",{},[5004,5078],{"type":40,"tag":281,"props":5005,"children":5006},{},[5007,5009],{"type":45,"value":5008},"\nSet recursion_limit in the invoke config to prevent runaway agent loops.\n",{"type":40,"tag":285,"props":5010,"children":5012},{"className":287,"code":5011,"language":281,"meta":289,"style":289},"# WRONG: No iteration limit - could loop forever\nresult = agent.invoke({\"messages\": [(\"user\", \"Do research\")]})\n\n# CORRECT: Set recursion_limit in config\nresult = agent.invoke(\n    {\"messages\": [(\"user\", \"Do research\")]},\n    config={\"recursion_limit\": 10},  # Stop after 10 steps\n)\n",[5013],{"type":40,"tag":64,"props":5014,"children":5015},{"__ignoreMap":289},[5016,5024,5032,5039,5047,5055,5063,5071],{"type":40,"tag":295,"props":5017,"children":5018},{"class":297,"line":298},[5019],{"type":40,"tag":295,"props":5020,"children":5021},{},[5022],{"type":45,"value":5023},"# WRONG: No iteration limit - could loop forever\n",{"type":40,"tag":295,"props":5025,"children":5026},{"class":297,"line":307},[5027],{"type":40,"tag":295,"props":5028,"children":5029},{},[5030],{"type":45,"value":5031},"result = agent.invoke({\"messages\": [(\"user\", \"Do research\")]})\n",{"type":40,"tag":295,"props":5033,"children":5034},{"class":297,"line":316},[5035],{"type":40,"tag":295,"props":5036,"children":5037},{"emptyLinePlaceholder":320},[5038],{"type":45,"value":323},{"type":40,"tag":295,"props":5040,"children":5041},{"class":297,"line":326},[5042],{"type":40,"tag":295,"props":5043,"children":5044},{},[5045],{"type":45,"value":5046},"# CORRECT: Set recursion_limit in config\n",{"type":40,"tag":295,"props":5048,"children":5049},{"class":297,"line":335},[5050],{"type":40,"tag":295,"props":5051,"children":5052},{},[5053],{"type":45,"value":5054},"result = agent.invoke(\n",{"type":40,"tag":295,"props":5056,"children":5057},{"class":297,"line":344},[5058],{"type":40,"tag":295,"props":5059,"children":5060},{},[5061],{"type":45,"value":5062},"    {\"messages\": [(\"user\", \"Do research\")]},\n",{"type":40,"tag":295,"props":5064,"children":5065},{"class":297,"line":353},[5066],{"type":40,"tag":295,"props":5067,"children":5068},{},[5069],{"type":45,"value":5070},"    config={\"recursion_limit\": 10},  # Stop after 10 steps\n",{"type":40,"tag":295,"props":5072,"children":5073},{"class":297,"line":361},[5074],{"type":40,"tag":295,"props":5075,"children":5076},{},[5077],{"type":45,"value":447},{"type":40,"tag":493,"props":5079,"children":5080},{},[5081,5083],{"type":45,"value":5082},"\nSet recursionLimit in the invoke config to prevent runaway agent loops.\n",{"type":40,"tag":285,"props":5084,"children":5086},{"className":498,"code":5085,"language":493,"meta":289,"style":289},"\u002F\u002F WRONG: No iteration limit\nconst result = await agent.invoke({ messages: [[\"user\", \"Do research\"]] });\n\n\u002F\u002F CORRECT: Set recursionLimit in config\nconst result = await agent.invoke(\n  { messages: [[\"user\", \"Do research\"]] },\n  { recursionLimit: 10 }, \u002F\u002F Stop after 10 steps\n);\n",[5087],{"type":40,"tag":64,"props":5088,"children":5089},{"__ignoreMap":289},[5090,5098,5196,5203,5211,5246,5303,5334],{"type":40,"tag":295,"props":5091,"children":5092},{"class":297,"line":298},[5093],{"type":40,"tag":295,"props":5094,"children":5095},{"style":1968},[5096],{"type":45,"value":5097},"\u002F\u002F WRONG: No iteration limit\n",{"type":40,"tag":295,"props":5099,"children":5100},{"class":297,"line":307},[5101,5105,5109,5113,5117,5121,5125,5129,5133,5137,5141,5145,5150,5154,5158,5162,5166,5170,5175,5179,5184,5188,5192],{"type":40,"tag":295,"props":5102,"children":5103},{"style":649},[5104],{"type":45,"value":652},{"type":40,"tag":295,"props":5106,"children":5107},{"style":521},[5108],{"type":45,"value":1083},{"type":40,"tag":295,"props":5110,"children":5111},{"style":515},[5112],{"type":45,"value":662},{"type":40,"tag":295,"props":5114,"children":5115},{"style":509},[5116],{"type":45,"value":1092},{"type":40,"tag":295,"props":5118,"children":5119},{"style":521},[5120],{"type":45,"value":1097},{"type":40,"tag":295,"props":5122,"children":5123},{"style":515},[5124],{"type":45,"value":830},{"type":40,"tag":295,"props":5126,"children":5127},{"style":665},[5128],{"type":45,"value":1106},{"type":40,"tag":295,"props":5130,"children":5131},{"style":521},[5132],{"type":45,"value":840},{"type":40,"tag":295,"props":5134,"children":5135},{"style":515},[5136],{"type":45,"value":845},{"type":40,"tag":295,"props":5138,"children":5139},{"style":755},[5140],{"type":45,"value":1762},{"type":40,"tag":295,"props":5142,"children":5143},{"style":515},[5144],{"type":45,"value":763},{"type":40,"tag":295,"props":5146,"children":5147},{"style":521},[5148],{"type":45,"value":5149}," [[",{"type":40,"tag":295,"props":5151,"children":5152},{"style":515},[5153],{"type":45,"value":549},{"type":40,"tag":295,"props":5155,"children":5156},{"style":542},[5157],{"type":45,"value":1153},{"type":40,"tag":295,"props":5159,"children":5160},{"style":515},[5161],{"type":45,"value":549},{"type":40,"tag":295,"props":5163,"children":5164},{"style":515},[5165],{"type":45,"value":1162},{"type":40,"tag":295,"props":5167,"children":5168},{"style":515},[5169],{"type":45,"value":539},{"type":40,"tag":295,"props":5171,"children":5172},{"style":542},[5173],{"type":45,"value":5174},"Do research",{"type":40,"tag":295,"props":5176,"children":5177},{"style":515},[5178],{"type":45,"value":549},{"type":40,"tag":295,"props":5180,"children":5181},{"style":521},[5182],{"type":45,"value":5183},"]] ",{"type":40,"tag":295,"props":5185,"children":5186},{"style":515},[5187],{"type":45,"value":726},{"type":40,"tag":295,"props":5189,"children":5190},{"style":521},[5191],{"type":45,"value":911},{"type":40,"tag":295,"props":5193,"children":5194},{"style":515},[5195],{"type":45,"value":554},{"type":40,"tag":295,"props":5197,"children":5198},{"class":297,"line":316},[5199],{"type":40,"tag":295,"props":5200,"children":5201},{"emptyLinePlaceholder":320},[5202],{"type":45,"value":323},{"type":40,"tag":295,"props":5204,"children":5205},{"class":297,"line":326},[5206],{"type":40,"tag":295,"props":5207,"children":5208},{"style":1968},[5209],{"type":45,"value":5210},"\u002F\u002F CORRECT: Set recursionLimit in config\n",{"type":40,"tag":295,"props":5212,"children":5213},{"class":297,"line":335},[5214,5218,5222,5226,5230,5234,5238,5242],{"type":40,"tag":295,"props":5215,"children":5216},{"style":649},[5217],{"type":45,"value":652},{"type":40,"tag":295,"props":5219,"children":5220},{"style":521},[5221],{"type":45,"value":1083},{"type":40,"tag":295,"props":5223,"children":5224},{"style":515},[5225],{"type":45,"value":662},{"type":40,"tag":295,"props":5227,"children":5228},{"style":509},[5229],{"type":45,"value":1092},{"type":40,"tag":295,"props":5231,"children":5232},{"style":521},[5233],{"type":45,"value":1097},{"type":40,"tag":295,"props":5235,"children":5236},{"style":515},[5237],{"type":45,"value":830},{"type":40,"tag":295,"props":5239,"children":5240},{"style":665},[5241],{"type":45,"value":1106},{"type":40,"tag":295,"props":5243,"children":5244},{"style":521},[5245],{"type":45,"value":672},{"type":40,"tag":295,"props":5247,"children":5248},{"class":297,"line":344},[5249,5254,5258,5262,5266,5270,5274,5278,5282,5286,5290,5294,5298],{"type":40,"tag":295,"props":5250,"children":5251},{"style":515},[5252],{"type":45,"value":5253},"  {",{"type":40,"tag":295,"props":5255,"children":5256},{"style":755},[5257],{"type":45,"value":1762},{"type":40,"tag":295,"props":5259,"children":5260},{"style":515},[5261],{"type":45,"value":763},{"type":40,"tag":295,"props":5263,"children":5264},{"style":521},[5265],{"type":45,"value":5149},{"type":40,"tag":295,"props":5267,"children":5268},{"style":515},[5269],{"type":45,"value":549},{"type":40,"tag":295,"props":5271,"children":5272},{"style":542},[5273],{"type":45,"value":1153},{"type":40,"tag":295,"props":5275,"children":5276},{"style":515},[5277],{"type":45,"value":549},{"type":40,"tag":295,"props":5279,"children":5280},{"style":515},[5281],{"type":45,"value":1162},{"type":40,"tag":295,"props":5283,"children":5284},{"style":515},[5285],{"type":45,"value":539},{"type":40,"tag":295,"props":5287,"children":5288},{"style":542},[5289],{"type":45,"value":5174},{"type":40,"tag":295,"props":5291,"children":5292},{"style":515},[5293],{"type":45,"value":549},{"type":40,"tag":295,"props":5295,"children":5296},{"style":521},[5297],{"type":45,"value":5183},{"type":40,"tag":295,"props":5299,"children":5300},{"style":515},[5301],{"type":45,"value":5302},"},\n",{"type":40,"tag":295,"props":5304,"children":5305},{"class":297,"line":353},[5306,5310,5315,5319,5324,5329],{"type":40,"tag":295,"props":5307,"children":5308},{"style":515},[5309],{"type":45,"value":5253},{"type":40,"tag":295,"props":5311,"children":5312},{"style":755},[5313],{"type":45,"value":5314}," recursionLimit",{"type":40,"tag":295,"props":5316,"children":5317},{"style":515},[5318],{"type":45,"value":763},{"type":40,"tag":295,"props":5320,"children":5321},{"style":1270},[5322],{"type":45,"value":5323}," 10",{"type":40,"tag":295,"props":5325,"children":5326},{"style":515},[5327],{"type":45,"value":5328}," },",{"type":40,"tag":295,"props":5330,"children":5331},{"style":1968},[5332],{"type":45,"value":5333}," \u002F\u002F Stop after 10 steps\n",{"type":40,"tag":295,"props":5335,"children":5336},{"class":297,"line":361},[5337,5341],{"type":40,"tag":295,"props":5338,"children":5339},{"style":521},[5340],{"type":45,"value":911},{"type":40,"tag":295,"props":5342,"children":5343},{"style":515},[5344],{"type":45,"value":554},{"type":40,"tag":5346,"props":5347,"children":5348},"fix-accessing-result-wrong",{},[5349,5415],{"type":40,"tag":281,"props":5350,"children":5351},{},[5352,5354],{"type":45,"value":5353},"\nAccess the messages array from the result, not result.content directly.\n",{"type":40,"tag":285,"props":5355,"children":5357},{"className":287,"code":5356,"language":281,"meta":289,"style":289},"# WRONG: Trying to access result.content directly\nresult = agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]})\nprint(result.content)  # AttributeError!\n\n# CORRECT: Access messages from result dict\nresult = agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]})\nprint(result[\"messages\"][-1].content)  # Last message content\n",[5358],{"type":40,"tag":64,"props":5359,"children":5360},{"__ignoreMap":289},[5361,5369,5377,5385,5392,5400,5407],{"type":40,"tag":295,"props":5362,"children":5363},{"class":297,"line":298},[5364],{"type":40,"tag":295,"props":5365,"children":5366},{},[5367],{"type":45,"value":5368},"# WRONG: Trying to access result.content directly\n",{"type":40,"tag":295,"props":5370,"children":5371},{"class":297,"line":307},[5372],{"type":40,"tag":295,"props":5373,"children":5374},{},[5375],{"type":45,"value":5376},"result = agent.invoke({\"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}]})\n",{"type":40,"tag":295,"props":5378,"children":5379},{"class":297,"line":316},[5380],{"type":40,"tag":295,"props":5381,"children":5382},{},[5383],{"type":45,"value":5384},"print(result.content)  # AttributeError!\n",{"type":40,"tag":295,"props":5386,"children":5387},{"class":297,"line":326},[5388],{"type":40,"tag":295,"props":5389,"children":5390},{"emptyLinePlaceholder":320},[5391],{"type":45,"value":323},{"type":40,"tag":295,"props":5393,"children":5394},{"class":297,"line":335},[5395],{"type":40,"tag":295,"props":5396,"children":5397},{},[5398],{"type":45,"value":5399},"# CORRECT: Access messages from result dict\n",{"type":40,"tag":295,"props":5401,"children":5402},{"class":297,"line":344},[5403],{"type":40,"tag":295,"props":5404,"children":5405},{},[5406],{"type":45,"value":5376},{"type":40,"tag":295,"props":5408,"children":5409},{"class":297,"line":353},[5410],{"type":40,"tag":295,"props":5411,"children":5412},{},[5413],{"type":45,"value":5414},"print(result[\"messages\"][-1].content)  # Last message content\n",{"type":40,"tag":493,"props":5416,"children":5417},{},[5418,5419],{"type":45,"value":5353},{"type":40,"tag":285,"props":5420,"children":5422},{"className":498,"code":5421,"language":493,"meta":289,"style":289},"\u002F\u002F WRONG: Trying to access result.content directly\nconst result = await agent.invoke({ messages: [{ role: \"user\", content: \"Hello\" }] });\nconsole.log(result.content); \u002F\u002F undefined!\n\n\u002F\u002F CORRECT: Access messages from result object\nconst result = await agent.invoke({ messages: [{ role: \"user\", content: \"Hello\" }] });\nconsole.log(result.messages[result.messages.length - 1].content); \u002F\u002F Last message content\n",[5423],{"type":40,"tag":64,"props":5424,"children":5425},{"__ignoreMap":289},[5426,5434,5554,5591,5598,5606,5725],{"type":40,"tag":295,"props":5427,"children":5428},{"class":297,"line":298},[5429],{"type":40,"tag":295,"props":5430,"children":5431},{"style":1968},[5432],{"type":45,"value":5433},"\u002F\u002F WRONG: Trying to access result.content directly\n",{"type":40,"tag":295,"props":5435,"children":5436},{"class":297,"line":307},[5437,5441,5445,5449,5453,5457,5461,5465,5469,5473,5477,5481,5485,5489,5493,5497,5501,5505,5509,5513,5517,5521,5525,5530,5534,5538,5542,5546,5550],{"type":40,"tag":295,"props":5438,"children":5439},{"style":649},[5440],{"type":45,"value":652},{"type":40,"tag":295,"props":5442,"children":5443},{"style":521},[5444],{"type":45,"value":1083},{"type":40,"tag":295,"props":5446,"children":5447},{"style":515},[5448],{"type":45,"value":662},{"type":40,"tag":295,"props":5450,"children":5451},{"style":509},[5452],{"type":45,"value":1092},{"type":40,"tag":295,"props":5454,"children":5455},{"style":521},[5456],{"type":45,"value":1097},{"type":40,"tag":295,"props":5458,"children":5459},{"style":515},[5460],{"type":45,"value":830},{"type":40,"tag":295,"props":5462,"children":5463},{"style":665},[5464],{"type":45,"value":1106},{"type":40,"tag":295,"props":5466,"children":5467},{"style":521},[5468],{"type":45,"value":840},{"type":40,"tag":295,"props":5470,"children":5471},{"style":515},[5472],{"type":45,"value":845},{"type":40,"tag":295,"props":5474,"children":5475},{"style":755},[5476],{"type":45,"value":1762},{"type":40,"tag":295,"props":5478,"children":5479},{"style":515},[5480],{"type":45,"value":763},{"type":40,"tag":295,"props":5482,"children":5483},{"style":521},[5484],{"type":45,"value":1131},{"type":40,"tag":295,"props":5486,"children":5487},{"style":515},[5488],{"type":45,"value":845},{"type":40,"tag":295,"props":5490,"children":5491},{"style":755},[5492],{"type":45,"value":1140},{"type":40,"tag":295,"props":5494,"children":5495},{"style":515},[5496],{"type":45,"value":763},{"type":40,"tag":295,"props":5498,"children":5499},{"style":515},[5500],{"type":45,"value":539},{"type":40,"tag":295,"props":5502,"children":5503},{"style":542},[5504],{"type":45,"value":1153},{"type":40,"tag":295,"props":5506,"children":5507},{"style":515},[5508],{"type":45,"value":549},{"type":40,"tag":295,"props":5510,"children":5511},{"style":515},[5512],{"type":45,"value":1162},{"type":40,"tag":295,"props":5514,"children":5515},{"style":755},[5516],{"type":45,"value":1167},{"type":40,"tag":295,"props":5518,"children":5519},{"style":515},[5520],{"type":45,"value":763},{"type":40,"tag":295,"props":5522,"children":5523},{"style":515},[5524],{"type":45,"value":539},{"type":40,"tag":295,"props":5526,"children":5527},{"style":542},[5528],{"type":45,"value":5529},"Hello",{"type":40,"tag":295,"props":5531,"children":5532},{"style":515},[5533],{"type":45,"value":549},{"type":40,"tag":295,"props":5535,"children":5536},{"style":515},[5537],{"type":45,"value":529},{"type":40,"tag":295,"props":5539,"children":5540},{"style":521},[5541],{"type":45,"value":1828},{"type":40,"tag":295,"props":5543,"children":5544},{"style":515},[5545],{"type":45,"value":726},{"type":40,"tag":295,"props":5547,"children":5548},{"style":521},[5549],{"type":45,"value":911},{"type":40,"tag":295,"props":5551,"children":5552},{"style":515},[5553],{"type":45,"value":554},{"type":40,"tag":295,"props":5555,"children":5556},{"class":297,"line":316},[5557,5561,5565,5569,5573,5577,5581,5586],{"type":40,"tag":295,"props":5558,"children":5559},{"style":521},[5560],{"type":45,"value":1221},{"type":40,"tag":295,"props":5562,"children":5563},{"style":515},[5564],{"type":45,"value":830},{"type":40,"tag":295,"props":5566,"children":5567},{"style":665},[5568],{"type":45,"value":1230},{"type":40,"tag":295,"props":5570,"children":5571},{"style":521},[5572],{"type":45,"value":1235},{"type":40,"tag":295,"props":5574,"children":5575},{"style":515},[5576],{"type":45,"value":830},{"type":40,"tag":295,"props":5578,"children":5579},{"style":521},[5580],{"type":45,"value":1286},{"type":40,"tag":295,"props":5582,"children":5583},{"style":515},[5584],{"type":45,"value":5585},";",{"type":40,"tag":295,"props":5587,"children":5588},{"style":1968},[5589],{"type":45,"value":5590}," \u002F\u002F undefined!\n",{"type":40,"tag":295,"props":5592,"children":5593},{"class":297,"line":326},[5594],{"type":40,"tag":295,"props":5595,"children":5596},{"emptyLinePlaceholder":320},[5597],{"type":45,"value":323},{"type":40,"tag":295,"props":5599,"children":5600},{"class":297,"line":335},[5601],{"type":40,"tag":295,"props":5602,"children":5603},{"style":1968},[5604],{"type":45,"value":5605},"\u002F\u002F CORRECT: Access messages from result object\n",{"type":40,"tag":295,"props":5607,"children":5608},{"class":297,"line":344},[5609,5613,5617,5621,5625,5629,5633,5637,5641,5645,5649,5653,5657,5661,5665,5669,5673,5677,5681,5685,5689,5693,5697,5701,5705,5709,5713,5717,5721],{"type":40,"tag":295,"props":5610,"children":5611},{"style":649},[5612],{"type":45,"value":652},{"type":40,"tag":295,"props":5614,"children":5615},{"style":521},[5616],{"type":45,"value":1083},{"type":40,"tag":295,"props":5618,"children":5619},{"style":515},[5620],{"type":45,"value":662},{"type":40,"tag":295,"props":5622,"children":5623},{"style":509},[5624],{"type":45,"value":1092},{"type":40,"tag":295,"props":5626,"children":5627},{"style":521},[5628],{"type":45,"value":1097},{"type":40,"tag":295,"props":5630,"children":5631},{"style":515},[5632],{"type":45,"value":830},{"type":40,"tag":295,"props":5634,"children":5635},{"style":665},[5636],{"type":45,"value":1106},{"type":40,"tag":295,"props":5638,"children":5639},{"style":521},[5640],{"type":45,"value":840},{"type":40,"tag":295,"props":5642,"children":5643},{"style":515},[5644],{"type":45,"value":845},{"type":40,"tag":295,"props":5646,"children":5647},{"style":755},[5648],{"type":45,"value":1762},{"type":40,"tag":295,"props":5650,"children":5651},{"style":515},[5652],{"type":45,"value":763},{"type":40,"tag":295,"props":5654,"children":5655},{"style":521},[5656],{"type":45,"value":1131},{"type":40,"tag":295,"props":5658,"children":5659},{"style":515},[5660],{"type":45,"value":845},{"type":40,"tag":295,"props":5662,"children":5663},{"style":755},[5664],{"type":45,"value":1140},{"type":40,"tag":295,"props":5666,"children":5667},{"style":515},[5668],{"type":45,"value":763},{"type":40,"tag":295,"props":5670,"children":5671},{"style":515},[5672],{"type":45,"value":539},{"type":40,"tag":295,"props":5674,"children":5675},{"style":542},[5676],{"type":45,"value":1153},{"type":40,"tag":295,"props":5678,"children":5679},{"style":515},[5680],{"type":45,"value":549},{"type":40,"tag":295,"props":5682,"children":5683},{"style":515},[5684],{"type":45,"value":1162},{"type":40,"tag":295,"props":5686,"children":5687},{"style":755},[5688],{"type":45,"value":1167},{"type":40,"tag":295,"props":5690,"children":5691},{"style":515},[5692],{"type":45,"value":763},{"type":40,"tag":295,"props":5694,"children":5695},{"style":515},[5696],{"type":45,"value":539},{"type":40,"tag":295,"props":5698,"children":5699},{"style":542},[5700],{"type":45,"value":5529},{"type":40,"tag":295,"props":5702,"children":5703},{"style":515},[5704],{"type":45,"value":549},{"type":40,"tag":295,"props":5706,"children":5707},{"style":515},[5708],{"type":45,"value":529},{"type":40,"tag":295,"props":5710,"children":5711},{"style":521},[5712],{"type":45,"value":1828},{"type":40,"tag":295,"props":5714,"children":5715},{"style":515},[5716],{"type":45,"value":726},{"type":40,"tag":295,"props":5718,"children":5719},{"style":521},[5720],{"type":45,"value":911},{"type":40,"tag":295,"props":5722,"children":5723},{"style":515},[5724],{"type":45,"value":554},{"type":40,"tag":295,"props":5726,"children":5727},{"class":297,"line":353},[5728,5732,5736,5740,5744,5748,5752,5756,5760,5764,5768,5772,5776,5780,5784,5788,5792],{"type":40,"tag":295,"props":5729,"children":5730},{"style":521},[5731],{"type":45,"value":1221},{"type":40,"tag":295,"props":5733,"children":5734},{"style":515},[5735],{"type":45,"value":830},{"type":40,"tag":295,"props":5737,"children":5738},{"style":665},[5739],{"type":45,"value":1230},{"type":40,"tag":295,"props":5741,"children":5742},{"style":521},[5743],{"type":45,"value":1235},{"type":40,"tag":295,"props":5745,"children":5746},{"style":515},[5747],{"type":45,"value":830},{"type":40,"tag":295,"props":5749,"children":5750},{"style":521},[5751],{"type":45,"value":1244},{"type":40,"tag":295,"props":5753,"children":5754},{"style":515},[5755],{"type":45,"value":830},{"type":40,"tag":295,"props":5757,"children":5758},{"style":521},[5759],{"type":45,"value":1253},{"type":40,"tag":295,"props":5761,"children":5762},{"style":515},[5763],{"type":45,"value":830},{"type":40,"tag":295,"props":5765,"children":5766},{"style":521},[5767],{"type":45,"value":1262},{"type":40,"tag":295,"props":5769,"children":5770},{"style":515},[5771],{"type":45,"value":1267},{"type":40,"tag":295,"props":5773,"children":5774},{"style":1270},[5775],{"type":45,"value":1273},{"type":40,"tag":295,"props":5777,"children":5778},{"style":521},[5779],{"type":45,"value":1193},{"type":40,"tag":295,"props":5781,"children":5782},{"style":515},[5783],{"type":45,"value":830},{"type":40,"tag":295,"props":5785,"children":5786},{"style":521},[5787],{"type":45,"value":1286},{"type":40,"tag":295,"props":5789,"children":5790},{"style":515},[5791],{"type":45,"value":5585},{"type":40,"tag":295,"props":5793,"children":5794},{"style":1968},[5795],{"type":45,"value":5796}," \u002F\u002F Last message content\n",{"type":40,"tag":5798,"props":5799,"children":5800},"style",{},[5801],{"type":45,"value":5802},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":5804,"total":485},[5805,5818,5833,5851,5862,5873,5889],{"slug":5806,"name":5806,"fn":5807,"description":5808,"org":5809,"tags":5810,"stars":24,"repoUrl":25,"updatedAt":5817},"deep-agents-core","build applications with LangChain Deep Agents","INVOKE THIS SKILL when building ANY Deep Agents application. Covers create_deep_agent(), harness architecture, SKILL.md format, and configuration options.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5811,5812,5815,5816],{"name":19,"slug":20,"type":16},{"name":5813,"slug":5814,"type":16},"Architecture","architecture",{"name":9,"slug":8,"type":16},{"name":14,"slug":15,"type":16},"2026-04-06T18:26:24.822592",{"slug":5819,"name":5819,"fn":5820,"description":5821,"org":5822,"tags":5823,"stars":24,"repoUrl":25,"updatedAt":5832},"deep-agents-memory","implement memory and persistence for Deep Agents","INVOKE THIS SKILL when your Deep Agent needs memory, persistence, or filesystem access. Covers StateBackend (ephemeral), StoreBackend (persistent), FilesystemMiddleware, and CompositeBackend for routing.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5824,5825,5826,5829],{"name":19,"slug":20,"type":16},{"name":9,"slug":8,"type":16},{"name":5827,"slug":5828,"type":16},"Memory","memory",{"name":5830,"slug":5831,"type":16},"Storage","storage","2026-04-06T18:26:26.065654",{"slug":5834,"name":5834,"fn":5835,"description":5836,"org":5837,"tags":5838,"stars":24,"repoUrl":25,"updatedAt":5850},"deep-agents-orchestration","orchestrate subagents and tasks in Deep Agents","INVOKE THIS SKILL when using subagents, task planning, or human approval in Deep Agents. Covers SubAgentMiddleware, TodoList for planning, and HITL interrupts.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5839,5840,5843,5844,5847],{"name":19,"slug":20,"type":16},{"name":5841,"slug":5842,"type":16},"Approvals","approvals",{"name":9,"slug":8,"type":16},{"name":5845,"slug":5846,"type":16},"Multi-Agent","multi-agent",{"name":5848,"slug":5849,"type":16},"Workflow Automation","workflow-automation","2026-04-06T18:26:32.280463",{"slug":5852,"name":5852,"fn":5853,"description":5854,"org":5855,"tags":5856,"stars":24,"repoUrl":25,"updatedAt":5861},"deepagents-python-quickstart","scaffold local Deep Agents","Scaffold a minimal local Deep Agent in Python by following the official quickstart, using provider-native web search instead of Tavily. Use when the user wants to quickly build or try a Deep Agent locally.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5857,5858,5859],{"name":19,"slug":20,"type":16},{"name":9,"slug":8,"type":16},{"name":5860,"slug":281,"type":16},"Python","2026-07-24T06:09:00.291108",{"slug":5863,"name":5863,"fn":5864,"description":5865,"org":5866,"tags":5867,"stars":24,"repoUrl":25,"updatedAt":5872},"deepagents-typescript-quickstart","build Deep Agents in TypeScript","Scaffold a minimal local Deep Agent in TypeScript by following the official quickstart, using provider-native web search instead of Tavily. Use when the user wants to quickly build or try a Deep Agent locally.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5868,5869,5870],{"name":19,"slug":20,"type":16},{"name":9,"slug":8,"type":16},{"name":5871,"slug":493,"type":16},"TypeScript","2026-07-24T06:09:00.673714",{"slug":5874,"name":5874,"fn":5875,"description":5876,"org":5877,"tags":5878,"stars":24,"repoUrl":25,"updatedAt":5888},"ecosystem-primer","select frameworks for LangChain and LangGraph agents","INVOKE FIRST for any LangChain \u002F LangGraph \u002F Deep Agents agent building project before consulting other skills or writing any agent code. Required starting point for up to date info on framework selection (LangChain vs LangGraph vs Deep Agents vs hybrid composition), agent patterns, install, environment setup, and which skill to load next.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5879,5880,5883,5884,5885],{"name":19,"slug":20,"type":16},{"name":5881,"slug":5882,"type":16},"AI Infrastructure","ai-infrastructure",{"name":5813,"slug":5814,"type":16},{"name":9,"slug":8,"type":16},{"name":5886,"slug":5887,"type":16},"LangGraph","langgraph","2026-07-24T05:42:48.348966",{"slug":5890,"name":5890,"fn":5891,"description":5892,"org":5893,"tags":5894,"stars":24,"repoUrl":25,"updatedAt":5906},"eval-engineering","create and audit Harbor agent evals","Iteratively inspect an agent repository and optional user-provided traces, interview the user, and create, run, and audit Harbor evals one at a time. Use for agent evals, Harbor tasks, benchmark cases, verifier design, or controlled agent environments.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5895,5896,5899,5902,5903],{"name":19,"slug":20,"type":16},{"name":5897,"slug":5898,"type":16},"Code Analysis","code-analysis",{"name":5900,"slug":5901,"type":16},"Evals","evals",{"name":9,"slug":8,"type":16},{"name":5904,"slug":5905,"type":16},"Testing","testing","2026-07-31T05:53:29.552458",{"items":5908,"total":6076},[5909,5930,5940,5957,5970,5985,5998,6011,6025,6035,6046,6065],{"slug":5910,"name":5910,"fn":5911,"description":5912,"org":5913,"tags":5914,"stars":5927,"repoUrl":5928,"updatedAt":5929},"analyze-market","perform market analysis and size estimation","Perform a market analysis for a product category or segment. Trigger on: market analysis, market size, TAM SAM SOM, market opportunity, industry analysis.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5915,5918,5921,5924],{"name":5916,"slug":5917,"type":16},"Marketing","marketing",{"name":5919,"slug":5920,"type":16},"Research","research",{"name":5922,"slug":5923,"type":16},"Sales","sales",{"name":5925,"slug":5926,"type":16},"Strategy","strategy",26592,"https:\u002F\u002Fgithub.com\u002Flangchain-ai\u002Fdeepagents","2026-04-18T04:46:54.557115",{"slug":5931,"name":5931,"fn":5932,"description":5933,"org":5934,"tags":5935,"stars":5927,"repoUrl":5928,"updatedAt":5939},"arxiv-search","search arXiv for academic research papers","Searches arXiv for preprints and academic papers, retrieves abstracts, and filters by topic. Use when the user asks to find research papers, search arXiv, look up preprints, find academic articles in physics, math, CS, biology, statistics, or related fields.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5936,5937],{"name":5919,"slug":5920,"type":16},{"name":5938,"slug":3910,"type":16},"Search","2026-05-13T06:11:01.203061",{"slug":5941,"name":5941,"fn":5942,"description":5943,"org":5944,"tags":5945,"stars":5927,"repoUrl":5928,"updatedAt":5956},"blog-post","write SEO-optimized blog posts","Write long-form blog posts with SEO optimization and clear structure.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5946,5949,5950,5953],{"name":5947,"slug":5948,"type":16},"Content Creation","content-creation",{"name":5916,"slug":5917,"type":16},{"name":5951,"slug":5952,"type":16},"SEO","seo",{"name":5954,"slug":5955,"type":16},"Writing","writing","2026-04-15T05:00:54.149813",{"slug":5958,"name":5958,"fn":5959,"description":5960,"org":5961,"tags":5962,"stars":5927,"repoUrl":5928,"updatedAt":5969},"competitor-analysis","analyze competitors and market positioning","Analyze competitors in a given market segment. Trigger on: competitive landscape, competitor analysis, market comparison, competitive positioning.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5963,5966,5967,5968],{"name":5964,"slug":5965,"type":16},"Competitive Intelligence","competitive-intelligence",{"name":5916,"slug":5917,"type":16},{"name":5919,"slug":5920,"type":16},{"name":5925,"slug":5926,"type":16},"2026-04-18T04:46:55.79306",{"slug":5971,"name":5971,"fn":5972,"description":5973,"org":5974,"tags":5975,"stars":5927,"repoUrl":5928,"updatedAt":5984},"deepagents-thread-inspector","inspect local Deep Agents conversation threads","Inspect and explain conversations in the local Deep Agents Code SQLite session store. Use as a fallback when LangSmith trace tooling is unavailable, for offline or untraced sessions, or when asked to identify or summarize a local dcode thread, inspect checkpoint metadata, list recent local threads, or parse ~\u002F.deepagents\u002F.state\u002Fsessions.db and a thread UUID or prefix.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5976,5977,5980,5981],{"name":19,"slug":20,"type":16},{"name":5978,"slug":5979,"type":16},"Debugging","debugging",{"name":9,"slug":8,"type":16},{"name":5982,"slug":5983,"type":16},"SQLite","sqlite","2026-07-24T06:08:57.102689",{"slug":5986,"name":5986,"fn":5987,"description":5988,"org":5989,"tags":5990,"stars":5927,"repoUrl":5928,"updatedAt":5997},"langgraph-docs","build stateful agents with LangGraph","Fetches and references LangGraph Python documentation to build stateful agents, create multi-agent workflows, and implement human-in-the-loop patterns. Use when the user asks about LangGraph, graph agents, state machines, agent orchestration, LangGraph API, or needs LangGraph implementation guidance.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[5991,5992,5995,5996],{"name":19,"slug":20,"type":16},{"name":5993,"slug":5994,"type":16},"Documentation","documentation",{"name":5886,"slug":5887,"type":16},{"name":5845,"slug":5846,"type":16},"2026-05-13T06:11:03.650877",{"slug":5999,"name":5999,"fn":6000,"description":6001,"org":6002,"tags":6003,"stars":5927,"repoUrl":5928,"updatedAt":6010},"remember","capture knowledge into persistent memory","Review the current conversation and capture valuable knowledge — best practices, coding conventions, architecture decisions, workflows, and user feedback — into persistent memory (AGENTS.md) or reusable skills. Use when the user says: (1) remember this, (2) save what we learned, (3) update memory, (4) capture learnings.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[6004,6005,6006,6009],{"name":19,"slug":20,"type":16},{"name":5993,"slug":5994,"type":16},{"name":6007,"slug":6008,"type":16},"Knowledge Management","knowledge-management",{"name":5827,"slug":5828,"type":16},"2026-05-13T06:10:58.510037",{"slug":6012,"name":6012,"fn":6013,"description":6014,"org":6015,"tags":6016,"stars":5927,"repoUrl":5928,"updatedAt":6024},"skill-creator","create agent skills and tool integrations","Guide for creating effective skills that extend agent capabilities with specialized knowledge, workflows, or tool integrations. Use this skill when the user asks to: (1) create a new skill, (2) make a skill, (3) build a skill, (4) set up a skill, (5) initialize a skill, (6) scaffold a skill, (7) update or modify an existing skill, (8) validate a skill, (9) learn about skill structure, (10) understand how skills work, or (11) get guidance on skill design patterns. Trigger on phrases like \"create a skill\", \"new skill\", \"make a skill\", \"skill for X\", \"how do I create a skill\", or \"help me build a skill\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[6017,6018,6021],{"name":19,"slug":20,"type":16},{"name":6019,"slug":6020,"type":16},"Engineering","engineering",{"name":6022,"slug":6023,"type":16},"Plugin Development","plugin-development","2026-05-13T06:10:59.88449",{"slug":6026,"name":6026,"fn":6027,"description":6028,"org":6029,"tags":6030,"stars":5927,"repoUrl":5928,"updatedAt":6034},"social-media","create optimized social media posts","Create social media posts optimized for engagement across platforms.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[6031,6032,6033],{"name":5947,"slug":5948,"type":16},{"name":5916,"slug":5917,"type":16},{"name":5954,"slug":5955,"type":16},"2026-04-15T05:00:55.37452",{"slug":6036,"name":6036,"fn":6037,"description":6038,"org":6039,"tags":6040,"stars":5927,"repoUrl":5928,"updatedAt":6045},"web-research","conduct and synthesize web research","Searches multiple web sources, synthesizes findings, and produces cited research reports using delegated subagents. Use when the user asks to research a topic online, search the web, look something up, find current information, compare options, or produce a research report.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[6041,6042,6043,6044],{"name":19,"slug":20,"type":16},{"name":5845,"slug":5846,"type":16},{"name":5919,"slug":5920,"type":16},{"name":5938,"slug":3910,"type":16},"2026-05-13T06:11:04.930044",{"slug":6047,"name":6047,"fn":6048,"description":6049,"org":6050,"tags":6051,"stars":6062,"repoUrl":6063,"updatedAt":6064},"mermaid-diagrams","embed Mermaid diagrams in documentation","Embed Mermaid diagrams in generated wiki pages. Use whenever documenting a runtime or request flow, a call sequence, a state machine or lifecycle, a data model or entity relationships, or non-trivial control flow, since these are clearer as a diagram than as prose. Also use when an update run touches a page that already contains a mermaid fence, or a page that contains a text fence a previous run degraded.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[6052,6055,6056,6059],{"name":6053,"slug":6054,"type":16},"Diagrams","diagrams",{"name":5993,"slug":5994,"type":16},{"name":6057,"slug":6058,"type":16},"Markdown","markdown",{"name":6060,"slug":6061,"type":16},"Technical Writing","technical-writing",12181,"https:\u002F\u002Fgithub.com\u002Flangchain-ai\u002Fopenwiki","2026-07-24T06:09:01.089597",{"slug":6066,"name":6066,"fn":6067,"description":6068,"org":6069,"tags":6070,"stars":6062,"repoUrl":6063,"updatedAt":6075},"write-connector","implement OpenWiki source connectors","Add a new built-in OpenWiki source connector. Use when a user asks to create or implement an OpenWiki connector.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[6071,6072],{"name":22,"slug":23,"type":16},{"name":6073,"slug":6074,"type":16},"Integrations","integrations","2026-07-18T05:48:23.961804",41]