This directory contains example agents demonstrating different capabilities of the WorkflowAI SDK.
A simple agent that takes a city name and returns information about its country's capital. Demonstrates:
- Basic agent creation with input/output models
- Field descriptions and examples
- Cost and latency tracking
Shows how to create agents that can use tools to enhance their capabilities:
- Using hosted tools (@browser-text, @search)
- Creating custom tools
- Handling tool responses
Demonstrates different caching options in WorkflowAI using a medical SOAP notes extractor:
- 'auto' - Cache only when temperature is 0 (default)
- 'always' - Always use cache if available
- 'never' - Never use cache, always execute new runs
An agent that analyzes audio recordings for spam/robocall detection. Demonstrates:
- Using audio files as input
- Structured classification with confidence scores
- Detailed reasoning about audio content
Required asset:
assets/call.mp3- Example audio file for spam detection
05_browser_text_uptime_agent.py
Demonstrates using the @browser-text tool to:
- Fetch content from status pages
- Extract uptime percentages
- Handle different page formats
- Process real-time web data
Shows how to use streaming to get real-time output from agents:
- Stream translations as they're generated
- Track progress with chunk numbers
- Access run metadata (cost, latency)
An agent that identifies cities from images. Given a photo of a city, it:
- Identifies the city and country
- Explains the reasoning behind the identification
- Lists key landmarks or architectural features
- Provides confidence level in the identification
Required asset:
assets/new-york-city.jpg- Example city image for identification
An agent that answers questions about PDF documents. Given a PDF and a question, it:
- Analyzes the PDF content
- Provides a clear and concise answer
- Includes relevant quotes from the document to support its answer
Required asset:
assets/sec-form-4.pdf- Example SEC form for document analysis
The workflows directory contains examples of different workflow patterns for complex tasks:
- Chain of Agents - Process long documents by breaking them into chunks
- Routing - Direct queries to specialized agents based on type
- Parallel Processing - Run multiple analyses concurrently
- Orchestrator-Worker - Coordinate multiple agents for complex tasks
See workflows/README.md for detailed information about each pattern.
All example assets should be placed in the assets/ directory at the root of the project:
workflowai-py/
├── assets/
│ ├── call.mp3 # For audio classifier
│ ├── new-york-city.jpg # For image agent
│ └── sec-form-4.pdf # For PDF agent
├── examples/
│ ├── 01_basic_agent.py
│ ├── 02_agent_with_tools.py
│ └── ...
- Make sure you have the required assets in the
assets/directory - Set up your environment variables in
.env:WORKFLOWAI_API_KEY=your_api_key - Run any example using Python:
python examples/01_basic_agent.py