Set up with your coding agent
- Open Agents → Connect an agent.
- Choose Run simulations, Monitor production or Set up both, then Pipecat.
- Copy the prompt, open your bot’s repository in a coding agent, and paste it.
1. Prepare the bot
Install the SDK in your bot’s project:pip install "egma[pipecat]". The SDK needs Python 3.11 or newer and pipecat-ai 1.9, 1.10, or 1.11.
Add await simulation(worker, runner_args) after you create the PipelineWorker and before runner.add_workers(worker). If your pipeline is built in a helper such as run_bot, pass runner_args from bot() into it:
egma key, it does nothing and makes no network request.
Pipecat Python SDK
What the line does, how mock tools and Pipecat Flows behave, and when it raises NotReported.
EGMA_AGENT_NAME too. Your bot needs these two settings:
Add them to the secret set named by
secret_set in your pcc-deploy.toml:
pipecat cloud deploy. The bot reads the new secrets and code only after the redeploy.
A cold start adds a few seconds, and Egma waits up to 120 seconds for your bot. If your bot starts more slowly than that, keep one instance warm with min_agents = 1 under [scaling] in pcc-deploy.toml. Pipecat Cloud charges for a reserved instance.
2. Register the agent in Egma
Checkegma/config.yaml. Reuse the existing Egma agent if it is already registered. Otherwise, run:
EGMA_AGENT_ID to the Egma agent ID printed by the command.
3. Add voice and chat connections
Egma needs your Pipecat Cloud agent name, which isagent_name in pcc-deploy.toml, and a public API key of the Pipecat Cloud organization that deploys it. A public key starts with pk_. Create one in the Pipecat Cloud dashboard or with pipecat cloud organizations keys create. Egma never needs a private key (sk_).
Load the public key from your secret store, then add a voice connection:
--modality chat --name "Pipecat chat" to add a chat connection. Chat needs no extra code; see Chat connections and Env.
For a key supplied by another process, add --credentials-stdin and send {"publicApiKey":"pk_..."} through standard input. Do not put the key in command-line arguments.
Keep the connection ID as EGMA_CONNECTION_ID, then follow the test guide to write a test and start a run.
What happens in a simulation
Egma sends this start request to Pipecat Cloud:bodyholds the test’spipecat_body_paramsand Egma’s ownegmakey, which names the simulation and its modality (voiceorchat). Your bot readsbodyatrunner_args.body; the SDK reads theegmakey.- The room expires two minutes after the simulation’s duration limit. Pipecat Cloud then removes a bot that is still in the room.
- The persona joins the room as an RTVI client and sends
client-ready. A bot that greets inon_client_ready, as Pipecat’s quickstart does, speaks first. - Egma waits up to 120 seconds for your bot to join, report to Egma, and publish audio (voice) or send RTVI
bot-ready(chat). A warm bot starts at once. - When the conversation ends, the persona leaves the room. Stop your bot when its client disconnects, as the quickstart does in
on_client_disconnected.