The AI agent feature for the auctioning system
cp .env.example .envEdit .env with your configuration (LLM credentials, etc.)
Install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtRun the API agent:
python -m app.agents.api_agent.api_agentRun the SQL agent:
python -m app.agents.sql_agent.sql_agentRun the Supervisor Agent V2 (Sequential Flow):
python -m app.agents.supervisor_agent.supervisor_agent_v2The Supervisor Agent V2 implements a sequential flow where:
- API agent is tried first for all requests
- SQL agent is used as fallback when API agent cannot fulfill the request
Start the service:
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadService will start on http://localhost:8000
API docs available at http://localhost:8000/docs
See docs/SUPERVISOR_AGENT_V2.md for details.
Run the service:
uvicorn app/main:app --host 0.0.0.0 --port 8080Service will start on localhost:8080
docker compose upThis starts AI agent service in a Docker.
- API Agent: Handles direct API operations (create items, place bids, get auction info)
- SQL Agent: Executes complex database queries for analytics and reporting
- Supervisor Agent V2: Sequential flow coordinator (API first, SQL as fallback)
- Create and manage auction items
- Place and track bids
- Query auction statistics and analytics
- Natural language to SQL conversion
- Automatic fallback for complex queries
Run unit tests:
PYTHONPATH=/home/runner/work/ai-agent/ai-agent python tests/test_supervisor_v2_unit.py