Overview
Kortix agents can see and analyze images, enabling visual understanding for tasks like UI recreation, diagram analysis, screenshot interpretation, and visual content extraction. The vision capability loads images into the conversation context and makes them accessible to the AI model. Images are automatically compressed, converted to supported formats (SVG→PNG), and uploaded to cloud storage for efficient processing.Core Function
Load Image
Image Context Management
From the source code (sb_vision_tool.py:46-86):
Automatic Context Management
Fromsb_vision_tool.py:464-472:
Supported Formats
- JPEG/JPG: Standard photo format
- PNG: Lossless format with transparency
- GIF: Animated images (animations preserved)
- WEBP: Modern efficient format
- SVG: Vector graphics (automatically converted to PNG)
Real-World Examples
Example 1: UI Recreation from Screenshot
Example 2: Diagram Analysis
Example 3: Data Extraction from Chart
Example 4: Multiple Image Comparison
Implementation Details
Image Compression
Fromsb_vision_tool.py:171-279:
- Max dimensions: 1920x1080
- JPEG quality: 85
- PNG compression: Level 6
- Max original size: 10 MB
- Max compressed size: 5 MB
SVG Conversion
Fromsb_vision_tool.py:98-169:
- Primary: Chromium browser rendering (highest quality)
- Fallback: svglib + reportlab (if browser fails)
Cloud Storage Upload
Fromsb_vision_tool.py:429-463:
- Unique timestamped filenames
- Public access for LLM
- Original filename preserved in metadata
Format Validation
Fromsb_vision_tool.py:420-427:
Image Context Format
Images are added to conversation context in OpenAI format:Download from URL
Fromsb_vision_tool.py:286-321:
When to Keep vs Clear Images
Keep Images Loaded When:
- User wants to recreate/rebuild what’s in the image
- Writing code based on image content (UI, diagrams, wireframes)
- Editing or iterating on image content
- Task requires active visual reference
- In middle of multi-step task involving the image
Clear Images When:
- Task is complete and images no longer needed
- User moves to different topic unrelated to images
- You only needed to extract information/text (already done)
- Reached 3-image limit and need to load new images
Best Practices
1. Only Load Actual Images
2. Manage the 3-Image Limit
3. Keep Images During Active Work
4. Optimize for Token Usage
Limitations
- Max images in context: 3 simultaneous images
- Max file size: 10 MB original, 5 MB compressed
- Max dimensions: Resized to 1920x1080 if larger
- Token cost: ~1000+ tokens per image
- Supported formats: JPEG, PNG, GIF, WEBP (SVG converted)
- PDF not supported: Use
read_filefor PDFs
Configuration
Vision capabilities require:Image Files Remain in Sandbox
Clearing images from context only removes them from the conversation. The actual image files remain in the sandbox at their original paths and can be reloaded anytime.