Skip to main content

AI Chatbots

Kaanha AI includes a powerful chatbot system with two types: AI Agents (LLM-powered) and Flow Bots (visual decision trees). Both can run simultaneously and hand off to human agents.

AI Agents

AI Agents use large language models to have natural conversations with your customers. They are configured with a business task so they stay focused on your use case.

Supported Agent Types

TypeDescriptionBest For
Built-in LLMOpenAI GPT-4o, Anthropic Claude, or any OpenAI-compatible endpointGeneral FAQ, support, lead qualification
Python Bot WebhookYour own chatbot endpoint (HMAC-signed POST)Custom logic, existing bots
Notion Knowledge BaseRAG over your Notion pagesFAQ from docs, product catalogs

Creating an AI Agent

  1. Go to Chatbot → AI Agents → Create Agent
  2. Fill in the required fields:
FieldDescription
NameInternal name for the agent
Business TaskRequired — what this agent does (FAQ, Order Tracking, Support, Booking, Lead Qualification, Feedback)
Trigger KeywordsComma-separated words that activate this agent (e.g., help, support, hi)
System PromptInstructions for the AI about your business, tone, and what to answer
ProviderOpenAI / Anthropic / Custom LLM
Modele.g., gpt-4o, gpt-4o-mini, claude-3-5-sonnet-20241022
  1. (Optional) Configure advanced settings:
    • Max Turns: Auto-handoff to human after N messages (default: 10)
    • Business Hours Only: Agent only responds during your configured business hours
    • Temperature: Response creativity (0.0–1.0)

Business Task Requirement

Every AI Agent must have a businessTask field. This is required by Meta’s January 2026 AI Policy. The platform appends a safety prompt enforcing task boundaries to every agent’s system prompt. Available tasks: faq, order_tracking, customer_support, booking, lead_qualification, feedback, other

Testing an AI Agent

Use the Test button on the agent card to simulate a conversation. Test history is preserved in the session so you can iterate on the system prompt.

Notion Knowledge Base (RAG)

The Notion RAG agent syncs your Notion pages, chunks the content, generates embeddings, and retrieves the most relevant chunks when answering questions.
  1. Select Type: Notion Knowledge Base
  2. Enter your Notion API Key and Database/Page ID
  3. Click Sync Knowledge Base
  4. The agent will now answer questions grounded in your Notion content
Sync status shows: total chunks, last synced, and embedding count.

Flow Bots

Flow Bots are visual, rule-based conversation trees. They’re deterministic — the same input always produces the same output.

Creating a Flow Bot

  1. Go to Chatbot → Flow Bots → Create Flow
  2. Enter a name and trigger keywords
  3. Click Visual Editor → to open the drag-and-drop canvas

Node Types

NodeDescription
MessageSend a text/media message to the contact
ConditionBranch based on contact data, tags, or message content
DelayWait N minutes/hours before continuing
WebhookCall an external URL and branch on response

Flow Editor

The visual editor uses a canvas with nodes and connections:
  • Drag nodes to reposition them
  • Click a node to edit its content
  • Connect nodes by dragging from the output handle
  • Use the Save button to persist changes

Priority Chain

When an incoming message arrives, Kaanha AI checks in this order:
1. Is there an active AI Agent conversation? → Continue it
2. Is there an active Flow Bot conversation? → Continue it
3. Does any AI Agent keyword match? → Start AI Agent
4. Does any Flow Bot keyword match? → Start Flow Bot
5. No match → Place in human queue (OPEN status)

Human Handoff

AI Agents automatically hand off to humans when:
  • The contact types HUMAN, AGENT, HELP, or any of 12 handoff keywords
  • The agent includes [HANDOFF] in its response
  • Max turns are reached
  • An error occurs
After handoff, the conversation status changes to OPEN and appears in the agent queue.

Content Safety

All AI responses pass through a content safety filter (22 patterns, 7 categories) before being sent. This includes:
  • Harmful instructions
  • Personal data requests
  • Off-topic content
  • Competitor mentions (configurable)
Blocked responses trigger automatic handoff to a human agent.

Chatbot Analytics

Go to Chatbot → Analytics to see:
  • Total conversations handled per agent
  • Handoff rate
  • Average turns before handoff
  • Most common trigger keywords