After this lesson, you will be able to: Understand AI agents: tool calling, agent frameworks (LangChain, CrewAI), and the Model Context Protocol.
An agent is an LLM with tools and a loop: think → act → observe → repeat. This lesson covers tool calling fundamentals, the major frameworks, and the emerging MCP standard.
Plain LLM: input → output. Agent: input → think → call tool → see result → think again → ... → output. The loop is what makes them useful for tasks beyond a single response.
Define tools. Model decides when to call them.
tools = [{"name": "get_weather","description": "Get current weather in a city","input_schema": {"type": "object","properties": {"city": {"type": "string"}},"required": ["city"],},}]response = client.messages.create(model="claude-sonnet-4-6",max_tokens=1024,tools=tools,messages=[{"role": "user", "content": "Weather in Paris?"}],)# Inspect response.content for tool_use blocks# Execute tool, send result back, loop until response is final.
LangChain, most popular, broad ecosystem, sometimes over-engineered for simple cases.
LlamaIndex. RAG-focused.
CrewAI, multi-agent crews (different specialized agents collaborate).
AutoGen (Microsoft), research-grade multi-agent.
Anthropic Agent SDK, first-party for Claude.
DIY, for many cases, just a while loop with tool calls is enough.
Failure modes: infinite loops, hallucinated tool calls, runaway costs, security (prompt injection through tool outputs). Add: max iterations, tool authorization, monitoring, rollback on failure.
Sign in and purchase access to unlock this lesson.