Introduction
AI Agents in Xano allow you to define intelligent, autonomous workflows powered by models like Gemini, OpenAI, or Claude, directly in XanoScript.Anatomy
Every XanoScript Agent follows a predictable structure. Here’s a quick visual overview of its main building blocks — from declaration at the top to tools at the bottom.It’s a little different from other primitives, because the settings are defined in the
llm
block, instead of a separate settings block.You can find more detail about each section by continuing below.
Section 1: Declaration
Every Agent starts with a declarative header that specifies its type, name, and description.XanoScript
Element | Required | Description |
---|---|---|
agent | ✅ | Declares an Agent primitive and its name. |
description | no | Optional human-readable description of the task. |
canonical | no | The canonical ID for this Agent. |
tags | no | An array of strings used to categorize or filter Agents. |
Section 2: LLM
Thellm
block defines how your Agent interacts with its underlying AI model. All standard model configuration options available in the UI are represented here.
These are a little different from other primitives, because the settings available can change based on the model chosen.
XanoScript
Element | Required | Description |
---|---|---|
type | ✅ | The model host provider. Supported: openai , anthropic , google-genai , xano-free . |
system_prompt | no | Core instructions defining the Agent’s role and behavior. |
max_steps | no | How many steps (tool calls) the Agent can take before stopping. |
prompt | no | Additional context or message prompt. Use {{ $args.property }} for dynamic data. |
api_key | no | API key for the chosen model provider. |
model | no | Specific model to use. |
Xano Free Model (Gemini)
These settings are specific to the Xano Free Model (Gemini).XanoScript
Element | Required | Description |
---|---|---|
temperature | no | Controls randomness of output. Lower = more deterministic. |
search_grounding | no | For Gemini, whether to enable Google Search grounding. |
thinking_tokens | no | For reasoning models, sets thinking budget. |
include_thoughts | no | Whether to include reasoning traces in the response. |
Anthropic (Claude)
XanoScript
Element | Required | Description |
---|---|---|
api_key | ✅ | API key for the chosen model provider. |
model | ✅ | Specific model to use. |
temperature | no | Controls randomness of output. Lower = more deterministic. |
reasoning | no | Whether to include reasoning traces in the response. |
Google Generative AI (Gemini)
XanoScript
Element | Required | Description |
---|---|---|
api_key | ✅ | API key for the chosen model provider. |
model | ✅ | Specific model to use. |
temperature | no | Controls randomness of output. Lower = more deterministic. |
search_grounding | no | For Gemini, whether to enable Google Search grounding. |
thinking_tokens | no | For reasoning models, sets thinking budget. |
include_thoughts | no | Whether to include reasoning traces in the response. |
OpenAI
OpenAI settings are similar to the other models, but also includes some additional advanced settings.OpenAI Settings
XanoScript
Element | Required | Description |
---|---|---|
api_key | ✅ | API key for the chosen model provider. |
model | ✅ | Specific model to use. |
temperature | no | Controls randomness of output. Lower = more deterministic. |
reasoning_effort | no | For reasoning models, sets how much effort the model spends thinking during generation. |
OpenAI Advanced Settings
XanoScript
Element | Required | Description |
---|---|---|
organization | no | The organization to use. |
project | no | The project to use. |
compatibility | no | The compatibility level to use. |
Section 3: Tools
Thetools
block defines the tools that an Agent can use. Tools are functions that an Agent can call as part of its steps to resolve the task at hand.
XanoScript
Element | Required | Description |
---|---|---|
tools[] | ✅ | The tools that the Agent can use. |
name | ✅ | The name of the tool. |
Full Example
Below is a more complete Agent definition that combines multiple settings:What’s Next
Now that you understand how to define Agents in XanoScript, here are a few great next steps:Explore the function reference
Learn about the built-in functions available in the stack to start writing more complex logic.
Try it out in VS Code
Use the XanoScript VS Code extension with Copilot to write XanoScript in your favorite IDE.
Learn about AI Tools
AI Tools are used to define the actions that an Agent can take.