Dynamic Agent Overview
A Dynamic Agent enables a large language model (LLM) to handle compound queries that require multiple data sources, computations, or custom tools. The agent breaks down the query into intermediate steps, executes each step using available tools, and combines the results to generate a response.
You use the Dynamic Agent to extend the platform's reasoning capabilities by configuring system prompts, callbacks with few-shot examples, and toolkits that guide the LLM's execution process.
A system prompt sets the goals, rules, and intended behavior and reasoning of the agent. Callbacks and few-shot examples work together: callbacks allow you to run custom logic at different execution stages (such as retrieving few-shot examples and injecting them into the system prompt), enabling you to dynamically modify the agent's internal state and guide its reasoning.
Custom tools for Dynamic Agent
Add custom tools to support new data sources, APIs, or business logic. To do this:
- Create a Python function in a
.pyfile. - Register the tool as a Genai.Agent.Dynamic.Tool.
- Add the tool to a Genai.Agent.Dynamic.Toolkit.
You can also pass configuration parameters to tools using Genai.Agent.Dynamic.Tool#toolConfigurationParams.
For guidance, see Create Custom Tools.
Dynamic Agent configuration
Configure a Dynamic Agent by defining its system prompt, step callbacks, and few-shot examples. These control how the agent interprets queries, executes steps, and generalizes behavior.
Configure system prompts
System prompts define the agent’s behavior before it receives a query. They establish goals, provide context, set formatting rules, and outline constraints. A well-designed system prompt helps the agent plan how to solve the query and choose the right tools.
For example, a system prompt may define:
- The type of language or tone the agent should use.
- What the agent should prioritize in its responses.
- Which tools or steps to avoid in specific scenarios.
For guidance on authoring system prompts and structuring the prompt content, see Dynamic agent system prompts.
Configure callbacks and few-shot examples
Step callbacks let you run custom logic at different points while the agent processes a query. You can use them to:
- Modify the input or output of a step.
- Influence tool selection.
- Control the agent’s internal state at different points in the reasoning process.
Step callbacks allow fine-tuning based on domain-specific logic or real-time inputs. Few-shot examples are query-response pairs that show the agent how to complete specific tasks. Together, callbacks and few-shots enable you to customize agent behavior: use the few_shot_setup callback to automatically retrieve and inject relevant examples into the system prompt.
Use this combined approach to demonstrate task-specific formats, modify query input or output, influence tool selection, inject dynamic context into the system prompt, and control the agent's internal state at different reasoning points. Well-chosen examples improve performance, especially for complex or task-specific queries.
Learn more in Dynamic Agent Few Shots and Callbacks
Preconfigured Dynamic Agents
All are available in the Agent Gallery and can be customized or duplicated in the Agent Workbench to create variants with different tools, prompts, or execution parameters.
Canvas Agent
Provides a rich text editing interface for creating, updating, and managing documents directly in the UI. The agent supports multimodal outputs including forms, visualizations, and structured data.
- Type: Genai.Agent.Dynamic.Canvas
- Configuration key:
CanvasAgent_default - Default LLM:
default-completions(Claude Sonnet 4.6 on AWS and GCP) - Deployment: Comes as a pre-deployed template
Learn more in Canvas Agent.
Deep Research Agent
Specializes in research-intensive workflows that require multi-step reasoning and document generation. Built on the Canvas Agent framework, it coordinates multiple internal roles such as research lead, researchers, writers, and critics to generate comprehensive reports.
- Type: Genai.Agent.Dynamic.Canvas
- Configuration key:
CanvasAgent_deep_research - Default LLM:
default-completions(Claude Sonnet 4.6 on AWS and GCP) - Deployment: Comes as a pre-deployed template
Learn more in Deep Research Agent.