Skip to main content

Agent AI Component

The Agent AI component enables workflows to leverage large language models (LLMs) with the ability to use other components as tools. This component can process natural language prompts and dynamically interact with other integrations or workflows to accomplish complex tasks.

Credit Cost

Varies by model. Each model has specific credit costs for:

  • Input tokens (shown in blue)
  • Output tokens (shown in orange)
  • Tool execution costs are added separately based on the tools used

Usage

The Agent AI component acts as an intelligent orchestrator that can:

  • Process natural language instructions
  • Make decisions about which tools to use
  • Execute tools in sequence or parallel
  • Maintain conversation context
  • Handle complex multi-step tasks

Properties

Title

  • Type: text
  • Description: An identifier for the component. Used for organizational purposes only and doesn't affect execution.
  • Default: "Agent AI"

Model

  • Type: model selector
  • Description: Search and select from available LLM models. Each model displays:
    • Name and creation date
    • Modality (text->text or text+image->text)
    • Credit costs (input/output per million tokens)
    • Context length
    • Brief description
  • Note: Choose models with sufficient context length for complex tool interactions

System Prompt

  • Type: text
  • Description: Defines the agent's role, objectives, and behavior. Critical for guiding the agent in tool selection and usage.
  • Best Practices:
    • Define clear objectives and constraints
    • Specify when and how tools should be used
    • Establish decision-making criteria
    • Set output format requirements

User Prompt

  • Type: text
  • Description: The specific task or query for the agent to process. This is where you provide the actual instructions or questions.
  • Best Practices:
    • Be specific about the desired outcome
    • Provide necessary context
    • Break complex tasks into clear steps
    • Reference any relevant constraints

Memory Type

  • Type: option
  • Options:
    • No Memory: The agent starts fresh each time, with no recollection of previous interactions
    • Full Memory: The agent maintains context across multiple interactions in the same conversation
  • Default: "Full Memory"
  • Best Practices:
    • Use "Full Memory" for conversational interactions or multi-step tasks
    • Use "No Memory" for independent, stateless operations

Tools

  • Type: workflow list
  • Description: The collection of workflows and integrations available to the agent
  • Configuration:
    • Drag and drop workflows to add them as tools
    • Configure tool descriptions and parameters
    • Order tools by importance or frequency of use
  • Best Practices:
    • Only include relevant tools for the task
    • Provide clear descriptions for each tool
    • Ensure tool inputs are well-documented
    • Test tools individually before adding them

MCP (Model Control Protocol)

  • Type: service list
  • Description: External services that provide additional capabilities to the agent
  • Features:
    • Direct integration with services like Gmail
    • Real-time data access and manipulation
    • Standardized interface for service interactions

Tool Configuration

The Agent AI component can use other workflows as tools, allowing it to perform complex operations through natural language instructions. Each tool represents a workflow that the agent can execute when needed.

Adding Tools

Tools can be added to the agent in two ways:

  1. Drag and Drop: Directly drag workflows from the sidebar into the agent's tool area
  2. Version Selection: When adding a tool, you can specify which version of the workflow to use:
    • Latest version (automatically on selection)
    • Specific version

Tool Properties

When a workflow is added as a tool, several properties can be configured:

  • Name: How the agent will refer to this tool
  • Description: Detailed explanation of what the tool does and when to use it
  • Input Parameters descrption: Description of each input the tool accepts
  • Version: Which version of the workflow to use

Tool Usage

The agent decides when and how to use tools based on:

  1. The system prompt instructions
  2. The specific user query
  3. Tool descriptions and capabilities
  4. Previous interactions (if using memory)

For example, if you have a search tool and an email tool, you might instruct the agent:

{
"systemPrompt": "You are a research assistant. Use the search tool to find information, and the email tool to send summaries when requested.",
"userPrompt": "Research AI trends and email me a summary"
}

Examples

Basic Agent with MCP Integration

The Agent AI component can use MCP (Model Control Protocol) services like Gmail as tools. This allows the agent to perform operations like reading and sending emails directly through the MCP service.

Agent AI with MCP Gmail Integration

In this example, the agent has access to Gmail operations through MCP integration, allowing it to send emails.

Basic Agent with Workflow as Tool

The Agent AI component can also use other Arkai workflows as tools, allowing for complex automation chains.

Agent AI with Embedded Workflow

In this example, the agent has access to an online search workflow that it can use to gather information from the web and make informed decisions based on the search results.

Output Data

The Agent AI component outputs the following data:

export type AgentAIOutput = {
"Agent Answer": {
dataType: "text",
data: string;
};
};
FieldDescription
Agent AnswerThe final response from the agent, including any actions taken or decisions made

Best Practices

  1. Clear Instructions: Provide detailed system prompts to guide the agent's behavior
  2. Tool Selection: Choose tools that are relevant to the task at hand
  3. Memory Management: Use "full-memory" for conversations and "no-memory" for one-off tasks
  4. Error Handling: Implement error handling in the tools to manage potential failures
  5. Testing: Test the agent with various scenarios to ensure reliable performance
  6. Security: Be cautious with sensitive data in prompts and tool configurations

Integration with Other Components

The Agent AI component can be used in combination with other integration components to create powerful automated workflows. For example:

  • Reading and responding to emails
  • Managing calendar events
  • Updating spreadsheets
  • Processing documents
  • Making API calls

Limitations

  1. Token limits of the underlying LLM model
  2. Tool execution timeouts
  3. Memory constraints in long conversations
  4. Rate limits of integrated services