Embedded AI agent that can use tools, access data, and have multi-turn conversations with users.

Configuration

  • id: Unique node identifier
  • system_prompt: Instructions for the agent’s behavior
  • provider_model_name: AI model to use
  • temperature: Model creativity, 0.0-1.0 (default: 0.0)
  • max_iterations: Maximum tool calls/responses (default: 80)
  • max_tokens: Maximum tokens per response (default: 8192)
  • reasoning_effort: For o1 models - low, medium, high (optional)
  • webhooks: Custom API tools (optional)
  • mcp_servers: MCP server tools (optional, HTTP streamable only)

Built-in tools

Examples

Customer support agent
from kapso.builder.flows.nodes import AgentNode

node = AgentNode(
    id="support_agent",
    system_prompt="You are a helpful customer support agent. Help resolve user issues and answer questions about orders, billing, and technical problems.",
    provider_model_name="claude-3-5-sonnet-20241022"
)
Agent with webhook tools
from kapso.builder.flows.nodes.agent import FlowAgentWebhook

# Define API tool
check_order = FlowAgentWebhook(
    name="check_order_status",
    url="https://api.example.com/orders/{order_id}",
    description="Check the status of a customer order",
    http_method="GET",
    headers={"Authorization": "Bearer {{api_token}}"}
)

node = AgentNode(
    id="order_agent", 
    system_prompt="Help customers check their order status. Use the check_order_status tool when they provide an order ID.",
    provider_model_name="gpt-4o",
    webhooks=[check_order]
)
Agent with MCP server
from kapso.builder.flows.nodes.agent import FlowAgentMcpServer

# Define MCP server (HTTP streamable transport)
context_server = FlowAgentMcpServer(
    name="Documentation Server",
    url="https://mcp.context7.ai/v1",
    description="Access to documentation and knowledge bases",
    headers={"Authorization": "Bearer token123"}
)

node = AgentNode(
    id="doc_agent",
    system_prompt="Help users with documentation questions using the available tools.",
    provider_model_name="claude-3-5-sonnet-20241022",
    mcp_servers=[context_server]
)
High-reasoning agent
node = AgentNode(
    id="complex_support",
    system_prompt="You are an expert technical support agent. Analyze complex problems step by step.",
    provider_model_name="o1-preview",
    reasoning_effort="high",
    temperature=0.1,
    max_iterations=50
)

How it works

  1. Starts conversation: Uses system prompt and conversation history
  2. Tool access: Can call built-in tools and custom webhooks
  3. Multi-turn: Continues until calls complete_task or needs user input
  4. Message injection: New user messages are automatically injected during conversation
  5. Flow control: Returns next edge when task completed, wait when needs input

Usage patterns

Support flow Data processing