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

# Tracking Long Running Agent Conversations

Related concepts: [People](/concepts/people), [Sessions](/concepts/events#event-sessions)

If you have long running agents in production, i.e. an agent that handles many conversation turns with a single user, you've probably experienced issues keeping track of quality, simply because there are so many messages to follow.

This cookbook walks you through tracking long running agents in Voker, so you can get the insights you need to optimize your agent without reading through every message.

## What you'll build

* Attribute every session to a specific [person](/concepts/people#creating-a-person), so you can get insights into how each user behaves across all their sessions
* An interactive Session Timeline that provides an overview of paths within a long running session, allowing you to investigate parts of a conversation without reading every turn

[Jump to results](#what-you’ll-get)

## Pre-requisites

* An existing agent implementation (Python 3.10+ or Node.js 20+)
* Voker API key (get one [here](https://app.voker.ai/signup))

## Implementation

<Tabs>
  <Tab title="Python">
    ### Step 1: Project setup

    Install the Voker SDK for Python and add your API key.

    <CodeGroup>
      ```bash pip theme={null}
      pip install voker
      ```

      ```bash uv theme={null}
      uv add voker
      ```

      ```bash poetry theme={null}
      poetry add voker
      ```
    </CodeGroup>

    Add your Voker API key to your `.env` file.

    ```bash theme={null}
    VOKER_API_KEY=your_voker_api_key_here
    ```

    To obtain your Voker API key, sign up for a free Voker account [here](https://app.voker.ai/sign-up). You will be taken to the setup page where you can copy the value.

    <Frame caption="Navigate to the Voker dashboard to find your API key">
      <img src="https://mintcdn.com/voker/ox0g4RrzmbgrSFEY/assets/cookbooks/agent-prompt-tracking/step-1-setup-api-key.png?fit=max&auto=format&n=ox0g4RrzmbgrSFEY&q=85&s=e16f7b2f4802562b916697c2468836c8" alt="Screenshot of the Voker API key setup page" width="1793" height="813" data-path="assets/cookbooks/agent-prompt-tracking/step-1-setup-api-key.png" />
    </Frame>

    ### Step 2: Set Voker parameters in LLM calls

    In your project, swap the import for your LLM provider and add these parameters to your LLM calls:

    * `voker_session`, groups events into the same [session](/concepts/events#event-sessions)
    * `voker_agent`, identifies the [agent](/concepts/agents#agents) making the event
    * `voker_agent_version`, sets an initial [agent version](/concepts/agents#agent-versions)
    * `voker_person`, attributes the event to a specific [person](/concepts/people).

    <Note>
      When you provide a person ID on an event, Voker attaches the event to that person. If the person already exists, the event is added to them instead of creating a duplicate person.
    </Note>

    <Tabs>
      <Tab title="OpenAI">
        ```python theme={null}
        from openai import OpenAI  # [!code --]
        from voker.ai.provider_openai import OpenAI  # [!code ++]

        client = OpenAI()

        client.chat.completions.create(
            voker_session="test-session-1",          # [!code ++]
            voker_agent="my-agent",                  # [!code ++]
            voker_agent_version="v1.0",              # [!code ++]
            voker_person="person-1",                 # [!code ++]
            model="gpt-4.1-mini",
            messages=[
                {
                    "role": "system",
                    "content": "... your current system prompt here ...",
                }
            ],
        )
        ```
      </Tab>

      <Tab title="Anthropic">
        ```python theme={null}
        from anthropic import Anthropic  # [!code --]
        from voker.ai.provider_anthropic import Anthropic  # [!code ++]

        client = Anthropic()

        client.messages.create(
            voker_session="test-session-1",          # [!code ++]
            voker_agent="my-agent",                  # [!code ++]
            voker_agent_version="v1.0",              # [!code ++]
            voker_person="person-1",                 # [!code ++]
            model="claude-haiku-4-5",
            messages=[
                {
                    "role": "user",
                    "content": "... your current system prompt here ...",
                }
            ],
            max_tokens=1024,
        )
        ```
      </Tab>

      <Tab title="Gemini">
        ```python theme={null}
        from google.genai import Client  # [!code --]
        from voker.ai.provider_gemini import Client  # [!code ++]

        client = Client()

        client.models.generate_content(
            voker_session="test-session-1",          # [!code ++]
            voker_agent="my-agent",                  # [!code ++]
            voker_agent_version="v1.0",              # [!code ++]
            voker_person="person-1",                 # [!code ++]
            model="gemini-2.5-flash",
            contents="... your current system prompt ...",
        )
        ```
      </Tab>
    </Tabs>

    ### Step 3: Make an LLM call and view in dashboard

    Make an LLM call with the new parameters. Then go back to [Voker](https://app.voker.ai), reload the page, and navigate to the People tab.

    Locate your person by typing their unique Person ID into the search bar, or find them in the list by their Person ID.

    <Frame caption="Navigate to 'People' in the sidebar">
      <img src="https://mintcdn.com/voker/ZaTw0SZWZABFvDCr/assets/cookbooks/long-running-agent-conversations/step-3-view-people-tab.png?fit=max&auto=format&n=ZaTw0SZWZABFvDCr&q=85&s=5b025d6bb8ced1a1813e0ba2e1d691d3" alt="Screenshot of the People tab on the Voker platform" width="1917" height="1127" data-path="assets/cookbooks/long-running-agent-conversations/step-3-view-people-tab.png" />
    </Frame>

    Click on the person to view their details page, where you can see their session history along with aggregate data across those sessions.

    <Frame caption="Click a person to open their details page and view their session history">
      <img src="https://mintcdn.com/voker/ZaTw0SZWZABFvDCr/assets/cookbooks/long-running-agent-conversations/step-3-view-person-details.png?fit=max&auto=format&n=ZaTw0SZWZABFvDCr&q=85&s=6963ebeca3634e8dfc2ac3114b124edb" alt="Screenshot of the Person details page on the Voker platform" width="1918" height="1127" data-path="assets/cookbooks/long-running-agent-conversations/step-3-view-person-details.png" />
    </Frame>
  </Tab>

  <Tab title="TypeScript">
    ### Step 1: Project setup

    Install the Voker SDK for TypeScript and add your API key.

    <CodeGroup>
      ```bash npm theme={null}
      npm install @voker/voker
      ```

      ```bash pnpm theme={null}
      pnpm add @voker/voker
      ```

      ```bash bun theme={null}
      bun add @voker/voker
      ```

      ```bash yarn theme={null}
      yarn add @voker/voker
      ```
    </CodeGroup>

    Add your Voker API key to your `.env` file.

    ```bash theme={null}
    VOKER_API_KEY=your_voker_api_key_here
    ```

    To obtain your Voker API key, sign up for a free Voker account [here](https://app.voker.ai/sign-up). You will be taken to the setup page where you can copy the value.

    <Frame caption="Navigate to the Voker dashboard to find your API key">
      <img src="https://mintcdn.com/voker/ox0g4RrzmbgrSFEY/assets/cookbooks/agent-prompt-tracking/step-1-setup-api-key.png?fit=max&auto=format&n=ox0g4RrzmbgrSFEY&q=85&s=e16f7b2f4802562b916697c2468836c8" alt="Screenshot of the Voker API key setup page" width="1793" height="813" data-path="assets/cookbooks/agent-prompt-tracking/step-1-setup-api-key.png" />
    </Frame>

    ### Step 2: Set Voker parameters in LLM calls

    In your project, swap the import for your LLM provider and add these parameters to your LLM calls:

    * `vokerSession`, groups events into the same [session](/concepts/events#event-sessions)
    * `vokerAgent`, identifies the [agent](/concepts/agents#agents) making the event
    * `vokerAgentVersion`, sets an initial [agent version](/concepts/agents#agent-versions)
    * `vokerPerson`, attributes the event to a specific [person](/concepts/people).

    <Note>
      When you provide a person ID on an event, Voker attaches the event to that person. If the person already exists, the event is added to them instead of creating a duplicate person.
    </Note>

    <Tabs>
      <Tab title="OpenAI">
        ```typescript theme={null}
        import { OpenAI } from 'openai'; // [!code --]
        import { OpenAI } from '@voker/voker/ai/provider-openai'; // [!code ++]

        const client = new OpenAI();

        await client.chat.completions.create({
            vokerSession: 'test-session-1',      // [!code ++]
            vokerAgent: 'my-agent',              // [!code ++]
            vokerAgentVersion: 'v1.0',           // [!code ++]
            vokerPerson: 'person-1',             // [!code ++]
            model: 'gpt-4.1-mini',
            messages: [
                {
                    role: 'system',
                    content: '... your current system prompt here ...',
                },
            ],
        });
        ```
      </Tab>

      <Tab title="Anthropic">
        ```typescript theme={null}
        import Anthropic from '@anthropic-ai/sdk'; // [!code --]
        import { Anthropic } from '@voker/voker/ai/provider-anthropic'; // [!code ++]

        const client = new Anthropic();

        await client.messages.create({
            vokerSession: 'test-session-1',      // [!code ++]
            vokerAgent: 'my-agent',              // [!code ++]
            vokerAgentVersion: 'v1.0',           // [!code ++]
            vokerPerson: 'person-1',             // [!code ++]
            model: 'claude-haiku-4-5',
            messages: [
                {
                    role: 'user',
                    content: '... your current system prompt here ...',
                },
            ],
            max_tokens: 1024,
        });
        ```
      </Tab>

      <Tab title="Gemini">
        ```typescript theme={null}
        import { GoogleGenAI } from '@google/genai'; // [!code --]
        import { GoogleGenAI } from '@voker/voker/ai/provider-gemini'; // [!code ++]

        const client = new GoogleGenAI({ apiKey: process.env.GOOGLE_API_KEY! });

        await client.models.generateContent({
            vokerSession: 'test-session-1',      // [!code ++]
            vokerAgent: 'my-agent',              // [!code ++]
            vokerAgentVersion: 'v1.0',           // [!code ++]
            vokerPerson: 'person-1',             // [!code ++]
            model: 'gemini-2.5-flash',
            contents: '... your current system prompt ...',
        });
        ```
      </Tab>
    </Tabs>

    ### Step 3: Make an LLM call and view in dashboard

    Make an LLM call with the new parameters. Then go back to [Voker](https://app.voker.ai), reload the page, and navigate to the People tab.

    Locate your person by typing their unique Person ID into the search bar, or find them in the list by their Person ID.

    <Frame caption="Navigate to 'People' in the sidebar">
      <img src="https://mintcdn.com/voker/ZaTw0SZWZABFvDCr/assets/cookbooks/long-running-agent-conversations/step-3-view-people-tab.png?fit=max&auto=format&n=ZaTw0SZWZABFvDCr&q=85&s=5b025d6bb8ced1a1813e0ba2e1d691d3" alt="Screenshot of the People tab on the Voker platform" width="1917" height="1127" data-path="assets/cookbooks/long-running-agent-conversations/step-3-view-people-tab.png" />
    </Frame>

    Click on the person to view their details page, where you can see their session history along with aggregate data across those sessions.

    <Frame caption="Click a person to open their details page and view their session history">
      <img src="https://mintcdn.com/voker/ZaTw0SZWZABFvDCr/assets/cookbooks/long-running-agent-conversations/step-3-view-person-details.png?fit=max&auto=format&n=ZaTw0SZWZABFvDCr&q=85&s=6963ebeca3634e8dfc2ac3114b124edb" alt="Screenshot of the Person details page on the Voker platform" width="1918" height="1127" data-path="assets/cookbooks/long-running-agent-conversations/step-3-view-person-details.png" />
    </Frame>
  </Tab>
</Tabs>

## What you'll get

Voker gives you two views: a session path timeline splitting a long session into manageable paths, and what it tracks about a person across all of their sessions.

### Session path timeline

Open a session from the person's session history to view its Session Timeline. The timeline breaks a long session into session paths, providing an overview how the agent traversed the conversation.

<Frame caption="A session's detail page, with the Session Timeline called out">
  <img src="https://mintcdn.com/voker/ZaTw0SZWZABFvDCr/assets/cookbooks/long-running-agent-conversations/what-youll-get-session-path-timeline.png?fit=max&auto=format&n=ZaTw0SZWZABFvDCr&q=85&s=901e0d96f5af6000391c602ff2bc8d5c" alt="Screenshot of the session detail page on the Voker platform, with the Session Timeline highlighted" width="1918" height="1127" data-path="assets/cookbooks/long-running-agent-conversations/what-youll-get-session-path-timeline.png" />
</Frame>

Hover over a session path to see how many turns it comprises.

<Frame caption="Hover over a session path to see how many turns it comprises">
  <img src="https://mintcdn.com/voker/ZaTw0SZWZABFvDCr/assets/cookbooks/long-running-agent-conversations/what-youll-get-hover-session-timeline.png?fit=max&auto=format&n=ZaTw0SZWZABFvDCr&q=85&s=7aaea1f236a231f8c956a226ba9dffff" alt="Screenshot of hovering over a session path in the Session Timeline on the Voker platform" width="1920" height="1134" data-path="assets/cookbooks/long-running-agent-conversations/what-youll-get-hover-session-timeline.png" />
</Frame>

Click a session path to jump straight to that point in the conversation, without scrolling through every turn to find it.

<Frame caption="Click a session path to jump straight to that point in the conversation">
  <img src="https://mintcdn.com/voker/ZaTw0SZWZABFvDCr/assets/cookbooks/long-running-agent-conversations/what-youll-get-click-session-timeline.png?fit=max&auto=format&n=ZaTw0SZWZABFvDCr&q=85&s=47c580a9131180ce86f047c5349bc23d" alt="Screenshot of clicking a session path in the Session Timeline on the Voker platform" width="1918" height="1128" data-path="assets/cookbooks/long-running-agent-conversations/what-youll-get-click-session-timeline.png" />
</Frame>

### What Voker tracks about a person

Open a person from the People tab to see their session history. Three of the things it tracks describe the person across their sessions:

**Most used agent**: the agent this person uses most. Use this as the first place to look when they report a problem, since it's their primary agent.

<Frame caption="Most used agent on the person details page">
  <img src="https://mintcdn.com/voker/ZaTw0SZWZABFvDCr/assets/cookbooks/long-running-agent-conversations/what-youll-get-most-used-agent.png?fit=max&auto=format&n=ZaTw0SZWZABFvDCr&q=85&s=9aa4336a887bfab468b6e20f81421601" alt="Screenshot of the person details page on the Voker platform, with most used agent highlighted" width="1918" height="1127" data-path="assets/cookbooks/long-running-agent-conversations/what-youll-get-most-used-agent.png" />
</Frame>

**Common intent categories**: their recurring intents, grouped across sessions. Use this to find what a person relies on your agent for.

<Frame caption="Common intent categories on the person details page">
  <img src="https://mintcdn.com/voker/ZaTw0SZWZABFvDCr/assets/cookbooks/long-running-agent-conversations/what-youll-get-common-intent-categories.png?fit=max&auto=format&n=ZaTw0SZWZABFvDCr&q=85&s=6716f3206e69f17d5160ff022b60270e" alt="Screenshot of the person details page on the Voker platform, with common intent categories highlighted" width="1918" height="1127" data-path="assets/cookbooks/long-running-agent-conversations/what-youll-get-common-intent-categories.png" />
</Frame>

**Behavioral summary**: an AI-generated read of how this person behaves and what they want, grounded in their real intents and sessions. Use this as a quick way to get up to speed when researching or troubleshooting their conversations.

<Frame caption="Behavioral summary on the person details page">
  <img src="https://mintcdn.com/voker/ZaTw0SZWZABFvDCr/assets/cookbooks/long-running-agent-conversations/what-youll-get-behavioral-summary.png?fit=max&auto=format&n=ZaTw0SZWZABFvDCr&q=85&s=cf7ce5d82c944f0851d0eef0d0cb3ddf" alt="Screenshot of the person details page on the Voker platform, with the behavioral summary highlighted" width="1918" height="1127" data-path="assets/cookbooks/long-running-agent-conversations/what-youll-get-behavioral-summary.png" />
</Frame>

<Note>
  The person details page also shows agent performance metrics like resolution rate and correction rate, which are covered more in depth in [Agent Version Tracking](/cookbooks/agent-version-tracking).
</Note>
