Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.kaanha.ai/llms.txt

Use this file to discover all available pages before exploring further.

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, Anthropic, Google, Groq, 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 / Google / Groq / Custom LLM
Modele.g., gpt-4o-mini, claude-haiku-4-5, gemini-1.5-flash
  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)
    • Auto-inject Product Catalog: Prepend your active product catalog into the system prompt on every turn

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. The test endpoint also returns a diagnostics.delegationPath field showing which sub-agents were invoked, making it easy to debug multi-agent setups.

Knowledge Bases

Knowledge Bases let you ground AI Agents in your own content. An agent can be linked to multiple knowledge bases; retrieval is hybrid (vector + keyword) across all linked bases.

Source Types

SourceHow to add
Notion pages / databasesConnect your Notion workspace in Settings → Integrations, then select a database in the KB editor. Uses your org-level Notion OAuth token — no separate API key needed.
File uploadPDF, DOCX, CSV, TXT — up to 50MB per file
Manual FAQEnter Q&A pairs directly

CRM-Backed Knowledge Bases

Set a KB’s Entity field to contact, deal, task, product, company, or supplier (or a custom entity slug). The KB is automatically re-indexed whenever that entity type is mutated — imports, webhook events, AI tool updates all trigger a re-sync. This keeps the KB current without any manual sync step.

Contact Memory

AI Agents automatically extract facts from closed conversations and remember them for the next interaction. Memory is per-contact and surfaced in the system prompt at the start of each turn. Memory entries include: name, preferences, past issues, purchase history, language — whatever the LLM extracts as meaningful. Entries have a confidence score and an optional expiry date.

Product Catalog Auto-Injection

Enable Auto-inject Catalog on an agent to automatically prepend your top-N active products into the system prompt. The agent can then answer pricing, availability, and product questions without any tool calls. Configure the number of products (default: 20) in the agent settings. The catalog block is capped at 3,000 characters and placed before the agent’s own system prompt.

Built-in Tools

AI Agents can invoke built-in CRM and product tools mid-conversation without any configuration:
ToolWhat it does
check_product_availabilityChecks if a product is in stock
search_productsFull-text search across your product catalog
get_product_detailsReturns product name, price, SKU, stock count
check_stockReturns current stock quantity
get_priceReturns price for a product
business_hoursReturns whether the org is currently open
schedule_callbackCreates a callback task for a contact
get_contact_infoReturns the current contact’s profile
create_support_ticketOpens a support ticket from within chat
get_deal_detailsReturns deal + line items for the contact
get_recent_dealsReturns recent deals from the CRM
get_recent_notesReturns recent contact notes
get_recent_callsReturns recent voice call transcripts
find_similar_past_casesRAG-powered: finds similar past conversations
get_contact_profileFull contact profile including linked company
Enable or disable specific tools from the agent’s Tools tab. The toggle is opt-in — new agents start with no tools enabled.

Multi-Agent Orchestration

Feature flag required. Multi-agent orchestration is gated behind the multiAgent feature flag. Contact your admin to enable it for your organization.

Overview

A Lead Agent can delegate work to one or more Helper agents mid-conversation. The caller (contact) sees one seamless conversation; the delegation is invisible to them.
  • Lead Agent — handles the primary conversation, decides when to delegate
  • Helper — a specialist agent called as a tool by the Lead
  • Solo — a standalone agent with no delegation

Setting Up an Orchestration

  1. Go to Chatbot → Orchestrations
  2. Click + New Orchestration to create a Lead Agent
  3. On the orchestration board, drag-and-drop Helper agents onto the canvas
  4. Connect them to the Lead Agent
  5. Each Helper needs a short description (used by the LLM to decide when to call it)
  6. Save
The Lead Agent sees each Helper as a callable tool. When the LLM decides to delegate, it calls the Helper’s full LLM + tool loop and returns the result.

Depth Limits

ModeMax delegation depth
Text chat3 levels
Voice2 levels

Human Handoff Through Chains

If any Helper agent triggers a HUMAN handoff (keyword or tool call), the signal propagates up through the entire delegation chain and routes the conversation to a human queue immediately.

Testing Orchestrations

The Test button on a Lead Agent card runs a simulated conversation and returns diagnostics.delegationPath — a trace of which agents were called and in what order.

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

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 configured handoff keywords
  • The agent’s [HANDOFF] signal appears in the response
  • Max turns are reached
  • A content safety violation is detected
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:
  • Harmful instructions
  • Personal data requests
  • Off-topic content
  • Prompt injection attempts
Blocked responses trigger automatic handoff to a human agent.

AI Disclosure

Per Meta’s January 2026 policy, the first AI response in every new conversation includes a mandatory disclosure that the contact is speaking with an AI. This is enforced platform-wide and cannot be disabled.

Chatbot Analytics

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