Vision Agents
Agentium supports real-time vision+audio conversations through theVisionAgent 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:RealtimeConnection (voice) is sendImage() — this is what makes a provider “vision-capable.”
Gemini 3.1 Flash Live
The firstVisionProvider implementation uses Google’s Gemini 3.1 Flash Live model.
- 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 ofthinkingBudget
Configuration
Full Configuration Reference
Voice Selection
Gemini Live supports 30 prebuilt voices, each with a distinct personality. Set thevoice 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.Auto-Detection (Recommended)
The agent detects the user’s spoken language and responds in kind — no configuration needed. Add a language rule to your instructions:Explicit Language (Optional)
Force a specific language using thelanguage 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
TheVisionSession 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:Memory
Vision agents support the same unified memory system as other agents:Full Example: Screen + Camera Assistant
A complete example with screen sharing, camera feed, voice selection, multilingual auto-detection, and interruption support: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