yaml
type: "io.kestra.plugin.ai.agent.aiagent"
Examples
yaml
id: simple_summarizer_agent
namespace: company.ai
inputs:
- id: summary_length
displayName: Summary Length
type: SELECT
defaults: medium
values:
- short
- medium
- long
- id: language
displayName: Language ISO code
type: SELECT
defaults: en
values:
- en
- fr
- de
- es
- it
- ru
- ja
- id: text
type: STRING
displayName: Text to summarize
defaults: |
Kestra is an open-source orchestration platform that:
- Allows you to define workflows declaratively in YAML
- Allows non-developers to automate tasks with a no-code interface
- Keeps everything versioned and governed, so it stays secure and auditable
- Extends easily for custom use cases through plugins and custom scripts.
Kestra follows a "start simple and grow as needed" philosophy. You can schedule a basic workflow in a few minutes, then later add Python scripts, Docker containers, or complicated branching logic if the situation calls for it.
tasks:
- id: multilingual_agent
type: io.kestra.plugin.ai.agent.AIAgent
systemMessage: |
You are a precise technical assistant.
Produce a {{ inputs.summary_length }} summary in {{ inputs.language }}.
Keep it factual, remove fluff, and avoid marketing language.
If the input is empty or non-text, return a one-sentence explanation.
Output format:
- 1-2 sentences for 'short'
- 2-5 sentences for 'medium'
- Up to 5 paragraphs for 'long'
prompt: |
Summarize the following content: {{ inputs.text }}
- id: english_brevity
type: io.kestra.plugin.ai.agent.AIAgent
prompt: Generate exactly 1 sentence English summary of "{{ outputs.multilingual_agent.textOutput }}"
pluginDefaults:
- type: io.kestra.plugin.ai.agent.AIAgent
values:
provider:
type: io.kestra.plugin.ai.provider.GoogleGemini
modelName: gemini-2.5-flash
apiKey: "{{ kv('GEMINI_API_KEY') }}"
yaml
id: agent_with_docker_mcp_server_tool
namespace: company.ai
inputs:
- id: prompt
type: STRING
defaults: What is the current UTC time?
tasks:
- id: agent
type: io.kestra.plugin.ai.agent.AIAgent
prompt: "{{ inputs.prompt }}"
provider:
type: io.kestra.plugin.ai.provider.OpenAI
apiKey: "{{ kv('OPENAI_API_KEY') }}"
modelName: gpt-5-nano
tools:
- type: io.kestra.plugin.ai.tool.DockerMcpClient
image: mcp/time
yaml
id: agent_with_memory
namespace: company.ai
tasks:
- id: first_agent
type: io.kestra.plugin.ai.agent.AIAgent
prompt: Hi, my name is John and I live in New York!
- id: second_agent
type: io.kestra.plugin.ai.agent.AIAgent
prompt: What's my name and where do I live?
pluginDefaults:
- type: io.kestra.plugin.ai.agent.AIAgent
values:
provider:
type: io.kestra.plugin.ai.provider.OpenAI
apiKey: "{{ kv('OPENAI_API_KEY') }}"
modelName: gpt-5-mini
memory:
type: io.kestra.plugin.ai.memory.KestraKVStore
memoryId: JOHN
ttl: PT1M
messages: 5
yaml
id: agent_with_content_retriever
namespace: company.ai
inputs:
- id: prompt
type: STRING
defaults: What is the latest Kestra release and what new features does it include? Name at least 3 new features added exactly in this release.
tasks:
- id: agent
type: io.kestra.plugin.ai.agent.AIAgent
prompt: "{{ inputs.prompt }}"
provider:
type: io.kestra.plugin.ai.provider.GoogleGemini
modelName: gemini-2.5-flash
apiKey: "{{ kv('GEMINI_API_KEY') }}"
contentRetrievers:
- type: io.kestra.plugin.ai.retriever.TavilyWebSearch
apiKey: "{{ kv('TAVILY_API_KEY') }}"
yaml
id: agent_with_structured_output
namespace: company.ai
inputs:
- id: customer_ticket
type: STRING
defaults: >-
I can't log into my account. It says my password is wrong, and the reset link never arrives.
tasks:
- id: support_agent
type: io.kestra.plugin.ai.agent.AIAgent
provider:
type: io.kestra.plugin.ai.provider.MistralAI
apiKey: "{{ kv('MISTRAL_API_KEY') }}"
modelName: open-mistral-7b
systemMessage: |
You are a classifier that returns ONLY valid JSON matching the schema.
Do not add explanations or extra keys.
configuration:
responseFormat:
type: JSON
jsonSchema:
type: object
required: ["category", "priority"]
properties:
category:
type: string
enum: ["ACCOUNT", "BILLING", "TECHNICAL", "GENERAL"]
priority:
type: string
enum: ["LOW", "MEDIUM", "HIGH"]
prompt: |
Classify the following customer message:
{{ inputs.customer_ticket }}
yaml
id: market_research_agent
namespace: company.ai
inputs:
- id: prompt
type: STRING
defaults: |
Research the latest trends in workflow and data orchestration.
Use web search to gather current, reliable information from multiple sources.
Then create a well-structured Markdown report that includes an introduction,
key trends with short explanations, and a conclusion.
Save the final report as `report.md` in the `/tmp` directory.
tasks:
- id: agent
type: io.kestra.plugin.ai.agent.AIAgent
provider:
type: io.kestra.plugin.ai.provider.GoogleGemini
apiKey: "{{ kv('GEMINI_API_KEY') }}"
modelName: gemini-2.5-flash
prompt: "{{ inputs.prompt }}"
systemMessage: |
You are a research assistant that must always follow this process:
1. Use the TavilyWebSearch content retriever to gather the most relevant and up-to-date information for the user prompt. Do not invent information.
2. Summarize and structure the findings clearly in Markdown format. Use headings, bullet points, and links when appropriate.
3. Save the final Markdown report as `report.md` in the `/tmp` directory by using the provided filesystem tool.
Important rules:
- Never output raw text in your response. The final result must always be written to `report.md`.
- If no useful results are retrieved, write a short note in `report.md` explaining that no information was found.
- Do not attempt to bypass or ignore the retriever or the filesystem tool.
contentRetrievers:
- type: io.kestra.plugin.ai.retriever.TavilyWebSearch
apiKey: "{{ kv('TAVILY_API_KEY') }}"
maxResults: 10
tools:
- type: io.kestra.plugin.ai.tool.DockerMcpClient
image: mcp/filesystem
command: ["/tmp"]
binds: ["{{workingDir}}:/tmp"] # mount host_path:container_path to access the generated report
outputFiles:
- report.md
Properties
prompt *Requiredstring
provider *RequiredNon-dynamicAmazonBedrockAnthropicAzureOpenAIDeepSeekGoogleGeminiGoogleVertexAIMistralAIOllamaOpenAI
configuration Non-dynamicChatConfiguration
Default
{}
contentRetrievers GoogleCustomWebSearchTavilyWebSearch
maxSequentialToolsInvocations integerstring
memory Non-dynamicKestraKVStoreRedis
outputFiles array
SubType string
systemMessage string
Outputs
finishReason string
Possible Values
STOP
LENGTH
TOOL_EXECUTION
CONTENT_FILTER
OTHER
jsonOutput object
outputFiles object
SubType string
requestDuration integer
textOutput string
tokenUsage TokenUsage
Definitions
Mistral AI Model Provider
apiKey *Requiredstring
modelName *Requiredstring
type *Requiredobject
baseUrl string
Model Context Protocol (MCP) Stdio client tool
command *Requiredarray
SubType string
type *Requiredobject
env object
SubType string
logEvents booleanstring
Default
false
Call a Kestra flow as a tool
type *Requiredobject
description string
flowId string
inheritLabels booleanstring
Default
false
inputs object
labels arrayobject
namespace string
revision integerstring
scheduleDate string
Format
date-time
Model Context Protocol (MCP) SSE client tool
type *Requiredobject
url *Requiredstring
headers object
SubType string
logRequests booleanstring
Default
false
logResponses booleanstring
Default
false
timeout string
Format
duration
io.kestra.plugin.ai.domain.AIOutput-ToolExecution
requestArguments object
requestId string
requestName string
result string
Deepseek Model Provider
apiKey *Requiredstring
modelName *Requiredstring
type *Requiredobject
baseUrl string
Default
https://api.deepseek.com/v1
io.kestra.plugin.ai.domain.AIOutput-AIResponse
completion string
finishReason string
Possible Values
STOP
LENGTH
TOOL_EXECUTION
CONTENT_FILTER
OTHER
id string
requestDuration integer
tokenUsage TokenUsage
io.kestra.plugin.ai.domain.ChatConfiguration-ResponseFormat
jsonSchema object
jsonSchemaDescription string
type string
Default
TEXT
Possible Values
TEXT
JSON
Model Context Protocol (MCP) Docker client tool
image *Requiredstring
type *Requiredobject
apiVersion string
binds array
SubType string
command array
SubType string
dockerCertPath string
dockerConfig string
dockerContext string
dockerHost string
dockerTlsVerify booleanstring
env object
SubType string
logEvents booleanstring
Default
false
registryEmail string
registryPassword string
registryUrl string
registryUsername string
Google Custom Search web tool
apiKey *Requiredstring
csi *Requiredstring
type *Requiredobject
Ollama Model Provider
endpoint *Requiredstring
modelName *Requiredstring
type *Requiredobject
Code execution tool using Judge0
apiKey *Requiredstring
type *Requiredobject
OpenAI Model Provider
apiKey *Requiredstring
modelName *Requiredstring
type *Requiredobject
baseUrl string
Web search content retriever for Google Custom Search
apiKey *Requiredstring
csi *Requiredstring
type *Requiredobject
maxResults integerstring
Default
3
io.kestra.plugin.ai.domain.ChatConfiguration
logRequests booleanstring
logResponses booleanstring
responseFormat ChatConfiguration-ResponseFormat
seed integerstring
temperature numberstring
topK integerstring
topP numberstring
io.kestra.plugin.ai.domain.TokenUsage
inputTokenCount integer
outputTokenCount integer
totalTokenCount integer
io.kestra.plugin.ai.domain.AIOutput-AIResponse-ToolExecutionRequest
arguments object
id string
name string
Azure OpenAI Model Provider
endpoint *Requiredstring
modelName *Requiredstring
type *Requiredobject
apiKey string
clientId string
clientSecret string
serviceVersion string
tenantId string
Google VertexAI Model Provider
endpoint *Requiredstring
location *Requiredstring
modelName *Requiredstring
project *Requiredstring
type *Requiredobject
Google Gemini Model Provider
apiKey *Requiredstring
modelName *Requiredstring
type *Requiredobject
Model Context Protocol (MCP) SSE client tool
sseUrl *Requiredstring
type *Requiredobject
headers object
SubType string
logRequests booleanstring
Default
false
logResponses booleanstring
Default
false
timeout string
Format
duration
WebSearch content retriever for Tavily Search
apiKey *Requiredstring
type *Requiredobject
maxResults integerstring
Default
3
Chat Memory backed by Redis
host *Requiredstring
type *Requiredobject
drop string
Default
NEVER
Possible Values
NEVER
BEFORE_TASKRUN
AFTER_TASKRUN
memoryId string
Default
{{ labels.system.correlationId }}
messages integerstring
Default
10
port integerstring
Default
6379
ttl string
Default
PT1H
Format
duration
Anthropic AI Model Provider
apiKey *Requiredstring
modelName *Requiredstring
type *Requiredobject
WebSearch tool for Tavily Search
apiKey *Requiredstring
type *Requiredobject
In-memory Chat Memory that stores its data as Kestra KV pairs
type *Requiredobject
drop string
Default
NEVER
Possible Values
NEVER
BEFORE_TASKRUN
AFTER_TASKRUN
memoryId string
Default
{{ labels.system.correlationId }}
messages integerstring
Default
10
ttl string
Default
PT1H
Format
duration
Amazon Bedrock Model Provider
accessKeyId *Requiredstring
modelName *Requiredstring
secretAccessKey *Requiredstring
type *Requiredobject
modelType string
Default
COHERE
Possible Values
COHERE
TITAN