Overview
This example walks through running ArkSim against a shopping assistant agent built for an e-commerce use case. The agent is designed to help customers navigate product discovery, orders, returns, and general shopping queries. The example includes two ready-to-run agent setups you can test against out of the box, and a guide for plugging in your own agent once you’re familiar with the setup.Example Agents
You can run the example in two ways: Option 1 uses the OpenAI API directly (no server, minimal setup). Option 2 runs a local agent built with the OpenAI Agents SDK (e-commerce knowledge base) via A2A, Chat Completions, or a custom agent connector.Option 1: OpenAI API
A lightweight agent that calls the OpenAI API directly. Quick start with minimal setup.
Option 2: OpenAI Agents SDK
Agent built with the OpenAI Agents SDK, backed by an e-commerce knowledge base; supports A2A, Chat Completions, or custom agent connector.
Scenarios
The example ships with a set of pre-built scenarios inscenarios.json representing realistic e-commerce customer interactions. Each scenario defines a simulated user with a distinct persona, goal, and background knowledge drawn from product and policy documentation.
Sample goals include:
- Asking about product availability, specifications, and delivery timelines
- Checking order status and tracking a shipment
- Initiating or following up on a return or refund request
- Comparing products and asking for recommendations
scenarios.json in the example directory and can be edited or extended to reflect your own use case.
Before following either path, ensure ArkSim is installed (
pip install arksim).Option 1: OpenAI Agent
This agent calls the OpenAI API directly, with no server setup required.Option 2: OpenAI Agents SDK
This agent is a shopping assistant built with the OpenAI Agents SDK, backed by an e-commerce knowledge base. It can be exposed via the A2A Protocol, a Chat Completions-compatible endpoint, or loaded directly as a Python class.Select agent config
In the example directory, use the config file for your chosen interface:
- A2A:
config_a2a.yaml(inline agent config; uses${A2A_API_KEY}) - Chat Completions:
config_chat_completions.yaml(inline agent config; uses${AGENT_API_KEY}) - Custom agent connector:
config_custom.yaml(loads agent directly as a Python class — no server needed)
Start the agent server
- A2A
- Chat Completions
- Custom
Exposes an A2A-compatible agent on port Run from the repository root (or the directory that contains the
9999. Run from the repository root:examples package). If your layout differs, use the module path that resolves to agent_server/a2a/server.py under the e-commerce example.Running with Your Own Agent
To test your own backend agent against these scenarios:- Chat Completions: Follow the comments in
agent_server/chat_completions/server.pyto swap in your own backend logic or point to your endpoint. - A2A: Implement your own A2A executor in
agent_server/a2a/agent_executor.py. - Custom: Subclass
BaseAgentand pointconfig_custom.yamlat your module. See Custom agent configuration for details.
agent_config field in the config YAML is updated. Then run simulation and evaluation as above.
Configuration
The example uses a single config file for both simulation and evaluation.Output
Results are written under the example directory:| Location | Contents |
|---|---|
./results/simulation/simulation.json | Simulated conversations from the simulation step |
./results/evaluation/evaluation.json | Evaluation results (per-turn and per-conversation scores, unique errors) |
./results/evaluation/final_report.html | Interactive HTML report for browsing and sharing results |