A LiveKit or Pipecat agent is your code on your infrastructure, so there is no provider document for Roark to edit. The managed-config integration turns that around: your agent fetches its tunable surface (prompt, model, params, voice) from Roark at session start, and Autoimprove works on that config with the same loop, safety model, and promote gate as provider agents.
The key mechanic is per-session resolution: Roark’s test calls dial your production deployment directly. Because Roark originated those calls, the config endpoint recognizes them and serves the staging revision for those sessions only. Real callers always get production config; you deploy nothing extra.
1. Fetch config at session start
One call registers the key on first use (your defaults become revision 1) and resolves the right revision per session.
Cache the resolved config for the session; do not fetch per turn. Wrap the resolve in a try/except that falls back to your DEFAULTS: the failure mode is then your current behavior, never a broken call. The SDK method ships in the next roark_analytics release; until you upgrade, the same call is one POST /v1/agent-config/{key}/resolve request.
2. Link the config to your Roark agent
Autoimprove finds the config through the agent your calls already report. Link once:
Your agent also needs a registered phone endpoint (the number Roark’s simulations dial): roark agent endpoint create if you have not already.
3. Run Autoimprove
Exactly the same as any other agent:
What happens under the hood differs only in the staging story: instead of cloning a shadow, Roark forks a staging config channel from production. Its test calls dial your production number, get recognized, and read the staging revision; every change Roark makes is a new audited revision on that channel. Real traffic never sees any of it.
When the job reaches AWAITING_PROMOTE, promote is a pointer swap: your very next session reads the verified revision. Rolling back is writing the prior revision back to production; the chain preserves every state.
What Roark can and cannot improve here
Roark can change anything in the document you externalized: prompt, model and sampling params, and your STT/TTS choices (voice, speed, language) when you include them, as the example does. It keeps the key shape your code reads (it never renames keys). What stays in code (tool logic, pipeline structure) is out of reach by design; the job’s final report recommends those changes for a human when the config surface is not enough.