Skip to main content

Vision Agents

Agentium supports real-time vision+audio conversations through the VisionAgent class. Vision agents stream both audio and video frames to multimodal models, enabling agents that can see camera feeds, screen shares, or images while having a spoken conversation. VisionAgent is a separate class from VoiceAgent with its own VisionProvider interface, designed for clean multi-provider support.

Quick Start


Architecture: Agent vs VoiceAgent vs VisionAgent

Agentium has three independent agent tiers: Each tier has its own provider interface. Existing code is never affected when a new tier is added.

VisionProvider Interface

Any provider that supports audio + video can implement this:
The difference from RealtimeConnection (voice) is sendImage() — this is what makes a provider “vision-capable.”

Gemini 3.1 Flash Live

The first VisionProvider implementation uses Google’s Gemini 3.1 Flash Live model.
Model specs:
  • Input: Text, images, audio, video
  • Output: Text and audio
  • Context: 131K input, 65K output
  • Features: Function calling, search grounding, thinking
  • Thinking: Uses thinkingLevel (“minimal”, “low”, “medium”, “high”) instead of thinkingBudget

Configuration

Full Configuration Reference


Voice Selection

Gemini Live supports 30 prebuilt voices, each with a distinct personality. Set the voice property on the agent config:

Available Voices

Per-Session Voice Selection

You can create agents with different voices per session — useful for letting users pick:

Multilingual Support

Vision agents support 24+ languages with automatic language detection. The agent detects the user’s spoken language and responds in kind — no configuration needed. Add a language rule to your instructions:
The user can speak Hindi, switch to English, then ask something in Japanese — the agent follows naturally.

Explicit Language (Optional)

Force a specific language using the language config with a BCP-47 code:

Supported Languages


Audio Interruption

When the user starts speaking while the agent is responding, the agent automatically stops its current response. This is handled by Gemini Live’s built-in Voice Activity Detection (VAD).

Server-Side

The VisionSession emits an interrupted event:

Client-Side

Stop all queued audio playback when interrupted:

Sending Image Frames

From a file

Screen sharing (via browser getDisplayMedia)

Camera feed (via browser getUserMedia)

Server-side relay (Socket.IO)


Socket.IO Vision Gateway

The vision gateway relays audio, images, and text between browser clients and VisionAgent sessions. Namespace: /agentium-vision

Client-to-server events

Server-to-client events


Tool Calling

Vision agents support the same tool system as voice and text agents:
The model can call tools based on what it sees or hears. For example, it could read a barcode from a camera frame and look up the product.

Memory

Vision agents support the same unified memory system as other agents:
Transcripts from the vision session are persisted to memory when the session ends, enabling context across sessions.

Full Example: Screen + Camera Assistant

A complete example with screen sharing, camera feed, voice selection, multilingual auto-detection, and interruption support:
This starts a web UI at http://localhost:4200 with:
  • Voice picker — choose from 30 Gemini voices before starting the session
  • Screen sharing — share your entire screen or a specific window
  • Camera feed — enable your webcam for face-to-face conversation
  • Microphone — speak naturally in any language
  • Text chat — type messages as an alternative to speech
  • Auto language detection — speak Hindi, English, Spanish, etc. and the agent responds in your language
  • Interruption — start speaking to immediately stop the agent’s response