1. Find the Retell agent
Load your Retell API key into theEGMA_RETELL_API_KEY environment variable
from your secret store. If your repository already loads RETELL_API_KEY, use:
RETELL_AGENT_ID to the exact ID of the agent you want to test. Do not use
a display name in its place.
For a key supplied by another process, add --credentials-stdin. The CLI
accepts a JSON object with an apiKey field through standard input. Do not put
the key in a command-line argument or commit it to egma/config.yaml.
2. Register the agent in Egma
Checkegma/config.yaml first. If it already contains the agent, use that Egma
agent ID. Otherwise, register it with a name that identifies it in Egma:
EGMA_AGENT_ID to the Egma ID printed by the command. Registration creates
the Egma record; the next step connects it to Retell.
3. Add a connection
- Text
- Web call
Text mode tests the conversation logic without sending audio through the
speech stack. It supports Retell-managed LLM and conversation-flow agents.
Retell custom-LLM agents do not support this mode.
EGMA_CONNECTION_ID in the
CLI run command.
Choose the version to test
Egma resolves the Retell agent version once when a run starts. It follows an explicit version or environment-tag binding on a phone number routed to the agent. Otherwise, it uses the latest published version. Publish the version you want tested before running; an unpublished draft is not selected by default.Pass data to a test
If the agent normally receives dynamic variables, put their test values in the test’s## Env section:
egma_; that prefix is reserved. Egma passes
these variables to text and web-call simulations.
Mock tool responses
Add a Mock tools section to a test to return a controlled response for a selected custom tool. Use the exact tool name and the response shape your agent expects. Retell integrations do not need an Egma SDK in your backend for this. Only the tools named in the test are mocked. Other tools still run against their real backend. Retell’s built-in actions, such as call transfer, SMS, digit pressing, and built-in booking, are not replaced by custom-tool mocks. These mocks do not replace MCP tools either.Test through a Retell phone number
Use this option when you need to test the agent through its deployed Retell phone route. SetRETELL_PHONE_NUMBER to the E.164 number returned for the
selected agent by egma agent connection options, then add the connection:
retell_dynamic_variables. Use a web-call connection when you need
those controls.
For self-hosted Egma, configure the Retell phone prerequisites in
Self-hosting configuration before starting a
phone run.
Read the simulation’s evidence
After a web or phone call ends, Egma reads its call record from Retell and adds it to the simulation. The transcript includes the tool calls Retell recorded, including calls to your real backend. Calls answered by a test mock are marked mocked. The voice recording captures what the simulated caller heard. Retell text mode has no stored call record for Egma to import. Egma records the complete API exchange it conducted, including the tool results Retell returns. Retell does not provide a separate native agent trace for text mode. If the agent’s record is incomplete, check that the ended call is available in Retell. Once missing evidence arrives in Egma, you can regrade the simulation.Enable production monitoring
For an agent you connected above, reuse its stored Retell credentials:If a simulation cannot reach the agent
- Check that you selected the Egma agent and connection IDs from
egma/config.yamlin the run command. - Run connection discovery for that Egma agent to check the Retell binding.
- For text mode, confirm that Retell manages the agent’s LLM or conversation flow. Use a web call for a custom-LLM agent.
- Check any required dynamic variables and backend access. A connected agent can still fail if its startup context is missing.