How It Works
Quick Start
- Code
- No Code
1
Install Package
First, install the PraisonAI Agents package:
2
Set API Key
Set your OpenAI API key as an environment variable in your terminal:
3
Create a file
Create a new file
app.py with the basic setup:4
Start Agents
Type this in your terminal to run your agents:
Requirements
- Python 3.10 or higher
- OpenAI API key with vision model access
- Basic understanding of Python and media handling
Understanding Multimodal Agents
What are Multimodal Agents?
Multimodal agents are designed to:
- Process multiple types of data (text, images, videos)
- Understand context across different modalities
- Generate insights from diverse media sources
- Handle complex multimedia tasks
Features
Vision Processing
Analyze images, detect objects, and understand visual content.
Video Analysis
Process video content for events and actions.
Text Extraction
Extract and analyze text from images and documents.
Cross-Modal Understanding
Integrate insights across different media types.
Need the other direction — tools that hand images back to the agent? See Multimodal Tool Output.
Multi-Agent Media Processing
- Code
- No Code
Configuration Options
Best Practices
Use supported media formats
Use supported media formats
Prefer JPEG and PNG for images; keep file sizes reasonable and validate paths before processing.
Choose vision-capable models
Choose vision-capable models
Set
llm to a model with vision support (e.g. gpt-4o-mini) when attaching images or video.Write clear task descriptions
Write clear task descriptions
Break complex analyses into steps and specify expected output format in each task.
Prefer ephemeral attachments for large media
Prefer ephemeral attachments for large media
Use
attachments= or ephemeral() so image bytes do not fill chat history.Ephemeral Attachments
Send images to the agent for analysis without storing them in chat history. Essential for preventing context window overflow when processing multiple images.- Attachments Parameter
- Ephemeral Context Manager
History Management Methods
Clean up chat history after image analysis sessions:Use
attachments= for one-time image analysis, or ephemeral() for multi-turn image conversations that shouldn’t persist.Example Use Cases
Document Analysis
Extract and analyze text from document images.
Security Monitoring
Monitor security feeds for suspicious activity.
Medical Imaging
Analyze medical scans for abnormalities.
Architectural Analysis
Study architectural features and designs.
Related
Multimodal Tool Output
Return images and media from tools back to the agent.
Media Pipelines
Chain AudioAgent, ImageAgent, and VideoAgent in YAML workflows.
For optimal results, ensure your media files are in supported formats and sizes for processing.

