Introduction to building agents with the Kapso Python SDK
The Kapso Builder is a Python library that enables you to programmatically create sophisticated conversational AI agents using Python’s type-safe, IDE-friendly environment.
from kapso.builder import Agentfrom kapso.builder.nodes import SubagentNode, WarmEndNode, HandoffNodefrom kapso.builder.nodes.subagent import WebhookTool, KnowledgeBaseToolfrom kapso.builder.agent.constants import START_NODE, END_NODE# Create an agentagent = Agent( name="customer_support", system_prompt="You are a helpful customer support assistant")# Create a SubagentNode with toolssubagent = SubagentNode( name="assistant", prompt="Help customers with their inquiries using available tools")# Add toolssubagent.add_tool(WebhookTool( name="check_order", url="https://api.example.com/orders/{{order_id}}", description="Check order status"))subagent.add_tool(KnowledgeBaseTool( name="policies", knowledge_base_text="Return policy: 30 days...", description="Company policies"))# Add nodes and create flowagent.add_node(START_NODE)agent.add_node(subagent)agent.add_node(END_NODE)agent.add_edge(START_NODE, "assistant")agent.add_edge("assistant", END_NODE)# Validate and deployagent.validate()
For comprehensive documentation on all Builder SDK features, node types, and advanced patterns, see the Builder Reference section in the top navigation.