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
One-shot CLI
Attach an image to a singlepraisonai run — the fastest way to ask about a screenshot, mockup, or diagram without writing any code.
--image for multiple images (never comma-separate one value). The run picks a vision-capable model, defaulting to gpt-4o; override with --model.
See Run — Attach an image for the full option, guards, and behaviour.
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
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= on agent.chat(), agent.start() (streaming or not), or ephemeral() so image bytes do not fill chat history.Ephemeral Attachments
Send files to the agent for analysis without storing them in chat history. Essential for preventing context window overflow when processing multiple files.attachments= now accepts images, PDFs, audio, video, text files, URLs, data: URIs, and pathlib.Path objects — not only images. Each entry is routed by its type and the model’s capability.
The full attachment router — the raise-vs-warn split, the capability helpers, and the degradation labels — is documented in Attachments.
- Attachments Parameter
- Streaming
- Ephemeral Context Manager
History Management Methods
Clean up chat history after image analysis sessions:Use
attachments= for one-time image analysis — on agent.chat() or agent.start(stream=True) — 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
Attachments
Attach PDFs, audio, text, video, URLs and Path objects — no silent drops.
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.

