Actions2
Overview
The UniCraft AI Agent node enables interaction with an AI agent that supports conversational memory, tool integrations, and smart model routing. It is designed to facilitate advanced AI-driven conversations where the agent can remember context, call external tools, or dynamically select the best AI model based on a strategy.
This node is beneficial in scenarios such as:
- Building chatbots that maintain conversation history for more coherent interactions.
- Automating workflows where the AI agent can invoke external APIs or functions (tools) to enrich responses.
- Optimizing AI usage by automatically selecting models based on cost, performance, or availability preferences.
For example, you could use this node to create a customer support assistant that remembers previous messages, calls a product database API to fetch details, and chooses the most appropriate AI model depending on current load or cost constraints.
Properties
| Name | Meaning |
|---|---|
| Operation | Selects the operation mode: "Chat" to interact normally with the AI agent, or "Manual Trigger" to manually send input data to the agent. |
| Agent Type | Type of AI agent to create. Options include: - Conversational Agent - Tool-Enabled Agent - Smart Routing Agent - Custom Agent |
| Input Message | The message text sent to the AI agent when using Manual Trigger operation. |
| System Message | Defines the agent's behavior and personality; acts as a system prompt guiding the AI's responses. |
| Memory Configuration | Configures how the agent maintains conversation memory. Options: - Memory Type (buffer, summary, token_buffer, window, none) - Max Messages (for window type) - Max Tokens (for token_buffer type) - Summary Threshold (for summary type) |
| Model Configuration | Configures the AI model used by the agent: - Mode: Smart Routing (auto-select model) or Manual (select specific model) - Model (when manual) - Smart Routing Strategy (balanced, cost optimized, etc.) - Temperature (sampling randomness) - Max Tokens (max tokens to generate) |
| Tools Configuration | Configure tools available to the agent: - Enable Tools (boolean) - Tool list: each with Name, Description, Parameters (JSON schema), and API Endpoint |
| Advanced Configuration | Advanced options: - Max Iterations (for tool-enabled agents) - Timeout (seconds) for agent execution - Enable Streaming (boolean) - Return Intermediate Steps (boolean) |
Output
The node outputs JSON objects containing the AI agent's response and metadata:
response: Object withrole: Role of the responder (usually "assistant")content: Text content of the AI's replytool_calls: Array of any tool invocations made during the response
usage: Token usage statistics from the AI providermodel: The AI model used for generating the responseprovider: Fixed string"unicraft"agentType: The selected agent typetext/message: The textual response repeated for convenienceconversationId: Identifier for the conversation sessionmemory: If memory is enabled, includes memory type and configurationsmartRouting: Present if smart routing mode is used, showing strategy and selected modeltools: Information about tools available and called during the responseintermediateSteps: Optional detailed info about request/response and processing time if enabled
No binary data output is produced by this node.
Dependencies
- Requires an API key credential for the UniCraft API service.
- Needs proper configuration of the UniCraft API base URL and API key in credentials.
- Uses UniCraft API endpoints for:
- Fetching available AI models
- Fetching smart routing strategies
- Sending chat completion requests (either standard or smart routing)
- Network connectivity to UniCraft API is required.
Troubleshooting
- Missing Credentials: The node will throw an error if the UniCraft API base URL or API key is not set or invalid. Ensure credentials are configured correctly.
- Empty User Message: If no valid input message is found in the input data or provided manually, the node errors out. Provide a non-empty message via input or parameters.
- Invalid Input Data Format: The node expects input JSON to contain one of these fields for the user message:
message,text,prompt,query, or amessagesarray. Incorrect formats cause errors. - API Request Failures: Network issues or invalid API keys will result in request errors. Check API key validity and network access.
- Tool Configuration Errors: If tools are enabled but improperly configured (e.g., missing required fields), the node may fail or behave unexpectedly.
- Timeouts: Long-running requests may timeout based on the configured timeout setting; increase it if needed.
- Continue On Fail: When enabled, the node returns error information per item instead of stopping execution.
Links and References
- UniCraft AI Agent Documentation: https://cloudcraftlabs.io/docs/unicraft/agents