Agent with Vision
Create agents capable of processing and analyzing images.
Quick Start
Clone the Complete Example
The easiest way to get started is to clone the complete example repository:
git clone https://github.com/astreus-ai/agent-with-vision
cd agent-with-vision
npm install
Or Install Package Only
If you prefer to build from scratch:
npm install @astreus-ai/astreus
Environment Setup
# .env
# Vision-capable model API key
OPENAI_API_KEY=sk-your-openai-api-key-here
# Database for agent persistence
DB_URL=sqlite://./astreus.db
Vision Agent
import { Agent } from '@astreus-ai/astreus';
const agent = await Agent.create({
name: 'VisionBot',
model: 'gpt-4o',
visionModel: 'gpt-4o',
vision: true,
systemPrompt: 'You can analyze and describe images in detail.'
});
// Analyze an image
const result = await agent.ask("Analyze this image and describe what you see", {
attachments: [{
type: 'image',
path: './screenshot.png'
}]
});
console.log(result); // Detailed image analysis
Running the Example
If you cloned the repository:
npm run dev
Repository
The complete example is available on GitHub: astreus-ai/agent-with-vision
How is this guide?