Docs / Strand / nodes/ai-connectors
AI Connectors
Strand includes built-in AI connectors for OpenAI, Anthropic Claude, and Google Gemini. All three share the same node-level features: prompting, system instructions, MCP tool access, retries, and conversation memory. The only differences are provider-specific settings like API keys and available models.
Node Configuration
Every AI node supports these settings. Provider-specific fields (API key, default model) are configured on the connector itself; see each provider's page for those details.
| Field | Required | Default | Description | |
|---|---|---|---|---|
| Prompt | Yes | `{{ payload \ | tojson }}` | Prompt sent to the model. Supports Jinja2 templates |
| System Instructions | No | - | Instructions that set the model's persona and behavior for this node | |
| Model | No | connector default | Override the default model for this specific node | |
| Temperature | No | connector default | Override temperature for this node | |
| Max Tokens | No | connector default | Override max response tokens for this node | |
| Timeout | No | connector default | Override request timeout in seconds (10–600) | |
| Max Retries | No | 2 |
Retries on transient errors such as rate limits and server errors (0–5) | |
| MCP Servers | No | - | MCP server connectors to attach as tools for this call | |
| Memory Enabled | No | false |
Turn on conversation memory. The AI will remember prior exchanges across workflow runs | |
| Memory TTL | No | 3600 |
Seconds to retain conversation history (60–2592000). Resets on each access | |
| Memory Max Messages | No | 20 |
Maximum messages to keep in memory. Oldest are trimmed first (2–100) |
Temperature
Temperature controls how random or creative the model's responses are. A value of 0 makes the model deterministic: it will give the same answer every time for the same input. Higher values introduce more variation and creativity. The default is 0.7, which works well for general-purpose tasks.
- 0: Deterministic. Best for classification, extraction, and structured output
- 0.3–0.7: Balanced. Good for most tasks (summarisation, analysis, Q&A)
- 1.0+: Creative. Useful for brainstorming or generating varied content
Temperature can be set on the connector (applies to all nodes using it) or overridden per node.
Output
All AI connectors return the same output structure:
{
"success": true,
"status": "completed",
"data": {
"response": "The analysis shows...",
"model": "gpt-4o-mini",
"provider": "openai",
"usage": {
"prompt_tokens": 150,
"completion_tokens": 89,
"total_tokens": 239
}
},
"service": "ai.openai",
"operation": "chat"
}
When memory is enabled, memory_enabled is included in data:
{
"data": {
"response": "Sure, picking up where we left off...",
"model": "gpt-4o-mini",
"provider": "openai",
"memory_enabled": true,
"usage": { ... }
}
}
Access the response in downstream nodes:
{{ payload.data.response }}
{{ payload.data.usage.total_tokens }}
Conversation Memory
By default, each node invocation is stateless: the model has no awareness of previous runs. Toggle Memory Enabled on and the node will remember every exchange, building on previous context the next time the workflow runs. No extra configuration needed.
Each node automatically gets its own isolated memory. Two AI nodes in the same workflow can never accidentally share or overwrite each other's history. Memory is also isolated per account.
When to enable memory:
- The AI needs to build on insights from previous workflow runs
- Processing a series of related events that add context over time
- Keeping the model aware of decisions made in earlier runs
When to leave it off:
- Single-shot classification, transformation, or extraction tasks
- Nodes where every run should be independent
- High-volume workflows where token cost is a concern (full history is sent to the model on every call)
Controlling memory size:
The Memory Max Messages setting limits how many messages are retained. Once the limit is reached, the oldest messages are dropped. Keep this number low for simple tasks and higher for workflows that need longer context.
Tip: When messages are trimmed, early context is lost. If your workflow depends on persistent instructions or rules, put them in the System Instructions field instead; system instructions are sent on every call regardless of memory state and are never trimmed.
Memory TTL:
The Memory TTL controls how long history is kept. After the TTL expires the conversation starts fresh. Use a short TTL (e.g. 3600 = 1 hour) for short-lived tasks and a longer one (e.g. 604800 = 7 days) for ongoing analysis.
Clearing memory:
Use the Clear Memory button in the node inspector to delete all stored history. The AI will start fresh on the next run. This is useful when the conversation has gone off track or accumulated stale context.
Storage note:
Conversation memory is held in fast, ephemeral storage and is not guaranteed to be durable. For critical long-running analysis, persist key findings in downstream nodes rather than relying solely on AI memory.
MCP Tool Access
AI nodes can call external tools via MCP servers. Add one or more MCP server connectors to the MCP Servers field and the model will have access to those tools during its response. Tool calls and results are included in the output when they occur.
Retries
AI nodes automatically retry on transient errors: rate limits (429), server errors (5xx), timeouts, and connection failures. The retry uses exponential backoff with jitter and respects Retry-After headers from the provider. Non-retryable errors (auth failures, bad requests) fail immediately.
Examples
Single-shot classification (no memory)
- System Instructions:
Classify the following support ticket as one of: billing, technical, general. Respond with only the category name. - Prompt:
{{ payload.ticket_body }} - Temperature:
0
Ongoing analysis (with memory)
- System Instructions:
You are a data analyst. Build on your previous analysis when new data arrives. - Prompt:
{{ payload.data | tojson }} - Memory Enabled:
true - Memory TTL:
604800(7 days) - Memory Max Messages:
50
Each time the workflow runs, the AI sees new data along with its prior analysis. It can spot trends, reference earlier findings, and build a richer picture over time.
Multi-step analysis pipeline
Different AI nodes in the same workflow keep separate memories automatically:
- Node 1 (classifier): memory off, for a fresh classification each time
- Node 2 (analyst): memory on, so it builds context across runs and references earlier findings
- Node 3 (summariser): memory off, producing a final summary from structured input
Providers
- OpenAI: GPT models (
gpt-4o-mini,gpt-4o,gpt-4-turbo) - Anthropic Claude: Claude models (
claude-sonnet-5,claude-opus-5,claude-haiku-4-5) - Google Gemini: Gemini models (
gemini-2.5-flash,gemini-2.5-pro,gemini-2.5-flash-lite)
Related
- MCP Server (for tool access)
- Connector Output Structure
Tendrl