Browse by problem
Find examples by the agentic design failure mode they prevent.
Delegation failures
Examples in this group address agents that act without a clear boundary: taking destructive actions without approval, assuming intent from incomplete context, or proceeding past failure without surfacing it. Look for examples tagged with the delegation cluster principles.
Visibility failures
Visibility failures include: background tasks that run silently with no progress feedback, async operations that complete with no confirmation, and agents that show internal state (log lines, token counts) instead of meaningful operational state. Examples in this group show the correct pattern for each failure type.
Trust and orchestration failures
Trust failures: actions that cannot be undone, handoffs without explicit user awareness, and approval flows that are bypassed under time pressure. Orchestration failures: pipelines that do not degrade gracefully, subagent errors that surface as generic failures, and output types that are not inspectable. Use search_examples via MCP to filter by cluster.
Model calls and outputs31
Introduction
Runnable example (beginner) for script using openai, python-dotenv.
Making Requests
Runnable example (beginner) for script using openai.
Streaming
Runnable example (beginner) for script using openai.
Introduction
Runnable example (beginner) for script using openai.
Agent patterns12
Level 1: Augmented LLM — Single API Call
One model call with structured output, system prompt, and context. No loops, no tools.
Level 2: Prompt Chains & Routing — Deterministic DAGs
Multiple LLM calls in a fixed sequence. Code controls the flow, not the model.
Level 3: Tool-Calling Agent — Scoped Autonomy
The agent decides which tools to call and in what order, but only within a fixed set of well-defined capabilities.
Level 4: Agent Harness — Full Runtime Access
Give the agent a full runtime via the agent runtime SDK. It can search files, read docs, and reason through problems autonomously.
Workflow and orchestration8
Basic
Runnable example (beginner) for script using openai.
Structured
Runnable example (beginner) for script using openai, pydantic.
Tools
Runnable example (beginner) for script using openai, pydantic.
Retrieval
Runnable example (beginner) for script using openai, pydantic.
MCP tool use14
Client Sse
Runnable example (advanced) for script using mcp.
Client Stdio
Runnable example (advanced) for script using mcp.
Client Streamable Http
Runnable example (advanced) for script using mcp.
Server
Runnable example (advanced) for script using mcp, python-dotenv.
Knowledge and retrieval11
Extraction
Runnable example (intermediate) for script using docling, ipykernel.
Chunking
Runnable example (intermediate) for script using docling, ipykernel.
Embedding
Runnable example (intermediate) for script using docling, ipykernel.
Search
Runnable example (intermediate) for script using docling, ipykernel.
Framework integrations10
Tutorial: Notebook to Web App in Five Minutes
This notebook shows how to turn a small Python function into a shareable interface with Gradio or Streamlit. It focuses on one clear input -> processing -> output flow so the app wrapper stays explicit and easy to review.
Quickstart
Runnable example (beginner) for script using pydantic.
Agents
Runnable example (intermediate) for script.
Dependencies
Runnable example (intermediate) for script using pydantic.
Context management10
Get Single Page
Runnable example (intermediate) for script using docling, openai.
Web Search
Runnable example (intermediate) for script using docling, openai.
Search Handbook
Search Agent
Runnable example (intermediate) for script using docling, openai.
Also in this section