The Claude Agent SDK provides an agent runtime with built-in tool execution, hooks, context management, MCP integration, and subagents. This tutorial builds a Python code-review agent and explains `query()` for one-shot work, `ClaudeSDKClient` for persistent sessions, custom tools for pull-request analysis, and guardrails for read-only execution and cost control. It also covers built-in tools such as `Read`, `Glob`, `Grep`, and `Bash`, plus deployment patterns for sandboxing, session management, and CI workflows.
AI agent frameworks in March 2026 have evolved from experimental ReAct loops into robust production systems offering state management, tool orchestration, and multi-step reasoning capabilities. This comparison evaluates six major libraries—LangGraph v1.0.10, CrewAI v1.10.1, AutoGen, Smolagents, OpenAI Agents SDK v0.10.2, and Claude Agent SDK v0.1.48—using a standardized email triage benchmark. Each framework demonstrates distinct architectural philosophies, from LangGraph's graph-based state machines that excel at complex branching logic to CrewAI's role-playing team structures designed for collaborative tasks. The analysis highlights critical features including native Model Context Protocol (MCP) support, human-in-the-loop checkpoints, and persistent memory across sessions. Developers selecting an agent framework must balance the need for granular control found in graph-based approaches against the rapid prototyping advantages of higher-level abstractions. Reading this guide enables software engineers to select the optimal Python or TypeScript framework for building autonomous agents based on specific requirements for observability, scalability, and model independence.
Function calling is the critical capability that transforms a passive large language model into an autonomous AI agent capable of executing real-world operations. This mechanism relies on a structured protocol where the model outputs JSON objects rather than executing code directly, allowing developers to define schemas that map natural language requests to specific API endpoints. The process involves defining clear tool schemas using JSON Schema standards, parsing the model's structured output, executing functions like getbalance or transfermoney within the application environment, and returning results for the model to interpret. Mastering tool use requires understanding that LLMs do not browse the web or run Python scripts natively but instead generate instructions for external systems to fulfill. Developers must prioritize rigorous schema definitions and handling edge cases in argument generation to prevent hallucinations or execution errors. By implementing robust function calling pipelines, engineers can build sophisticated financial assistants, data analysis bots, and customer service agents that reliably interact with databases, CRM systems, and third-party APIs.