Overview

MeshAgent Rooms can be used to host voice agents. The VoiceBot class in the meshagent-livekit package connects a Livekit based voice agent to the room. From within the studio, the agent will show up in the messaging pane. Within a Flutter app the VoiceAgentCaller widget be used to start a Voice agent session.

Build a Voice Agent

To create a voice service that will run in every room:
meshagent service create --name "voice" --image docker.io/meshagent/sample-voice:0.0.31 --env="MESHAGENT_PORT=8090" --port "num=8090 type=meshagent.callable liveness=/ path=/agent participant_name=voice"
If you want to test the voice with a single room:
meshagent service test --room my-room --name "voice" --image docker.io/meshagent/sample-voice:0.0.31 --env="MESHAGENT_PORT=8090" --port "num=8090 type=meshagent.callable liveness=/ path=/agent participant_name=voice"
Here is the voice service code if you want to create your own app:
from meshagent.livekit.agents.voice import VoiceBot
from meshagent.api.services import ServiceHost

import asyncio

service = ServiceHost()


@service.path("/agent")
class SampleVoiceAgent(VoiceBot):
    def __init__(self):
        super().__init__(
            name="meshagent.livekit.agent",
            title="sample voice agent",
            description="sample agent that will respond to a query via voice",
            labels=["voice"],
            auto_greet_prompt="hello",
            rules=["You are a helpful assistant communicating through voice."],
        )


asyncio.run(service.run())