Skip to main content

Overview

This example demonstrates how to run Arklex User Simulator with a customer service agent for an insurance company use case. You can follow this example to evaluate your own agent. This example includes two agent options:
  • Option 1: OpenAI agent that directly uses the OpenAI API to interact with the user simulator
  • Option 2: Customized in-house agent exposed through A2A Protocol or Chat Completions-compatible interface to interact with the user simulator

Data Preparation

This example already includes a data folder in this directory (./examples/bank-insurance/data). You can freely add, remove, or update knowledge files (.md, .pdf, .doc, etc.) in that folder to match your own use case.

Option 1: OpenAI Agent

1

Rename agent configuration file

Rename agent_config_openai.json to agent_config.json. If agent_config.json already exists, first rename the original file to another name to avoid overwriting it.
2

Configure runtime settings

Configure config.yaml for this example (the default configuration is sufficient for this example).
3

Run the simulator

Choose how you want to run the simulator:
Set the environment variables
export OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"
Run the simulatorFrom the root folder:
./run_arksim.sh run ./examples/bank-insurance/config.yaml

Option 2: In-house Agent

In the /examples/bank-insurance/agent_server folder, we provide a sample RAG-based agent implemented with LangGraph that can be exposed with A2A Protocol or through Chat Completions interface.
1

Choose and configure agent type

Choose an agent configuration and rename it to agent_config.json (if agent_config.json already exists, rename or remove it first).
  • For A2A (recommended): agent_config_a2a.jsonagent_config.json
  • For Chat Completions: agent_config_chat_completions.jsonagent_config.json
The agent configs support environment variable substitution using ${ENV_VAR_NAME} syntax (for example, ${A2A_CLIENT_CREDENTIAL} or ${OPENAI_API_KEY}).
2

Install agent dependencies

Create a virtual environment (Python 3.11 recommended) and install dependencies:
# Create and activate the environment
conda create -n bank_venv python=3.11 -y
conda activate bank_venv

# Install required packages for the sample agent
pip install -r ./examples/bank-insurance/agent_server/requirements.txt
3

Start the agent server

Choose one of the following agent server options:
This exposes an A2A-compatible agent on port 9999.
Note for Docker users: If you are running the simulator with Docker, you need to change part of the endpoint in the public agent card from localhost to host.docker.internal in ./examples/bank-insurance/agent_server/a2a/server.py.A2a Docker Endpoint
export OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
python -m examples.bank-insurance.agent_server.a2a.server
4

Configure runtime settings

Configure config.yaml for this example.
5

Run the simulator

In a new terminal:Set the environment variables
export OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"
Run the simulatorFrom the root folder:
./run_arksim.sh run ./examples/bank-insurance/config.yaml