Skip to main content

Voice AI agent simulator and evaluation harness for LiveKit

Project description

Future AGI Simulate SDK

A Python SDK for testing conversational voice AI agents through realistic customer simulations.

Overview

This SDK allows you to rigorously test your deployed voice AI agents by simulating realistic customer conversations. It connects a "simulated customer" to your agent, records the conversation, and provides detailed transcripts and evaluations.

Key Features

  • Agent Definition: Describe your deployed agent's configuration
  • Scenario Creation: Define test cases with customer personas, situations, and desired outcomes
  • Automated Testing: Run multiple test scenarios against your agent
  • Transcript Collection: Automatically record full conversation transcripts
  • Evaluation Integration: Integrate with Future AGI's evaluation service (ai-evaluation)

Installation

pip install -r requirements.txt

Download VAD Model Weights

The SDK uses Silero VAD for voice activity detection. Download the required model weights:

from livekit.plugins import silero

if __name__ == "__main__":
    print("Downloading Silero VAD model...")
    silero.VAD.load()
    print("Download complete.")

Run this script once before using the SDK.

Quick Start

Prerequisites

  1. A deployed voice AI agent: Your agent must be running and connected to a LiveKit room.
  2. LiveKit server access: You need the URL, API key, and secret for the LiveKit server.
  3. OpenAI API key: For the simulated customer agent.

Environment Variables

Create a .env file:

# LiveKit Server Details
LIVEKIT_URL="wss://your-livekit-server.com"
LIVEKIT_API_KEY="your-api-key"
LIVEKIT_API_SECRET="your-api-secret"

# OpenAI API Key (for simulated customer)
OPENAI_API_KEY="your-openai-key"

# Future AGI Evaluation Keys (optional, for evaluations)
FI_API_KEY="your-fi-api-key"
FI_SECRET_KEY="your-fi-secret-key"

Example Usage

from fi.simulate import AgentDefinition, Scenario, Persona, TestRunner

# 1. Define your deployed agent
agent_definition = AgentDefinition(
    name="my-support-agent",
    url="wss://your-livekit-server.com",
    room_name="agent-room", # The room where your agent is waiting
    system_prompt="You are a helpful support agent.",
)

# 2. Create test scenarios
scenario = Scenario(
    name="Customer Support Test",
    dataset=[
        Persona(
            persona={"name": "Alice", "mood": "frustrated"},
            situation="She cannot log into her account.",
            outcome="The agent should guide her through password reset.",
        ),
    ]
)

# 3. Run the test
runner = TestRunner()
report = runner.run_test(agent_definition, scenario)

# 4. View results
for result in report.results:
    print(f"Transcript: {result.transcript}")

Project Structure

fi/simulate/
├── agent/
│   └── definition.py    # AgentDefinition and configuration models
├── simulation/
│   ├── models.py        # Persona, Scenario, TestReport models
│   ├── runner.py        # TestRunner (the main testing engine)
│   └── generator.py     # ScenarioGenerator (AI-powered scenario creation)
└── __init__.py

Coming Soon

  • Evaluation Integration: Automatically evaluate agent performance using Future AGI's evaluation service
  • Advanced Scenarios: Support for conversation graphs and complex flows
  • Metrics Collection: Latency, interruption rates, and other conversation metrics

License

Open source (license TBD)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_simulate-0.1.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_simulate-0.1.0-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file agent_simulate-0.1.0.tar.gz.

File metadata

  • Download URL: agent_simulate-0.1.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Darwin/24.6.0

File hashes

Hashes for agent_simulate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 15b988d20699e73eb89d304f9c49e92ab337de6fbf62ed2701b725d4285cf2a2
MD5 dee5edbd632c29e63ea465b2e2123ca8
BLAKE2b-256 8477811be775dab1d463b24562d17e2b28856f36f3f83a9d0352fd0586035b6e

See more details on using hashes here.

File details

Details for the file agent_simulate-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agent_simulate-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Darwin/24.6.0

File hashes

Hashes for agent_simulate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab8b3d962974c4b2232d5c116583a678a30c60ac6e41649729470fe921780770
MD5 879943bc270ee9ca73a6a3ceb660b6f9
BLAKE2b-256 1234cafeafa3b5201771020e07c8f9396f7690f33cdb67160eb1334695c71e38

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page