You provide context
Gather the requirements, business rules, API information, and reference material.
The agent or developer builds
Using the ADK, the project files are created, edited, validated, and prepared locally.
Agent Studio hosts and publishes
The generated work is pushed back into Agent Studio, where it can be reviewed and published.
Architecture at a glance
Local project structure
See Working locally — What a local project contains for the full directory tree. In short, the project mirrors what Agent Studio understands:agent_settings/, flows/, functions/, topics/, voice/, chat/, and config/.
Workflow 1 - CLI workflow
The CLI workflow is the manual developer path. You use the ADK directly, edit the project locally, and push changes back to Agent Studio. You can run this workflow in whichever editing surface you prefer: a plain terminal, or VS Code / Cursor with the PolyAI ADK extension for resource-aware navigation and validation. Both count as the CLI workflow — the difference is only the editing surface.Step 1 - Initialize your project
Link a local folder to an existing Agent Studio project. The agent must already exist in Agent Studio.poly init walks you through interactive dropdowns for region, account, and project. It creates the project directory and pulls the current configuration. Change into the project directory before running any further commands. See First commands for flag options and details.
Step 2 - Set up the environment
Configure any API keys or environment variables needed for the project.poly init pulls the current configuration automatically, but you can run poly pull at any time to refresh it:
Run commands from the project folderAll CLI commands should be run from within the local project folder, unless you explicitly use the relevant path flag.
Step 3 - Chat with the agent
Start an interactive chat session to confirm the connection works and inspect runtime behavior.poly chat runs against Agent Studio, not your local filespoly chat connects to the last pushed state of your current Branch (or to the sandbox deployment when you are on main). Push first, or use poly chat --push.Step 4 - Review the docs and understand the SDK
Use the CLI docs command to inspect the available resources and learn how they fit together.Step 5 - Customize the agent
This is the core build phase. Create a Branch, edit resources locally, track changes, and push them back.Branching
Functions
Create or modify backend functions the agent calls at runtime. See the functions reference for the full API. Typical locations include:- global functions under the functions directory
- lifecycle hooks such as start and end functions
- flow-scoped functions
- function steps inside flows
Topics
Add or edit knowledge-base topics used for retrieval.Agent settings
Update the personality, role, and rules that define the agent’s global behavior.Flows
Build conversation flows, including prompts, step transitions, entities, and function steps.Channel-specific settings
Adjust greeting messages, disclaimers, and style prompts for voice and chat.Safety filters
Configure content safety filtering at the project level and per channel.Handoffs, SMS, and variants
Define escalation paths, SMS templates, and per-variant configuration.Languages and translations
Configure supported languages and localized text strings for multilingual agents.ASR and response control
Tune speech recognition and control TTS behavior.Experimental config
Enable or tune experimental features where needed.Step 6 - Track and validate changes
Inspect the local changes before pushing.Step 7 - Push changes
Push the local changes back to Agent Studio.Step 8 - Test in Sandbox
Your Branch lives in Sandbox, so you can test it before you publish. Runpoly chat on the Branch to chat against its last pushed state. Add --environment sandbox to chat against the sandbox deployment of main instead of your Branch.
Pushing before chattingPush your latest changes before chatting, because
poly chat connects to the last pushed state. Target a specific environment with --environment sandbox, --environment pre-release (Staging), or --environment live.Step 9 - Iterate on quality
Review, refine, and test again. You can also use the review command to share diffs with teammates.Step 10 - Publish to Live
Once the changes are pushed and validated, publish the Branch to Live. Publishing merges the Branch’s changes onto Live and creates a new version you can roll back to. To try the agent on a real phone number first, move the Branch to Staging (Branches and Sub-branches modes only). See Environments and versions.Publishing from the CLI or the Agent Studio web UIFrom the CLI, run
poly branch merge '<commit message>' to merge the current Branch into main. On the new deployment system, merging into main publishes the Branch to Live. In the Agent Studio web UI, open the Branch and click Publish in the top-right corner. Test the Branch with poly chat before you merge. See the Branch merging reference for the full conflict-resolution flow.Step 11 - Monitor performance
Use Agent Studio analytics to monitor containment, CSAT, handle time, and flagged transcripts. Pull changes back locally as needed and continue iterating.Workflow 2 - AI-agent workflow
The AI-agent workflow uses a coding agent — such as Claude Code, or an in-editor agent in VS Code or Cursor paired with the PolyAI ADK extension — to run the same development loop on your behalf.You provide the brief
Requirements, business rules, integrations, and API documentation.
The coding tool generates the project
It uses the ADK to read documentation, generate files, and push the result.
You review and publish
Agent Studio remains the place where the work is checked and published.
Step 1 - Gather requirements
Collect the project context before you begin. Include anything the coding tool will need to produce a working agent:- API endpoint URLs
- business rules
- use-case descriptions
- internal notes or emails
- reference material
- links to API documentation
Step 2 - Create a new project in Agent Studio
Open Agent Studio and create a brand-new project. The project starts empty:- no knowledge base
- no flows
- no configuration
Think of Agent Studio as the deployment targetAgent Studio is where the project lives, but the coding tool generates the actual content.
Step 3 - Start the coding tool via the CLI
Open your terminal and start the coding tool. At this stage:- the ADK must already be installed
- the Agent Studio project must already exist
- the coding tool should initialize and link the project using the ADK
poly init pulls the current configuration automatically — there is no need to run poly pull separately. The ADK acts as the bridge between your local environment and Agent Studio, letting the coding tool read from and write back to the project.
Step 4 - Give the coding tool its context
Provide the coding tool with the information you gathered earlier. Include:- project-specific requirements
- the URL to the business’s public API documentation
- relevant internal context
- useful patterns or best practices from previous projects
Step 5 - Generate the project files
Once the context is in place, the coding tool generates the project files. This produces the assets the agent needs, including:Conversation flows
Dialog logic and routing for the agent.
Callable functions
Backend functions used during calls.
Knowledge base entries
Information the agent can reference when answering questions.
API integrations
Both real API connections and mock endpoints for testing.
Step 6 - Push to Agent Studio
Once the files are generated, use the ADK to push them to Agent Studio. A new Branch is created in the project so the generated work can be reviewed safely before anything goes live. When you switch to that Branch in Agent Studio, you should see the generated changes, such as:- updated greeting messages
- new knowledge base entries
- a built tracking flow
- real and mock API integrations
Step 7 - Review and publish
Review the generated work inside Agent Studio. Check that the key parts of the agent look correct:- flows
- functions
- knowledge base entries
- API integrations
main with poly branch merge; on the new deployment system that publishes it. In the Agent Studio web UI, open the Branch and click Publish in the top-right corner.
At that point, the agent is live.
CLI command overview
The overall loop
- create or connect a project
- build locally using the ADK
- push to Agent Studio
- review and publish
Next steps
Restaurant booking agent
Apply the workflow to a real-world example with flows, functions, and variants.
Core concepts
Understand resource architecture, local development patterns, and team workflows.
CLI reference
Explore the available ADK commands and options.

