You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add learnings guides for non-obvious backend behaviors
Split reference covering tools, assistants, squads, structured outputs,
simulations, and webhooks into focused docs under docs/learnings/ so
agents can load only the context they need. Updated AGENTS.md and
CLAUDE.md to reference the new directory.
Copy file name to clipboardExpand all lines: AGENTS.md
+40-19Lines changed: 40 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,19 @@ This project manages **Vapi voice agent configurations** as code. All resources
4
4
5
5
**You do NOT need to know how Vapi works internally.** This guide tells you everything you need to author and modify resources.
6
6
7
-
**Prompt quality:** Whenever you create a new assistant or change an existing assistant’s system prompt, read **`docs/Vapi Prompt Optimization Guide.md`** first. It goes deeper on structure, voice constraints, tool usage, and evaluation than the summary in this file.
7
+
**Prompt quality:** Whenever you create a new assistant or change an existing assistant’s system prompt, read `**docs/Vapi Prompt Optimization Guide.md`** first. It goes deeper on structure, voice constraints, tool usage, and evaluation than the summary in this file.
8
8
9
-
**Environment-scoped resources:** Resources live in `resources/<env>/` (e.g. `resources/dev/`, `resources/prod/`). Each environment directory is isolated — `push:dev` only touches `resources/dev/`, `push:prod` only touches `resources/prod/`. See **`docs/environment-scoped-resources.md`** for the full promotion workflow and rationale.
9
+
**Environment-scoped resources:** Resources live in `resources/<env>/` (e.g. `resources/dev/`, `resources/prod/`). Each environment directory is isolated — `push:dev` only touches `resources/dev/`, `push:prod` only touches `resources/prod/`. See `**docs/environment-scoped-resources.md`** for the full promotion workflow and rationale.
10
10
11
11
**Template-safe first run:** In a fresh clone, prefer `npm run pull:dev:bootstrap` (or the matching env) to refresh `.vapi-state.<env>.json` and credential mappings without materializing the target org's resources into `resources/<env>/`. `push:<env>` will auto-run the same bootstrap sync when it detects empty or stale state for the resources being applied.
12
12
13
+
**Gotchas & best practices:** Before configuring tools, assistants, squads, structured outputs, or simulations, consult the relevant file in `**docs/learnings/`**. Each file documents non-obvious backend behaviors, silent defaults, and common foot-guns for a specific resource type — things the API reference doesn't cover. See `**docs/learnings/README.md`** for the index.
| `request-start` | Said when tool is called | `content`, `blocking` (pause speech until tool returns) |
369
384
| `request-response-delayed` | Said if tool takes too long | `content`, `timingMilliseconds` |
370
385
| `request-complete` | Said when tool returns | `content` |
371
386
| `request-failed` | Said when tool errors | `content` |
372
387
388
+
373
389
---
374
390
375
391
### Structured Outputs (`.yml`)
@@ -450,7 +466,7 @@ schema:
450
466
- `assistant_ids`uses **Vapi UUIDs** (not local filenames) — these are the IDs of assistants this output applies to
451
467
- `target: messages` means the LLM analyzes the full message history
452
468
- `type: ai` means an LLM generates the output (vs. `type: code` for programmatic)
453
-
- **`schema.type` must be a simple string** (e.g. `type: string`, `type: boolean`, `type: object`). Do NOT use a YAML array like `type: [string, "null"]` — the Vapi dashboard calls `.toLowerCase()` on this field and will crash with `TypeError: .toLowerCase is not a function` if it receives an array. For nullable values, express nullability in the `description` instead (e.g. "Return null if no follow-up is needed")
469
+
- `**schema.type` must be a simple string** (e.g. `type: string`, `type: boolean`, `type: object`). Do NOT use a YAML array like `type: [string, "null"]` — the Vapi dashboard calls `.toLowerCase()` on this field and will crash with `TypeError: .toLowerCase is not a function` if it receives an array. For nullable values, express nullability in the `description` instead (e.g. "Return null if no follow-up is needed")
454
470
455
471
---
456
472
@@ -607,6 +623,7 @@ simulationIds:
607
623
608
624
Resources reference each other by **filename without extension**:
| Suite | `simulationIds[]` | Simulation test files | `- booking-test-1-a0000001` |
619
636
637
+
620
638
The gitops engine resolves these local filenames to Vapi UUIDs automatically during push.
621
639
622
640
---
@@ -625,7 +643,7 @@ The gitops engine resolves these local filenames to Vapi UUIDs automatically dur
625
643
626
644
The markdown body of an assistant `.md` file is the system prompt — the core instructions that define how the AI behaves on a call. This is the most important part to get right.
627
645
628
-
**Before drafting or changing prompts:** work through **`docs/Vapi Prompt Optimization Guide.md`** so structure, guardrails, and voice-specific habits stay consistent across agents.
646
+
**Before drafting or changing prompts:** work through `**docs/Vapi Prompt Optimization Guide.md`** so structure, guardrails, and voice-specific habits stay consistent across agents.
629
647
630
648
### Recommended Structure
631
649
@@ -728,26 +746,28 @@ Replace `dev` with `prod` for production environment.
728
746
729
747
For the **complete schema** of all available properties on each resource type, consult the Vapi API documentation:
> **Tip:** The Vapi MCP server and API reference pages provide full JSON schemas with all available fields, enums, and defaults. Use them to discover settings not covered in this guide.
753
773
@@ -808,3 +828,4 @@ If you need a local mock server to validate webhook payloads or message delivery
808
828
- Assume decryption only works when the corresponding private keys are already available in your zsh environment.
809
829
- For local webhook validation, prioritize core `serverMessages` event types such as `speech-update`, `status-update`, and `end-of-call-report`.
810
830
- To test callbacks from Vapi into your local machine, expose the mock server with a tunnel like `ngrok` and use that public HTTPS URL in `assistant.server.url`.
Copy file name to clipboardExpand all lines: CLAUDE.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,3 +11,4 @@ When both files exist, follow both. If guidance overlaps, treat `AGENTS.md` as t
11
11
12
12
1. Read `AGENTS.md` first.
13
13
2. Then read this file (`CLAUDE.md`) for additional policy constraints.
14
+
3. When configuring any resource (tools, assistants, squads, structured outputs, simulations), consult the relevant file in `docs/learnings/` for non-obvious backend behaviors and silent defaults that can cause unexpected runtime results. See `docs/learnings/README.md` for the index.
Non-obvious behaviors, silent defaults, and foot-guns in the Vapi backend that affect how your YAML/JSON resources behave at runtime. This is a companion to the API reference — it covers what the docs _don't_ tell you.
4
+
5
+
Each file in this directory covers a specific resource type so you can load only the context you need:
**When to read these:** Before creating or modifying any resource file in `resources/<env>/`. These gotchas document behavior that the API reference and dashboard don't make obvious.
0 commit comments