Skip to main content
Multimodal agents process text, images, and video in a single workflow — attach media to tasks or pass ephemeral attachments at chat time.
The user attaches media; the agent returns a single analysis covering text and visuals.

How It Works

Quick Start

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

Configuration Options

Best Practices

Prefer JPEG and PNG for images; keep file sizes reasonable and validate paths before processing.
Set llm to a model with vision support (e.g. gpt-4o-mini) when attaching images or video.
Break complex analyses into steps and specify expected output format in each task.
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.

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.

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.