Overview
The document analysis agent:- Ingests content from direct input, file uploads, or URLs
- Extracts structured insights: summary, keywords, sentiment, readability
- Runs online or offline: Uses OpenAI if API key is set, otherwise fallback
- Provides HTTP API: RESTful endpoint for programmatic access
- Includes web UI: Modern SPA interface embedded in the deployment
- Returns HTML reports: Visualization for the ZenML dashboard
Source code
The complete example is available at:Quick start
Installation
Deploy the pipeline
Invoke the agent
Via CLI
Via HTTP API
Via web interface
Visit the deployment URL in your browser:- Direct Content: Paste or type content directly
- Upload File: Upload text files, markdown, or HTML
- URL: Analyze content from a URL
Pipeline structure
Pipeline steps
1. Document ingestion
2. Document analysis
3. Report generation
LLM analysis implementation
Deterministic fallback
Web UI
The embedded web interface (ui/index.html) provides:
- Multi-tab interface: Direct content, file upload, or URL analysis
- Real-time feedback: Loading states and error messages
- Results display: Summary, sentiment, keywords, metrics
- Responsive design: Works on desktop and mobile
- Zero configuration: Automatically served at deployment URL
DeploymentSettings:
Deployment configuration
Docker settings
Custom configuration
Create a YAML config for advanced settings:Production considerations
- Authentication: Enable
generate_auth_keyfor production - Rate limiting: Implement request throttling
- Monitoring: Track latency, errors, and token usage
- Scaling: Configure replica count for high traffic
- Costs: Monitor OpenAI API usage and costs
- Fallback: Ensure deterministic analysis works without API key
- Error handling: Return user-friendly error messages
- Validation: Sanitize and validate all inputs
Testing the deployment
Health check
Test analysis
Expected response
Next steps
Agent comparison
Compare multiple agent architectures systematically
Framework integrations
Examples for 12+ agent frameworks
Orchestrating agents
Production orchestration patterns
Agent evaluation
Build systematic evaluation pipelines
