AI Agent
An autonomous AI agent that uses a ReAct (Reasoning + Acting) loop to process messages, call tools, and generate responses. Connect any action node as a tool, attach memory for conversation context, and choose from OpenAI, Anthropic, or any OpenAI-compatible LLM provider.
Use AI Agent when you need an LLM to reason about inputs and dynamically decide which tools to call:
- Building a chatbot or conversational assistant
- Creating a customer support agent that searches knowledge bases and calls APIs
- Orchestrating multi-step tasks where the LLM decides the next action
- Processing unstructured data with natural language understanding
| Handle | Type | Description |
|---|---|---|
message | any | The input message or data for the agent to process. Typically a user's chat message or a structured payload from a trigger. |
| Handle | Type | Description |
|---|---|---|
Tools | dynamic | Connect any action node (HTTP Request, Code, MCP Server, etc.) to give the agent tools it can call. Multiple tools can be connected — each appears as a new handle slot. |
Memory | memory | Connect a memory plugin (Window Memory or Qdrant Memory) to give the agent conversation history across messages. |
| Handle | Type | Description |
|---|---|---|
response | object | The agent's response after completing its reasoning loop. |
The response (accessed as {{ ai_agent.* }}) shape:
| Field | Type | Description |
|---|---|---|
answer | string | The agent's final text response to the user. |
tool_calls | array | List of tool calls made during the reasoning loop, including tool name, arguments, and results. |
iterations | number | How many reasoning iterations the agent performed before producing a final answer. |
Additional output fields:
| Field | Type | Description |
|---|---|---|
usage | object | Token usage statistics from the LLM (prompt tokens, completion tokens, total). |
warning | string | null | Warning message if the agent hit max iterations or encountered a recoverable issue. |
The agent has a control output handle On Error. If the LLM API call fails (invalid key, model not found, rate limit exhausted after retries), execution routes through this handle instead of response. Connect it to a Return node to send a custom error response.
| Setting | Type | Default | Description |
|---|---|---|---|
provider | select | openai | LLM provider: OpenAI, Anthropic, or Custom (any OpenAI-compatible endpoint like Ollama, DeepSeek, Together AI). |
model | string | gpt-4o | Model identifier. Supports bindings for dynamic model selection. |
customBaseUrl | string | — | Base URL for custom providers (e.g. http://localhost:11434/v1). Only shown when provider is Custom. |
temperature | number | 0.7 | Sampling temperature. 0 = deterministic, 2 = creative. |
| Setting | Type | Default | Description |
|---|---|---|---|
systemPrompt | text | You are a helpful assistant. | System prompt defining the agent's role and instructions. Supports {{ }} bindings. |
maxIterations | number | 10 | Maximum tool-use iterations before forcing a final answer. |
retryCount | number | 3 | Retries for transient LLM API errors (429, 500). |
| Setting | Type | Default | Description |
|---|---|---|---|
outputSchema | JSON | — | JSON Schema for structured output. When set, the agent validates its final answer against this schema. |
streaming | boolean | true | Stream tokens and tool events in real-time via SSE. Required for the Playground chat mode. |
| Setting | Type | Default | Description |
|---|---|---|---|
sessionKey | string | — | Key for scoping memory per user or thread. Use bindings like user:{{ input.body.user_id }}. |
| Environment Variable | Provider | When Required |
|---|---|---|
OPENAI_API_KEY | OpenAI | When provider is openai |
ANTHROPIC_API_KEY | Anthropic | When provider is anthropic |
CUSTOM_API_KEY | Custom | When provider is custom |
Build a simple Q&A agent with web search:
- Add a Webhook Trigger (or API Endpoint with OpenAI Chat protocol for SDK compatibility)
- Add an AI Agent node and connect the trigger's output to the agent's
messageinput - Add an HTTP Request node configured to call a search API — connect it to the agent's
Toolshandle - Add a Return node and connect the agent's
responseoutput to it - Configure the system prompt:
"You are a research assistant. Use the search tool to find accurate information before answering." - Set the provider and model (e.g. OpenAI / gpt-4o)
The agent will receive a user question, decide whether to search, call the HTTP Request tool if needed, and return a grounded answer.
Any action node connected to the Tools handle becomes a callable tool. The agent sees the tool's name, description, and expected inputs. During reasoning, it can call any connected tool and use the result.
Common tool combinations:
- HTTP Request — call external APIs, search engines, databases
- Code — run custom Python logic, data processing, calculations
- MCP Server — connect to external MCP-compatible tool servers (Stripe, databases, etc.)
- Subworkflow — call another Tensorify workflow as a tool
Connect a Window Memory or Qdrant Memory node to the Memory handle. The agent loads conversation history before reasoning and saves new messages after responding.
Without memory, each request is independent — the agent has no context from previous messages.
- API keys: Set the provider's API key in your team's Environment Variables (e.g.
OPENAI_API_KEY). The agent reads it at runtime. - Tool descriptions matter: The agent uses tool names and descriptions to decide which tool to call. Vague names lead to unreliable tool selection.
- Max iterations: If the agent hits
maxIterations, it returns its best answer so far. Increase the limit for complex multi-step tasks. - Streaming requires OpenAI Chat protocol: SSE streaming works through the API Endpoint trigger with
protocol: openai-chat. The Playground's Chat mode consumes this stream automatically. Manual Trigger does not support streaming. - Tool limit: Up to 20 tool connections per agent. If you need more, use MCP Server nodes which bundle multiple tools from a single connection.
- Default session key: When no
sessionKeyis set and memory is connected, the agent falls back toagent_memory:{workflow_id}. This means all users share one conversation buffer — always set a session key in production. - Output schema + tools/streaming: When tools are connected or streaming is enabled,
outputSchemavalidation is skipped. The agent returns free-form text instead.
- Window Memory — conversation history with a sliding window
- Qdrant Memory — semantic search over long-term conversation history
- MCP Server — connect external tool servers
- Build an AI Agent — step-by-step guide
- Agent Memory Guide — choosing and configuring memory
