Playbooks

A playbook is the basic building block of generative agents. A generative agent typically has many playbooks, where each playbook is defined to handle specific tasks. The playbook data is provided to the LLM, so it has the information it needs to answer questions and execute tasks. Each playbook can provide information, send queries to external services, or defer conversation handling to a flow or another playbook to handle sub-tasks.

Limitations

The following limitations apply:

  • Agents that use playbooks don't support sending a call companion SMS from the Default Welcome Intent route in the Default Start Flow, but you can enable the call companion SMS option in standard flows.

Language support

Playbooks support the same languages as Gemini models.

Region support

Playbooks are supported in the following regions:

  • global
  • asia-south1
  • asia-southeast1
  • asia-northeast1
  • australia-southeast1
  • eu (multi-region)
  • europe-west1
  • europe-west2
  • europe-west3
  • northamerica-northeast1
  • us (multi-region)
  • us-central1
  • us-east1
  • us-west1

Playbook data

A playbook is composed of the following data:

  • Playbook name: a concise name in natural language that helps developers and the LLM to understand what tasks the playbook handles
  • Goals: high level description of what the playbook should accomplish
  • Instructions: defines the process steps that should be taken to accomplish the goal
  • Examples: sample conversations that are effectively few-shot prompt examples for the LLM
  • Parameters: are used to store information about a conversation like user input, user system information, results of actions, and so on.

Playbook types

When you create a playbook, you select the type of playbook you want: task playbook or routine playbook.

Task playbooks

Task playbooks are the original type of playbook. They are used to break down complex tasks into smaller, reusable sub-tasks. They are used for modeling compositional conversation stages, where each stage communicates through input and output parameters.

The following shows a task playbook (caller) calling another task playbook (callee):

One task playbook calling another task playbook

  1. The caller starts the callee.
  2. The caller provides necessary input parameters to the callee.
  3. The callee processes this information, performs its designated function, and returns output parameters.
  4. The caller receives parameters from the callee.

Any routine or task playbook can call another task playbook, but a task playbook cannot call another routine playbook.

Routine playbooks

Routine playbooks are a new type of playbook. They are used for modeling sequential conversation stages, where each stage is complete and independent. They can call task playbooks to decompose larger tasks into smaller sub-tasks, and they can transition to other routine playbooks or flows.

The following shows a routine playbook (A), transitioning to another routine playbook (B), transitioning to a flow (C):

One routine playbook calling another routine playbook

  1. Routine playbook A can read session parameters when it starts and write session parameters just before exiting.
  2. Routine playbook A exits and transitions to routine playbook B.
  3. Routine playbook B can read session parameters when it starts and write session parameters just before exiting.
  4. Routine playbook B exits and transitions to flow C.
  5. Flow C can read and write session parameters.

If a routine playbook does not transition to another routine playbook or flow, the session will return to the last active flow or end if there is not one.

Routine playbooks have the following parameter management behavior:

  • When a routine playbook is entered, its input parameters are assigned values that are equivalent to session parameters with the same name.
  • When a routine playbook exits, it generates values for its output parameters and assigns them to session parameters with the same name.

Default playbook

When you create a generative agent using Conversational Agents console, a Default Generative Playbook is created automatically.

The default playbook is the starting point for conversations, so it has some important distinctions from other playbooks:

  • The default playbook doesn't receive a summary of preceding conversation turns.
  • The default playbook can't define or receive input parameters.

Import and export playbooks

Once you have created playbooks using the Conversational Agents console, you can export these playbooks for use in another agent. To export a playbook:

  1. Navigate to the playbooks list.
  2. Click the export button for the playbook you want to export.
  3. Select exporting options.
  4. Click Export.

To import a playbook you have previously exported:

  1. Navigate to the playbooks list.
  2. Click Import.
  3. Select import options.
  4. Click Import.