Overview
This example demonstrates how to run Arklex User Simulator with a shopping assistant agent for an e-commerce 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 a Chat Completions-compatible interface to interact with the user simulator
Data Preparation
This example already includes adata folder in this directory (./examples/e-commerce/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
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.Option 2: In-house Agent
Rename agent configuration file
Rename
agent_config_chat_completion.json to agent_config.json. If agent_config.json already exists, first rename the original file to another name to avoid overwriting it.Start the agent
The user simulator expects agent responses in the Chat Completions format. You can either use the sample agent provided in the
./examples/e-commerce/chat_completion_server folder, or integrate your own agent.- Sample Agent
- Your Own Agent
In the Set environment variablesStart the agent serverFrom the root directory of the folder, start the chat completion wrapper. This starts the agent on port 8080:Verify the server is runningYou should see output similar to:
./examples/e-commerce/chat_completion_server folder, we provide a RAG-based agent implemented with LangGraph in agent_server.py.Install dependenciesCreate a virtual environment (Python 3.11 recommended) and install dependencies: