Skip to main content
Related concepts: Agent, Agent Version Agents constantly need updates to their prompts, tools and configuration to meet evolving user expectations. This cookbook walks you through how to add version tracking to your agents.

What you’ll build

  • Detect breaking changes or improvements in agent performance
  • Measure the impact of engineering effort on agent optimization (resolution rate + cost per resolution)
Jump to results

Pre-requisites

  • An existing agent implementation (Python 3.10+ or Node.js 20+)
  • Voker API key (get one here)
  • OpenAI API key (get one here)

Implementation

Step 1: Project setup

Install the Voker SDK for Python and add your API key.
pip install voker
Add your Voker API key to your .env file.
VOKER_API_KEY=your_voker_api_key_here
To obtain your Voker API key, sign up for a free Voker account here. You will be taken to the setup page where you can copy the value.
Screenshot of the Voker API key setup page

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 calls into the same session
  • voker_agent, identifies the agent making the call
  • voker_agent_version, sets an initial agent version
from openai import OpenAI 
from voker.ai.provider_openai import OpenAI 

client = OpenAI()

client.chat.completions.create(
    voker_session="test-session-1",          
    voker_agent="my-agent",                  
    voker_agent_version="v1.0",              
    model="gpt-4.1-mini",
    messages=[
        {
            "role": "system",
            "content": "... your current system prompt here ...",
        }
    ],
)

Step 3: Make an LLM call and view in dashboard

Make an LLM call with the new parameters. Then go back to Voker, reload the page, and navigate to the Agent tab.You should see your agent listed with the specified version.
Screenshot of the Agent tab on the Voker platform
Click on the agent to view the details page. You will see the session and version information for the call you just made, along with any associated metrics.
Screenshot of the Agent details page on the Voker platform

Step 4: Modify your agent configuration and increment version

In your codebase, update your agent prompt, tools or configuration. Increment the voker_agent_version field and update the voker_session field for your next call.
from voker.ai.provider_openai import OpenAI

client = OpenAI()

client.chat.completions.create(
    voker_session="test-session-2",          
    voker_agent="my-agent",
    voker_agent_version="v2.0",              
    model="gpt-4.1-mini",
    messages=[
        {
            "role": "system",
            "content": "... YOUR UPDATED SYSTEM PROMPT ...", 
        }
    ],
)

Step 5: Make a new LLM call and compare performance

Make another LLM call with the updated configuration. Then go back to the agent details page in the Voker dashboard. You should see the new session with the updated version.
Screenshot of the Agent details page on the Voker platform
Now as you make changes to your agent, Voker will keep track of how those changes impact your agent performance and user experience. Use these insights to continuously optimize your agent over time.

What you’ll get

  • Overview of all Intent Categories for your agent, along with their resolution and correction rates. Filter by Agent Version to compare performance across changes and identify which ones led to improvements or potential regressions.
Screenshot of the Agent details page on the Voker platform - Intent Categories tab

Screenshot of the Agent details page on the Voker platform - Intent Categories tab
  • Version history of your agent
Screenshot of the Agent details page on the Voker platform - Versions tab