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

# Conversation Sessions

> Understand how the AI Chat Widget handles conversation history, returning visitors, handoff, resolution, and session continuity.

Use this page when you need to answer questions like: "Will visitors see old chats?", "What happens after handoff?", or "Why does history behave differently for anonymous and signed-in users?"

<Tip>
  If you have not decided how the widget should identify visitors yet, read **[Authentication](/widget/authentication)** first.
</Tip>

<Info>
  Want to try single-session mode and other session behaviors in one click? Open the **[Playground](/widget/playground)** and flip the toggles live.
</Info>

## How A Conversation Flows

```mermaid theme={"dark"}
flowchart LR
  A([Visitor opens widget]) --> B[Start or resume conversation]
  B --> C[AI responds in the same thread]
  C --> D[Issue resolved or needs more help]
  D -->|Resolved| E([Conversation can be resolved])
  D -->|Human| F([Human handoff in the same thread])

  style A fill:#1a5c20,color:#fff,stroke:#267a2e
  style E fill:#1a5c20,color:#fff,stroke:#267a2e
  style F fill:#1a5c20,color:#fff,stroke:#267a2e
```

<Info>
  Whether the AI keeps the conversation, resolves it, or hands it to a person depends on your support setup and escalation rules. For the policy side, see [Human Handoff](/handoff/introduction).
</Info>

## What Counts As A Session

A **session** is one conversation thread inside the widget. Visitors can have open and resolved sessions, and the widget can show a list of earlier conversations when that fits your setup.

<AccordionGroup>
  <Accordion title="New conversation" icon="plus">
    A new session starts when the visitor opens a new thread and sends a message.
  </Accordion>

  <Accordion title="Returning conversation" icon="clock">
    Returning visitors can reopen existing threads instead of starting from scratch, as long as the widget can still identify them.
  </Accordion>

  <Accordion title="Resolved conversation" icon="circle-check">
    Resolved sessions remain part of the visitor's history, but they are no longer active chat threads.
  </Accordion>
</AccordionGroup>

## How Returning History Works

History access depends on how you identify the visitor:

<AccordionGroup>
  <Accordion title="Anonymous" icon="user">
    Best for low-friction support. History stays tied to the same browser session.
  </Accordion>

  <Accordion title="Non-verified" icon="id-card">
    Good for personalization, but not strong identity across devices.
  </Accordion>

  <Accordion title="Verified" icon="shield-check">
    Best when signed-in customers should keep conversation history across devices.
  </Accordion>
</AccordionGroup>

<Note>
  Verified and non-verified conversation histories are treated differently. If a user sometimes loads the widget with a verified identity and sometimes without one, the history experience will not be the same across those cases.
</Note>

## Session Rules That Affect The Visitor Experience

These configuration choices change what visitors can do:

<AccordionGroup>
  <Accordion title="Only allow one open conversation" icon="messages">
    **Default:** Visitors can have multiple open conversations.

    **What changes:** <Tooltip tip="When true, hides the new-conversation option while an open thread already exists.">`oneOpenSessionAllowed: true`</Tooltip> hides the new-conversation option while an open thread already exists.

    **Choose this when:** You want visitors to stay focused on one active issue at a time.
  </Accordion>

  <Accordion title="Skip the sessions screen" icon="forward">
    **Default:** The widget can show a sessions list before entering chat.

    **What changes:** <Tooltip tip="Removes the sessions browser and lands the visitor directly in the chat experience.">`router.chatScreenOnly`</Tooltip> removes the sessions browser and lands the visitor directly in the chat experience.

    **Choose this when:** You want the widget to feel like a single-thread support chat instead of a small inbox.
  </Accordion>

  <Accordion title="Go straight to chat when there is no history" icon="arrow-right">
    **Default:** First-time visitors may pass through the sessions logic before entering chat.

    **What changes:** <Tooltip tip="Takes first-time visitors directly into the chat flow when there is no history to resume.">`router.goToChatIfNoSessions`</Tooltip> takes first-time visitors directly into the chat flow when there is nothing to resume.

    **Choose this when:** You want less friction for brand-new visitors.
  </Accordion>

  <Accordion title="Resolve from the widget header" icon="circle-check">
    **Default:** Visitors continue using the conversation until your flow or team closes it.

    **What changes:** Adding the <Tooltip tip="A header button that gives the visitor a direct way to mark the conversation as resolved from the widget.">`resolve-session`</Tooltip> header button gives the visitor a direct way to close the conversation from the widget itself.

    **Choose this when:** You want visitors to explicitly mark an issue as done.
  </Accordion>
</AccordionGroup>

## What Handoff Looks Like In The Widget

When the AI <Tooltip tip="The AI transfers the conversation to a human agent with full context attached." cta="Learn more" href="/handoff/introduction">hands off</Tooltip>, the conversation stays in the same thread. Your visitor does not need to start over somewhere else.

<Steps>
  <Step title="The AI stops owning the conversation">
    The thread stays open, but the AI is no longer the active responder for that issue.
  </Step>

  <Step title="A human agent continues in the same thread">
    Your visitor keeps talking in the same conversation instead of being pushed into a separate support flow.
  </Step>

  <Step title="Your team keeps the conversation context">
    The full conversation remains available to your team so the visitor does not have to repeat everything.
  </Step>

  <Step title="You can react to the handoff event">
    Use <Tooltip tip="A callback fired when the AI transfers the conversation to a human agent — use it to trigger custom UI like banners or forms.">`onHandoff`</Tooltip> to trigger your own banner, form, or next-step UI when handoff happens.

    ```javascript theme={"dark"}
    const options = {
      token: '<WIDGET_TOKEN>',
      onHandoff: (payload) => {
        console.log('Conversation handed off:', payload.summary);
      },
    };
    ```
  </Step>
</Steps>

<Info>
  Need the decision rules behind handoff? See [Human Handoff](/handoff/introduction) for when the AI escalates, what triggers a human takeover, and how that policy works across channels.
</Info>

## Feedback And Resolution

Two common post-conversation patterns are available:

<Info>
  <Tooltip tip="A built-in widget prompt that asks the visitor whether the AI's answer resolved their issue.">`thisWasHelpfulOrNot`</Tooltip> controls the built-in prompt that asks whether the latest AI answer solved the issue. Use it when you want a lightweight “resolved vs still need help” check before the conversation moves on.
</Info>

<AccordionGroup>
  <Accordion title="Helpful or need more help prompt" icon="thumbs-up">
    Use `thisWasHelpfulOrNot` when you want the widget to ask whether the latest AI answer solved the issue.
  </Accordion>

  <Accordion title="CSAT" icon="star">
    The widget can show <Tooltip tip="Customer Satisfaction — a post-conversation survey measuring how satisfied the visitor was with the support experience.">CSAT</Tooltip> when your workflow requests it, and headless builds can control the experience with the CSAT hooks.
  </Accordion>
</AccordionGroup>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Authentication" icon="shield-check" href="/widget/authentication">
    Choose the identity model that controls history access.
  </Card>

  <Card title="Configuration" icon="gear" href="/widget/configuration">
    Session rules, routing, prompts, and resolution controls.
  </Card>

  <Card title="Handoff Settings" icon="user-group" href="https://platform.open.cx/settings/handoff">
    Configure when the AI should escalate to a person.
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/widget/troubleshooting">
    Missing history, repeated prompts, and handoff confusion.
  </Card>
</CardGroup>
