|
1 | 1 | --- |
2 | 2 | title: Getting started with PolyAI |
3 | | -description: Learn how to build your first PolyAI agent in minutes, then connect it to the ADK for local development. |
| 3 | +description: Go from zero to a working local agent project in minutes using the ADK CLI. |
4 | 4 | --- |
5 | 5 |
|
6 | | -# Not sure where to start? |
| 6 | +# Getting started |
7 | 7 |
|
8 | | -If you do not yet have an agent in Agent Studio, or you want a working starting point before setting up the ADK, you can build a personalized agent from your company website in a few minutes — no configuration required. The agent lives in Agent Studio as a normal project, so you can pull it straight into the ADK and continue development locally as soon as it is ready. |
| 8 | +The fastest way to get up and running is entirely from the command line. Two steps — install the ADK, then run `poly start` — take you from an empty machine to a local project you can edit, push, and deploy. |
9 | 9 |
|
10 | 10 | --- |
11 | 11 |
|
12 | | -## New to PolyAI — build your first agent |
| 12 | +## Step 1 — Install the ADK |
13 | 13 |
|
14 | | -If you do not yet have access to Agent Studio or an existing agent, start here. |
| 14 | +You need **uv** to manage the Python environment. If you already have it, skip the first line. |
15 | 15 |
|
16 | | -### Step 1 — Get access to Agent Studio |
| 16 | +```bash |
| 17 | +curl -LsSf https://astral.sh/uv/install.sh | sh # or: brew install uv |
| 18 | +``` |
17 | 19 |
|
18 | | -Go to [studio.poly.ai](https://studio.poly.ai) and sign up. You can sign up with your email or login with SSO. |
| 20 | +Then create a virtual environment and install the ADK: |
19 | 21 |
|
20 | | - |
| 22 | +```bash |
| 23 | +uv venv --python=3.14 --seed |
| 24 | +source .venv/bin/activate |
| 25 | +pip install polyai-adk |
| 26 | +``` |
21 | 27 |
|
22 | | -### Step 2 — Create an agent from your website |
| 28 | +Confirm it worked: |
23 | 29 |
|
24 | | - |
| 30 | +```bash |
| 31 | +poly --help |
| 32 | +``` |
25 | 33 |
|
26 | | -Once you are inside Agent Studio: |
| 34 | +!!! info "Suppress SyntaxWarnings from platform-generated code" |
27 | 35 |
|
28 | | -1. Click the **+ Agent** button in the top-right corner. |
29 | | -2. Select **Quick Agent Setup** from the dropdown. |
30 | | -3. Enter your company website URL and click **Create agent**. |
| 36 | + Platform-generated code uses regex patterns (such as `\d`) that trigger `SyntaxWarning` in Python 3.14's stricter string handling. This produces 40+ warning lines on every `poly` command and obscures normal output. |
31 | 37 |
|
32 | | -Agent Studio crawls your website and generates a working agent configuration — usually within a few minutes. Before it builds, you can choose the voice your agent will use. |
| 38 | + To suppress them, set this before running any `poly` command: |
33 | 39 |
|
34 | | - |
| 40 | + ```bash |
| 41 | + export PYTHONWARNINGS=ignore |
| 42 | + ``` |
35 | 43 |
|
36 | | -!!! tip "What gets generated" |
| 44 | +!!! tip "Optional — install the VS Code / Cursor extension" |
| 45 | + |
| 46 | + If you plan to work in **VS Code** or **Cursor**, you can also install the [PolyAI ADK extension](../reference/tooling.md#polyai-adk-extension-for-vs-code-and-cursor) for resource-aware editing on top of the CLI. The extension is additive — the `poly` command remains the source of truth for every workflow. |
| 47 | + |
| 48 | +## Step 2 — Sign in and set up your API key |
| 49 | + |
| 50 | +```bash |
| 51 | +poly start |
| 52 | +``` |
| 53 | + |
| 54 | +`poly start` handles everything you need to authenticate: |
| 55 | + |
| 56 | +1. **Sign up or sign in** — opens a browser window for authentication. This can be on any device, not just the machine running the CLI. |
| 57 | +2. **API key** — generates a key and saves it to `~/.poly/credentials.json`. Future `poly` commands pick it up automatically — no environment variables to manage. |
| 58 | +3. **Create a project** — optionally creates a new Agent Studio project and pulls it down locally so you can start editing immediately. |
37 | 59 |
|
38 | | - Agent Studio populates **topics** (knowledge base entries) and basic **agent settings** (personality, role, rules) from your website's public content. This gives you an agent that knows about your company and can answer questions — but it does not generate flows, variants, entities, handoffs, or integrations. Those are for you to build locally with the ADK. Everything that is generated is standard ADK-compatible configuration and fully editable once pulled down. |
| 60 | +!!! tip "Already have an account?" |
| 61 | + If `poly start` detects an existing API key (from the credential file or an environment variable), it skips authentication and goes straight to project creation. |
39 | 62 |
|
40 | | -### Step 3 — Test your agent in Agent Studio |
| 63 | +??? note "Manual API key setup" |
41 | 64 |
|
42 | | - |
| 65 | + If you prefer to manage API keys through the Agent Studio UI: |
43 | 66 |
|
44 | | -Once the agent is ready, test it inside Agent Studio to confirm it's filled in with information as expected. This gives you a working baseline before you move to local development. |
| 67 | + 1. Log in to [Agent Studio](https://studio.poly.ai) and open your workspace. |
| 68 | + 2. In the **API Keys** tab (next to the **Users** tab), click **+ API key**. |
45 | 69 |
|
46 | | -### Step 4 — Find your account and project IDs |
| 70 | +  |
47 | 71 |
|
48 | | -To pull the agent into the ADK, you need two identifiers from Agent Studio. You can find them in the URL when your project is open: |
| 72 | + Then export the key: |
49 | 73 |
|
50 | | -~~~ |
51 | | -https://studio.poly.ai/<account_id>/<project_id>/... |
52 | | -~~~ |
| 74 | + ```bash |
| 75 | + export POLY_ADK_KEY=<your-api-key> |
| 76 | + ``` |
53 | 77 |
|
54 | | -Copy both values — you will need them in the next step. |
| 78 | + To make it permanent, add the export line to your shell profile (`~/.zshrc` or `~/.bashrc`). |
55 | 79 |
|
56 | | -### Step 5 — Generate an API key |
| 80 | +!!! info "How the ADK resolves API keys" |
| 81 | + The ADK checks for credentials in the following order: |
57 | 82 |
|
58 | | - |
| 83 | + 1. **Credential file** — `~/.poly/credentials.json` (written by `poly start`) |
| 84 | + 2. **Region-specific env var** — e.g. `POLY_ADK_KEY_US` |
| 85 | + 3. **General env var** — `POLY_ADK_KEY` |
59 | 86 |
|
60 | | -The ADK uses an API key to authenticate with Agent Studio. Click **Back to agents** to return to your **workspace**, then follow the steps in [Prerequisites — Generate API key](./prerequisites.md#generate-api-key) to create and export your key. |
| 87 | + The first match wins. If nothing is found, the CLI raises an error. |
61 | 88 |
|
62 | | -### Step 6 — Pull the agent into the ADK |
| 89 | + If you work across multiple regions, you can set region-scoped variables. See [per-region API keys](#per-region-api-keys) below. |
63 | 90 |
|
64 | | -Once the [ADK is installed](./installation.md), link your local folder to the project: |
| 91 | +## Step 3 — Start building |
| 92 | + |
| 93 | +If `poly start` created a project for you, `cd` into the project directory. Otherwise, connect to an existing project: |
65 | 94 |
|
66 | 95 | ```bash |
67 | 96 | poly init |
68 | 97 | ``` |
69 | 98 |
|
70 | | -[`poly init`](../reference/cli.md#poly-init) walks you through interactive dropdowns to pick a region, account, and project. It creates a subdirectory and pulls the configuration automatically. Change into the project directory before running any further commands. See [First commands](./first-commands.md) for the full walkthrough. |
71 | | - |
72 | | -You now have a fully editable local copy of your agent. |
| 99 | +[`poly init`](../reference/cli.md#poly-init) walks you through interactive dropdowns to pick a region, account, and project, then pulls the configuration locally. |
73 | 100 |
|
74 | | -### Step 7 — Continue with the ADK |
| 101 | +From inside your project directory, the core workflow is: |
75 | 102 |
|
76 | | -From here, the standard ADK workflow applies. You can: |
| 103 | +```bash |
| 104 | +poly status # see what's changed |
| 105 | +poly diff # inspect changes in detail |
| 106 | +poly branch create dev # work on a branch |
| 107 | +poly push # push changes to Agent Studio |
| 108 | +poly chat # talk to your agent |
| 109 | +``` |
77 | 110 |
|
78 | | -- edit resources locally with any tooling |
79 | | -- create branches with `poly branch create` |
80 | | -- track changes with `poly status` and `poly diff` |
81 | | -- validate and push changes back with `poly push` |
| 111 | +Edit flows, functions, topics, and other resources in your editor of choice — they're just YAML and Python files. Push when you're ready to test in Agent Studio. |
82 | 112 |
|
83 | 113 | <div class="grid cards" markdown> |
84 | 114 |
|
85 | 115 | - **Build an agent with the ADK** |
86 | 116 |
|
87 | 117 | --- |
88 | 118 |
|
89 | | - Follow the full step-by-step workflow for local development. |
| 119 | + Follow the full step-by-step tutorial for local development. |
90 | 120 | [Open the tutorial](../tutorials/build-an-agent.md) |
91 | 121 |
|
| 122 | +- **First commands** |
| 123 | + |
| 124 | + --- |
| 125 | + |
| 126 | + Explore the full set of CLI commands available to you. |
| 127 | + [Open first commands](./first-commands.md) |
| 128 | + |
92 | 129 | </div> |
93 | 130 |
|
94 | 131 | --- |
95 | 132 |
|
96 | | -## Already have an agent in Agent Studio? |
| 133 | +## Seed an agent from your website |
97 | 134 |
|
98 | | -If you already have an agent in Agent Studio — built in the browser editor, by a PolyAI team, or using any other method — you can connect it directly to the ADK. The ADK connects to any existing Agent Studio project using the same `poly init` + `poly pull` workflow described above. |
| 135 | +If you're starting from scratch and want a working baseline, you can generate an agent from your company website inside Agent Studio. This gives you topics and agent settings pre-populated from your site's public content — a useful starting point before building locally. |
99 | 136 |
|
100 | | -1. Complete [Prerequisites](./prerequisites.md) to generate your API key and install local tools. |
101 | | -2. Follow [Installation](./installation.md) to install the ADK. |
102 | | -3. Run: |
| 137 | +1. Open [Agent Studio](https://studio.poly.ai) and sign in (your `poly start` account works here). |
| 138 | +2. Click **+ Agent** → **Quick Agent Setup**. |
| 139 | +3. Enter your website URL and click **Create agent**. |
103 | 140 |
|
104 | | - ~~~bash |
105 | | - poly init |
106 | | - ~~~ |
| 141 | + |
| 142 | + |
| 143 | +Agent Studio crawls your site and generates a configuration — usually within a few minutes. Once it's ready, pull it into your local project: |
| 144 | + |
| 145 | +```bash |
| 146 | +poly pull |
| 147 | +``` |
107 | 148 |
|
108 | | - `poly init` shows interactive dropdowns to pick your project. See [First commands](./first-commands.md) for details. |
| 149 | +!!! tip "What gets generated" |
109 | 150 |
|
110 | | -Your local folder will mirror the project in Agent Studio and you can begin editing immediately. |
| 151 | + Agent Studio populates **topics** (knowledge base entries) and basic **agent settings** (personality, role, rules) from your website's public content. It does not generate flows, variants, entities, handoffs, or integrations — those are for you to build locally with the ADK. |
111 | 152 |
|
112 | 153 | --- |
113 | 154 |
|
114 | | -## Next step |
| 155 | +## Already have an agent in Agent Studio? |
115 | 156 |
|
116 | | -Install the ADK and confirm your local tools are in place before running your first commands. |
| 157 | +If you have an existing project — built in the browser, by a PolyAI team, or by any other method — connect it to the ADK in two commands: |
117 | 158 |
|
118 | | -<div class="grid cards" markdown> |
| 159 | +```bash |
| 160 | +poly start # sign in and save your API key (skip if already done) |
| 161 | +poly init # interactive prompts to pick region, account, and project |
| 162 | +``` |
119 | 163 |
|
120 | | -- **Installation** |
| 164 | +`poly init` creates a local directory and pulls the full project configuration. From there the standard `poly status` / `poly push` / `poly pull` workflow applies. |
121 | 165 |
|
122 | | - --- |
| 166 | +--- |
| 167 | + |
| 168 | +## Per-region API keys |
| 169 | + |
| 170 | +If you work across multiple regions, you can set region-scoped environment variables. The ADK checks the credential file first, then region-scoped env vars, then `POLY_ADK_KEY`. |
| 171 | + |
| 172 | +| Region | Environment variable | |
| 173 | +|---|---| |
| 174 | +| `us-1` | `POLY_ADK_KEY_US` | |
| 175 | +| `euw-1` | `POLY_ADK_KEY_EUW` | |
| 176 | +| `uk-1` | `POLY_ADK_KEY_UK` | |
| 177 | +| `studio` | `POLY_ADK_KEY_STUDIO` | |
| 178 | +| `staging` | `POLY_ADK_KEY_STAGING` | |
| 179 | +| `dev` | `POLY_ADK_KEY_DEV` | |
| 180 | + |
| 181 | +```bash |
| 182 | +export POLY_ADK_KEY_US=<your-us-api-key> |
| 183 | +export POLY_ADK_KEY=<your-fallback-api-key> # used for any other region |
| 184 | +``` |
| 185 | + |
| 186 | +--- |
123 | 187 |
|
124 | | - Install the ADK and set up your local environment. |
125 | | - [Open installation](./installation.md) |
| 188 | +## Next step |
| 189 | + |
| 190 | +<div class="grid cards" markdown> |
126 | 191 |
|
127 | 192 | - **What is the ADK?** |
128 | 193 |
|
129 | 194 | --- |
130 | 195 |
|
131 | | - Understand what the ADK does and how it fits into the Agent Studio workflow. |
| 196 | + Understand what the ADK does and how it fits into Agent Studio. |
132 | 197 | [Read the overview](./what-is-the-adk.md) |
133 | 198 |
|
134 | 199 | </div> |
0 commit comments