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

# Using GenerativeAgent to Route Conversations

> Configure GenerativeAgent to answer from your knowledge base and route callers to human agents.

This is the most common starting deployment: GenerativeAgent answers customer questions from the [knowledge base](/generativeagent/configuring/connecting-your-knowledge-base) and routes callers to human agent queues via [Handoffs](/generativeagent/configuring/tasks-and-functions/handoff). It covers the intake work a traditional IVR menu would handle, but conversationally.

## What you'll configure

* **[Entry Task](/generativeagent/build/adding-a-use-case)**: most customers configure a starting Task as the entry point for every conversation. Pass its name via the `taskName` attribute on the [`/analyze` request](/apis/generativeagent/analyze-conversation). GenerativeAgent enters that Task at the start of the conversation, and the Task instructions guide how it answers from Topics and when to trigger Handoffs.
* **[Sources](/generativeagent/configuring/connecting-your-knowledge-base)**: import content from URLs, Zendesk, PDFs, or via API. GenerativeAgent uses Sources to generate Topics.
* **[Topics](/generativeagent/configuring/connecting-your-knowledge-base)**: KB articles GenerativeAgent draws on each turn. Associate a Handoff or Task reference at the article level to drive routing.
* **[Handoffs](/generativeagent/configuring/tasks-and-functions/handoff)**: availability-aware transfers to human agent queues. A Handoff attached to a Topic article tells GenerativeAgent to route the caller to a human.

<Note>
  When routing decisions depend on caller data (account type, service tier, open tickets), a common pattern is to add a Function with **Call on Entry** enabled to the entry Task. The Function runs before the first turn, fetches the relevant data, and makes the results available as reference variables the Task instructions can act on. See [Call on Entry](/generativeagent/build/adding-a-use-case#call-on-entry) for setup details.
</Note>

## How it works at runtime

Each turn, GenerativeAgent surfaces the Topic chunks most relevant to the caller's message, along with any Handoff references attached to those articles.

If the article is sufficient to answer the question, GenerativeAgent responds directly. If the article points to a Handoff and the conversation calls for human assistance, GenerativeAgent follows the Handoff's instructions.

Availability is resolved by the Handoff before GenerativeAgent is invoked. GenerativeAgent does not check the schedule itself. It only sees the agent-available or agent-unavailable instruction block. The Handoff configuration controls what happens in each case: collect context and confirm the transfer, inform the caller of business hours, offer a callback, or end the call.

## Set up

<Steps>
  <Step title="Create an entry Task">
    Create a Task that represents the starting context for conversations. In the Task instructions, describe how GenerativeAgent should answer from Topics and when to trigger Handoffs.

    Pass the Task name via the `taskName` attribute on the `/analyze` request when the conversation starts.
  </Step>

  <Step title="Import your knowledge base">
    Navigate to **GenerativeAgent > Knowledge > Sources** and import content. After import, review the Topics the system generates and adjust as needed.

    See [Connecting Your Knowledge Base](/generativeagent/configuring/connecting-your-knowledge-base) for import options.
  </Step>

  <Step title="Configure Handoffs">
    For each caller intent that should route to a human agent, create a Handoff with the destination queue and availability schedule.

    See [Handoff Configuration](/generativeagent/configuring/tasks-and-functions/handoff) for the full setup.
  </Step>

  <Step title="Associate Handoffs with Topics">
    In the Knowledge Base, open each Topic article that should trigger a Handoff and attach the relevant Handoff in the **Handoff scenarios** section.
  </Step>

  <Step title="Test in the Previewer">
    Use the [Previewer](/generativeagent/configuring/previewer) to verify KB answers and Handoff triggers. Test both the agent-available and agent-unavailable paths. Use [Test Scenarios](/generativeagent/configuring/tasks-and-functions/test-scenarios) for structured coverage across expected intents.
  </Step>
</Steps>

## When you're ready for more

<CardGroup>
  <Card title="Automate with Tasks" href="/generativeagent/build/adding-a-use-case">
    Build deterministic workflows for issues that currently require human agents.
  </Card>

  <Card title="Fetch caller info at conversation start" href="/generativeagent/build/adding-a-use-case#call-on-entry">
    Run an API call before the first turn to shape routing and task behavior.
  </Card>
</CardGroup>
