UniCraft AI Agent

UniCraft AI Agent with Memory, Tools, and Smart Routing capabilities

Overview

The UniCraft AI Agent node enables conversational interactions with an AI agent that supports memory management, tool integrations, and smart model routing. It is designed to facilitate advanced AI-driven chat experiences where the agent can remember conversation context, call external tools or APIs, and dynamically select the best AI model based on configured strategies.

Common scenarios include:

  • Building chatbots that maintain context over multiple messages.
  • Automating workflows by integrating AI with external tools or APIs.
  • Optimizing AI usage by selecting models automatically for cost, performance, or availability.
  • Customizing AI behavior via system messages and memory configurations.

Practical examples:

  • A customer support chatbot that recalls previous user queries and uses external APIs to fetch order status.
  • An AI assistant that routes requests to different AI models depending on complexity or cost constraints.
  • A developer tool that allows manual triggering of AI responses with custom input messages.

Properties

Name Meaning
Operation The action to perform: "Chat" to interact with the AI agent or "Manual Trigger" to send custom input data manually.
Agent Type Type of AI agent to create. Options: Conversational Agent, Tool-Enabled Agent, Smart Routing Agent, Custom Agent.
Input Message The message text sent to the AI agent (used mainly in Manual Trigger operation).
System Message Defines the AI agent's behavior and personality; a system-level prompt guiding the agent's responses.
Memory Configuration How the agent maintains conversation history. Options include: Conversation Buffer, Conversation Summary, Conversation Token Buffer, Conversation Window, No Memory. Additional settings control max messages, tokens, or summary thresholds.
Model Configuration Settings for the AI model used by the agent. Includes mode ("Smart Routing" or "Manual"), model selection (when manual), smart routing strategy (e.g., balanced, cost optimized), temperature (randomness), and max tokens generated.
Tools Configuration Enables and configures external tools/functions the agent can call. Includes enabling tool calling and defining multiple tools with name, description, parameters schema, and API endpoint.
Advanced Configuration Advanced options such as max iterations for tool-enabled agents, timeout duration, enabling streaming responses, and returning intermediate execution steps.

Output

The node outputs JSON objects containing:

  • response: The AI assistant's reply including role and content.
  • usage: Token usage statistics from the AI response.
  • model: The AI model used for generating the response.
  • provider: Fixed string identifying the provider ("unicraft").
  • agentType: The type of agent used.
  • text / message: The textual content of the AI's reply.
  • conversationId: Identifier for the conversation session.
  • memory: If memory is enabled, includes memory type and configuration.
  • smartRouting: If smart routing is used, details about the strategy and selected model.
  • tools: Information about available tools, calls made, and details of those calls.
  • intermediateSteps: Optional detailed info about request/response and processing time if enabled.

If the agent uses tools, the output includes details of tool calls made during the interaction.

No binary data output is indicated.

Dependencies

  • Requires an API key credential for the UniCraft API service.
  • Needs proper configuration of the UniCraft API base URL and API key.
  • Uses UniCraft API endpoints for:
    • Fetching available AI models.
    • Fetching smart routing strategies.
    • Sending chat completion requests (either standard or smart routing).
  • n8n HTTP Request helper is used for API communication.
  • Optional: External tools configured must have valid API endpoints accessible by the node.

Troubleshooting

  • Missing Credentials: The node requires both a base URL and API key for UniCraft API. Errors will occur if these are missing or invalid.
  • Invalid Input Message: If no valid message is found in input data (expected fields: message, text, prompt, query, or messages array), the node throws an error.
  • Empty User Message: Sending an empty message causes an error; ensure input messages are non-empty.
  • API Request Failures: Network issues, invalid API keys, or misconfigured endpoints may cause request failures. Error messages from the API are surfaced.
  • Invalid Models or Strategies Response: If the API returns unexpected data when loading models or strategies, the node reports errors.
  • Timeouts: The node has a configurable timeout (default 30 seconds); long-running requests may fail if this is exceeded.
  • JSON Parsing Errors: Tool parameters must be valid JSON; malformed JSON in tool configuration can cause errors.
  • Continue On Fail: If enabled, the node continues processing subsequent items even if one fails, returning error details per item.

Links and References

Discussion