A chatbot agent that answers customer questions about Ohm Sweet Ohm, a tech retail company. The agent uses LLM-based intent classification and routes queries to appropriate tools to answer questions about:
- Order status and location
- Product pricing
- Product stock at stores
- Store hours and locations
- Return policies and FAQs
- Install dependencies:
pip install -r requirements.txt- Set up your OpenAI API key (required for intent classification):
export OPENAI_API_KEY="your-api-key-here"Or create a .env file:
OPENAI_API_KEY=your-api-key-here
- Run the agent:
python agent.py- LLM-Based Intent Classification: Uses OpenAI with examples to classify customer queries into 8 categories
- Tool-Based Architecture: Each intent routes to a specific tool:
order_status→ Order lookup toolproduct_price→ Product information toolproduct_stock→ Store inventory toolstore_hours→ Store information toolstore_location→ Store information toolreturn_policy,shipping_info,general_faq→ FAQ RAG tool
- RAG System: FAQ tool uses retrieval-augmented generation for policy questions
Try asking questions like:
- "Where is my order TECH-001?"
- "How much does the NexusWave Pro Headphones cost?"
- "Do you have PulseSync Fitness Tracker in stock at the downtown location?"
- "What are your store hours?"
- "What is your return policy?"
- "How much does shipping cost?"
- "Where is your Union Square store?"
The system uses fake data stored in:
data/orders.json- Customer orders (TECH-001 through TECH-012)data/products.json- Product catalog (10 products with creative names)data/stores.json- Store locations and hours (5 locations in San Francisco)data/faq.txt- FAQ document for RAG
The agent works by:
- Intent Classification: Uses LLM with examples to classify the customer query into one of 8 intent categories
- Tool Routing: Routes to the appropriate tool based on intent
- Tool Execution: Each tool queries the relevant data source and formats the response
- Response Generation: Returns the formatted answer to the customer
- Order Lookup Tool: Queries orders database by order ID
- Product Information Tool: Gets product details and pricing
- Store Inventory Tool: Checks product availability at stores
- Store Information Tool: Provides store hours and locations
- FAQ RAG Tool: Uses retrieval-augmented generation to answer policy questions
Ohm Sweet Ohm is a tech retail company with 5 locations in San Francisco:
- Ohm Sweet Ohm Downtown (123 Market Street)
- Ohm Sweet Ohm Union Square (456 Geary Street)
- Ohm Sweet Ohm Mission District (789 Valencia Street)
- Ohm Sweet Ohm Marina (321 Chestnut Street)
- Ohm Sweet Ohm SoMa (555 Folsom Street)