> ## Documentation Index
> Fetch the complete documentation index at: https://docs.connectly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Sofia AI Overview

> Configure Sofia AI with your business knowledge, test it on WhatsApp, and integrate it into your campaign flows or call it directly via API 🦉

Sofia AI automatically answers common customer questions about your products and services via WhatsApp — instantly, without human agent involvement. Once configured with your business knowledge, Sofia handles inbound queries and hands off to a human agent when needed.

## Setting up Sofia AI

Visit [app.connectly.ai/sofia](http://app.connectly.ai/sofia) to begin.

<Steps>
  <Step title="Initial configuration">
    Provide Sofia with the information it needs to answer customer questions. You have three options:

    * **Enter text manually** — type or paste your business information directly.
    * **Upload documents** — upload PDFs, user manuals, store policies, or Q\&A documents.
    * **Scan your website** — enter your website URL and Connectly will crawl it automatically. Allow approximately 3 business days for the scan to complete.

    The more thorough and accurate your knowledge base, the better Sofia's responses will be. We recommend including Q\&A sections, product documentation, store policies, blogs, and any other materials relevant to your customers' common questions.
  </Step>

  <Step title="Configure your knowledge base">
    Provide Sofia with the information it needs to answer customer questions. You have three options:

    * **Enter text manually** — type or paste your business information directly.
    * **Upload documents** — upload PDFs, user manuals, store policies, or Q\&A documents.
    * **Scan your website** — enter your website URL and Connectly crawls it automatically. Allow approximately 3 business days for the scan to complete.

    The more comprehensive your knowledge base, the better Sofia's responses will be. We recommend including Q\&A sections, product documentation, store policies, and any other material relevant to your customers' common questions.
  </Step>

  <Step title="Activation and testing">
    For the text entry and document upload options, setup takes under 5 minutes. Once your knowledge base is ready, the **Test on WhatsApp** button becomes active. Click it to open WhatsApp and interact with Sofia directly — send questions your customers commonly ask and review the responses. You can continue adding information at any time to improve accuracy.
  </Step>

  <Step title="Test on WhatsApp">
    For text entry and document upload, setup takes under 5 minutes. Once your knowledge base is ready, the **Test on WhatsApp** button becomes active. Click it to open WhatsApp and interact with Sofia directly. You can continue adding information at any time to improve accuracy.
  </Step>
</Steps>

***

## Integrating Sofia into a campaign flow

After activating Sofia, you can hand off a conversation to it at any point in your Campaign Builder flow.

<Steps>
  <Step title="Find the Sofia AI Takeover card">
    With Sofia activated, a **Sofia AI Takeover** card appears in the left sidebar of the Campaign Builder.
  </Step>

  <Step title="Drag and drop onto the canvas">
    Drag the card onto the canvas and connect it to the point in your flow where you want Sofia to take over. Sofia will handle all subsequent customer messages from that point forward.
  </Step>

  <Step title="Drop it onto the canvas">
    Drag the card onto your canvas and connect it to the point in your flow where you want Sofia to take over. Sofia handles all subsequent customer messages from that point forward.
  </Step>

  <Step title="Customise the welcome message">
    When you place the Sofia AI Takeover card, a **Simple message** card is created and linked to it automatically. This card sends a welcome message to the customer before Sofia begins responding. Edit it to match your brand's tone and let customers know they are interacting with a virtual assistant.
  </Step>

  <Step title="Customise the welcome message">
    A **Simple message** card is automatically linked to the Sofia AI Takeover card. This sends a welcome message before Sofia begins responding — edit it to match your brand's tone and let customers know they're interacting with a virtual assistant.
  </Step>
</Steps>

***

## Core concepts

If you're integrating Sofia through the API, you'll work with these identifiers:

| Concept               | Description                                                                                                                                                                     |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `agent_descriptor_id` | Identifies your Sofia agent configuration — knowledge bases, language, product catalogs. Connectly provisions this during onboarding.                                           |
| `business_id`         | Your Connectly business identifier.                                                                                                                                             |
| `api_key`             | An API key scoped exclusively to invoking Sofia. It cannot send WhatsApp messages or access campaign data — safe to use in client-side JavaScript.                              |
| `session_id`          | A unique identifier for a single customer conversation. Obtained from the [init endpoint](/ai/agent-graph/init-session) and required on every subsequent invoke and close call. |
| `state_id`            | Identifies a specific point within a conversation. Pass the most recent `state_id` when invoking Sofia to continue from exactly where the customer left off.                    |

<Note>
  Your Sofia `api_key` is restricted to Sofia invocations only. It cannot send WhatsApp messages or access campaign reports, so it's safe to include in browser-side code.
</Note>

***

## API usage

To invoke Sofia programmatically — for example, to embed it in your own chat interface — see [Invoke Sofia AI](https://docs.connectly.ai/api-reference/sofia-ai-invoke).

<CardGroup cols={2} />
