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
| Type | Description | Best For |
|---|
| Built-in LLM | OpenAI, Anthropic, Google, Groq, or any OpenAI-compatible endpoint | General FAQ, support, lead qualification |
| Python Bot Webhook | Your own chatbot endpoint (HMAC-signed POST) | Custom logic, existing bots |
| Notion Knowledge Base | RAG over your Notion pages | FAQ from docs, product catalogs |
Creating an AI Agent
- Go to Chatbot → AI Agents → Create Agent
- Fill in the required fields:
| Field | Description |
|---|
| Name | Internal name for the agent |
| Business Task | Required — what this agent does (FAQ, Order Tracking, Support, Booking, Lead Qualification, Feedback) |
| Trigger Keywords | Comma-separated words that activate this agent (e.g., help, support, hi) |
| System Prompt | Instructions for the AI about your business, tone, and what to answer |
| Provider | OpenAI / Anthropic / Google / Groq / Custom LLM |
| Model | e.g., gpt-4o-mini, claude-haiku-4-5, gemini-1.5-flash |
- (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
| Source | How to add |
|---|
| Notion pages / databases | Connect 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 upload | PDF, DOCX, CSV, TXT — up to 50MB per file |
| Manual FAQ | Enter 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.
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.
AI Agents can invoke built-in CRM and product tools mid-conversation without any configuration:
| Tool | What it does |
|---|
check_product_availability | Checks if a product is in stock |
search_products | Full-text search across your product catalog |
get_product_details | Returns product name, price, SKU, stock count |
check_stock | Returns current stock quantity |
get_price | Returns price for a product |
business_hours | Returns whether the org is currently open |
schedule_callback | Creates a callback task for a contact |
get_contact_info | Returns the current contact’s profile |
create_support_ticket | Opens a support ticket from within chat |
get_deal_details | Returns deal + line items for the contact |
get_recent_deals | Returns recent deals from the CRM |
get_recent_notes | Returns recent contact notes |
get_recent_calls | Returns recent voice call transcripts |
find_similar_past_cases | RAG-powered: finds similar past conversations |
get_contact_profile | Full 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
- Go to Chatbot → Orchestrations
- Click + New Orchestration to create a Lead Agent
- On the orchestration board, drag-and-drop Helper agents onto the canvas
- Connect them to the Lead Agent
- Each Helper needs a short description (used by the LLM to decide when to call it)
- 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
| Mode | Max delegation depth |
|---|
| Text chat | 3 levels |
| Voice | 2 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
- Go to Chatbot → Flow Bots → Create Flow
- Enter a name and trigger keywords
- Click Visual Editor → to open the drag-and-drop canvas
Node Types
| Node | Description |
|---|
| Message | Send a text/media message to the contact |
| Condition | Branch based on contact data, tags, or message content |
| Delay | Wait N minutes/hours before continuing |
| Webhook | Call 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