Create an AI Block
Add an AI block to a pipeline, then describe the job in YAML.- summarize reports, logs, feedback, or operational data
- extract structured fields from text
- classify rows or events into business categories
- generate code or SQL for a controlled workflow
- turn upstream block outputs into plain-language recommendations
- automate a decision step before the next pipeline block runs
Use Sidekick as an Agent
Settype: agent when you want the AI block to run through Mage Pro AI Sidekick. Agent mode is useful when the block should understand pipeline context, inspect upstream block outputs, and produce a final answer with the same project awareness users expect from Sidekick.
- “Read the upstream customer output and explain the highest churn risk.”
- “Review this pipeline run’s logs and summarize what failed.”
- “Compare the two upstream datasets and write a short executive summary.”
- “Use the runtime variables and upstream rows to draft a customer follow-up.”
Fields
prompt
The main instruction for the AI block. Keep it clear and specific. Multi-line prompts are easier to read and maintain.
message
An optional user-style request for type: agent blocks. Use prompt for standing instructions and message for the specific request to answer on this run.
settings
Controls how the AI runtime should behave. For agent blocks, speed: fast is a good default when you want a quick operational answer.
runtime
Optional context that travels with the block run. Use it for business labels, report names, or request metadata that helps the AI understand the job.
output
Use output when you need the response to follow a predictable shape or control agent block logs.
For type: agent blocks, output.level controls how much Sidekick runtime output Mage prints while the block runs:
default: print streamed answer, narration/status, tool call, and error events.all: print every runtime event, including completion and other low-level events.none: do not print Sidekick runtime output; the final answer still becomes the block output.
format when a non-agent AI block should return structured data.
validation
Use validation when the answer has to meet a business rule before it moves downstream.
tools
Use tools when a standard AI block should choose and trigger another pipeline as part of the workflow.
Upstream Data
AI blocks can sit downstream of regular Mage blocks. In agent mode, Sidekick receives references to upstream block outputs and can inspect those outputs through Mage instead of copying raw datasets into the prompt.Examples
Minimal Summary
Structured Extraction
Agent Block With Upstream Outputs
Agent Block With No Message
Best Practices
- Give the block one clear job.
- Put reusable instructions in
prompt. - Put the run-specific ask in
messagefor agent blocks. - Use upstream blocks for data and the AI block for interpretation.
- Use structured output when downstream blocks need predictable fields.
- Keep runtime context business-focused, such as segment, audience, or report name.
- Use agent mode when project context or upstream block output matters.