langchain-core-workflow-b

Featured

Build LangChain agents with tool calling for autonomous task execution. Use when creating AI agents, implementing tool/function calling, binding tools to models, or building autonomous multi-step workflows. Trigger: "langchain agents", "langchain tools", "tool calling", "create agent", "function calling", "createToolCallingAgent".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# LangChain Core Workflow B: Agents & Tools ## Overview Build autonomous agents that use tools, make decisions, and execute multi-step tasks. Covers tool definition with Zod schemas, `createToolCallingAgent`, `AgentExecutor`, streaming agent output, and conversation memory. ## Prerequisites - Completed `langchain-core-workflow-a` (chains) - `npm install langchain @langchain/core @langchain/openai zod` ## Step 1: Define Tools (TypeScript) ```typescript import { tool } from "@langchain/core/tools"; import { z } from "zod"; // Tool with Zod schema validation const calculator = tool( async ({ expression }) => { try { // Use a safe math parser in production (e.g., mathjs) const result = Function(`"use strict"; return (${expression})`)(); return String(result); } catch (e) { return `Error: invalid expression "${expression}"`; } }, { name: "calculator", description: "Evaluate a mathematical expression. Input: a math expression string.", schema: z.object({ expression: z.string().describe("Math expression like '2 + 2' or '100 * 0.15'"), }), } ); const weatherLookup = tool( async ({ city }) => { // Replace with real API call const data: Record<string, string> = { "New York": "72F, sunny", "London": "58F, cloudy", "Tokyo": "80F, humid", }; return data[city] ?? `No weather data for ${city}`; }, { name: "weather", description: "Get current weather for a city.", sch...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category