Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Image analysis agent using vision models for object detection and description.
Simple
Agents: 1 — Single agent with vision capabilities analyzes images.
Workflow
- Receive image (URL or local file)
- Process with vision model
- Generate detailed description
Setup
pip install praisonaiagents praisonai
export OPENAI_API_KEY="your-key"
Run — Python
from praisonaiagents import Agent, Task, AgentTeam
agent = Agent(
name="ImageAnalyst",
instructions="Describe images in detail.",
llm="gpt-4o-mini"
)
task = Task(
description="Describe this image",
expected_output="Detailed description",
agent=agent,
images=["image.jpg"]
)
agents = AgentTeam(agents=[agent], tasks=[task])
result = agents.start()
print(result)
Run — CLI
praisonai "Describe this image" --image path/to/image.jpg
Run — agents.yaml
framework: praisonai
topic: Image Analysis
roles:
image_analyst:
role: Image Analysis Specialist
goal: Analyze images and describe content
backstory: You are an expert in computer vision
llm: gpt-4o-mini
tasks:
analyze:
description: Describe this image in detail
expected_output: Detailed description
images:
- image.jpg
Serve API
from praisonaiagents import Agent
agent = Agent(
name="ImageAnalyst",
instructions="You are an image analysis expert.",
llm="gpt-4o-mini"
)
agent.launch(port=8080)
curl -X POST http://localhost:8080/chat \
-H "Content-Type: application/json" \
-d '{"message": "Describe this: https://example.com/image.jpg"}'
Advanced Workflow (All Features)
Agents: 1 — Single agent with memory, persistence, structured output, and session resumability.
Workflow
- Initialize session for image analysis tracking
- Configure SQLite persistence for analysis history
- Analyze image with structured output
- Store results in memory for comparison
- Resume session for follow-up analysis
Setup
pip install praisonaiagents praisonai pydantic
export OPENAI_API_KEY="your-key"
Run — Python
from praisonaiagents import Agent, Task, AgentTeam, Session
from pydantic import BaseModel
class ImageAnalysis(BaseModel):
objects: list[str]
scene: str
colors: list[str]
description: str
session = Session(session_id="image-001", user_id="user-1")
agent = Agent(
name="ImageAnalyst",
instructions="Analyze images and return structured results.",
llm="gpt-4o-mini",
memory=True
)
task = Task(
description="Analyze this image in detail",
expected_output="Structured image analysis",
agent=agent,
images=["image.jpg"],
output_pydantic=ImageAnalysis
)
agents = AgentTeam(
agents=[agent],
tasks=[task],
memory=True
)
result = agents.start()
print(result)
Run — CLI
praisonai "Analyze this image" --image image.jpg --memory --verbose
Run — agents.yaml
framework: praisonai
topic: Image Analysis
memory: true
memory_config:
provider: sqlite
db_path: images.db
roles:
image_analyst:
role: Image Analysis Specialist
goal: Analyze images with structured output
backstory: You are an expert in computer vision
llm: gpt-4o-mini
memory: true
tasks:
analyze:
description: Analyze this image in detail
expected_output: Structured image analysis
images:
- image.jpg
output_json:
objects: array
scene: string
colors: array
description: string
praisonai agents.yaml --verbose
Serve API
from praisonaiagents import Agent
agent = Agent(
name="ImageAnalyst",
instructions="Analyze images and return structured results.",
llm="gpt-4o-mini",
memory=True
)
agent.launch(port=8080)
curl -X POST http://localhost:8080/chat \
-H "Content-Type: application/json" \
-d '{"message": "Analyze image", "session_id": "image-001"}'
Monitor / Verify
praisonai "test image" --image test.jpg --verbose
Cleanup
Features Demonstrated
| Feature | Implementation |
|---|
| Workflow | Vision-based image analysis |
| DB Persistence | SQLite via memory_config |
| Observability | --verbose flag |
| Resumability | Session with session_id |
| Structured Output | Pydantic ImageAnalysis model |
Next Steps