Skip to main content
Trinity
Guides/Advanced Features

Advanced Features

Voice chat, image generation, agent avatars, BPMN-inspired process engine workflows, and agent-defined dynamic dashboards.

Voice Chat

Real-time voice conversations with agents via Gemini 2.5 Flash Native Audio model (~280ms latency). Audio streams bidirectionally through a backend WebSocket proxy.

1

Open an agent's Chat tab.

2

Click the microphone button.

3

A voice overlay appears with status, mute, and end controls.

4

Speak — audio is captured as PCM 16kHz and streamed to the backend WebSocket.

5

The backend proxies audio to the Google Gemini Live API.

6

Agent response audio (PCM 24kHz) plays back in real-time.

7

Transcripts are auto-saved to the chat session with source="voice" markers.

Requirement: GEMINI_API_KEY configured on the platform.

Configuration

VariableDescription
VOICE_ENABLEDEnable or disable voice chat
VOICE_MODELGemini model to use for voice
VOICE_MAX_DURATIONMaximum voice session duration

Voice API

EndpointMethodDescription
/api/agents/{name}/voice/startPOSTStart a voice session
/api/agents/{name}/voice/stopPOSTStop a voice session
/api/agents/{name}/voice/statusGETGet session status
/api/agents/{name}/voice/wsWebSocketBidirectional audio bridge

Image Generation

Platform image generation via a two-step Gemini pipeline: prompt refinement then image generation.

1

Submit an image generation request via API.

2

Prompt Refinement — Gemini refines the user's prompt using best-practice templates for the use case.

3

Image Generation — Gemini generates the image from the refined prompt. Returned as base64 or URL.

Used internally for agent avatars and other platform features. API: POST /api/image/generate

Agent Avatars

AI-generated avatars for agents using reference images, emotion variants, and default generation.

Reference Image — Upload a reference image and the avatar is generated in that style.
Variation Regeneration — Generate new variations from an existing avatar.
Emotion Variants — The Agent Detail page cycles through emotion-based avatar variants every 30 seconds.
Default Avatar Generation — Admin button in Settings generates robot/android-style avatars for all agents without a custom avatar.
WebP Conversion — Avatars are converted to WebP via Pillow for optimization.

API: GET /api/agents/{name}/avatar (serve) and POST /api/agents/{name}/avatar (generate/upload).

Process Engine

BPMN-inspired workflow orchestration for multi-agent processes with approval gates, conditional branching, and analytics.

Concepts

Process Definition — A YAML file defining steps, agents, and flow.
Step Typesagent_task, human_approval, gateway (conditional), timer, notification, sub_process.
EMI Roles — Executor (performs work), Monitor (can intervene), Informed (notified).
Execution State MachinePENDINGRUNNINGCOMPLETED / FAILED / CANCELLED, with PAUSED for approvals.

Using the Process Engine

1

Process List (/processes) — Browse and create process definitions.

2

Process Wizard — Guided creation of process YAML.

3

Process Editor — Edit process definition YAML directly.

4

Execute — Publish a process, then start execution.

5

Monitor — Real-time WebSocket events for process progress.

6

Process Dashboard (/process-dashboard) — Analytics, metrics, cost tracking, trends.

Processes can call other processes (sub-processes). Parent-child linking is tracked with breadcrumbs in the UI. Bundled templates for common patterns are provided out of the box.

Process API

EndpointMethodDescription
/api/processesGET/POSTList or create process definitions
/api/processes/{id}GET/PUT/DELETECRUD operations
/api/processes/{id}/publishPOSTPublish a process definition
/api/processes/{id}/executePOSTStart a new execution
/api/executionsGETList all executions
/api/processes/{id}/analyticsGETProcess analytics and metrics

Dynamic Dashboards

Agent-defined dashboards via dashboard.yaml with 11 widget types, historical tracking, and sparkline charts.

Widget Types

11 supported types: metric, status, progress, table, list, chart, text, badge, countdown, link, image.

How It Works

1

The agent writes a dashboard.yaml file to its workspace.

2

The file defines widgets with type, title, value, and optional configuration.

3

Open the agent detail page and select the Dashboard tab to see the widgets.

4

Auto-refresh updates values as the agent modifies the YAML file.

5

Historical values are tracked automatically — sparklines appear for metrics with enough data points. Trend indicators show up/down/stable arrows with percentage change.

A Platform Metrics section appears at the bottom of every dashboard, auto-injected with Tasks 24h, Success Rate, Cost, and Health. This section is not controlled by the YAML file.

Agents control their dashboard entirely by writing to dashboard.yaml. No API call is needed — the file is read on each dashboard request. API: GET /api/agents/{name}/dashboard.