Trenchy is a Hinglish-aware, product-contextual customer-support chatbot built with Rasa 3.x , a custom FastAPI backend , and a frontend website integrated via rasa-webchat.
It supports:
- Code-mixed Hinglish understanding
- Product-aware reasoning (auto-context from product pages)
- Order + refund workflow support
- Sentiment handling + human handoff
- SQLite product/order DB
- Full e-commerce QA flow
This README explains exactly how to install, run, and test the entire system.
Python version required: 3.9.6
Rasa does NOT work with Python 3.10 or above.
python3.9 -m venv venv
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # WindowsYour project contains:
requirements.txt→ main Rasa projectbackend/requirements.txt→ backend API
Install main dependencies:
pip install -r requirements.txtBefore running anything:
rasa trainThis creates the latest conversational model under /models.
Trenchy uses three terminals :
Run from the project root , where actions.py is located:
source venv/bin/activate
rasa run actionsYou should see:
Action server is up and running.
If you want to test the bot inside the terminal :
source venv/bin/activate
rasa shellYou can use this for debugging, intent tests, policy tests, etc.
This is required for the frontend HTML pages :
source venv/bin/activate
rasa run --enable-api --cors "*"This opens:
http://localhost:5005
and allows:
- rasa-webchat widget
- metadata sending
- socket.io communication
- frontend product context injection
Your backend lives in:
trenchy-backend/
cd trenchy-backend
pip install -r requirements.txtuvicorn main:app --reload --port 8000This serves endpoints like:
GET http://localhost:8000/products
GET http://localhost:8000/product?id=TS017
GET http://localhost:8000/orders/OD12345
These endpoints are used by:
- Frontend product pages
- Custom Rasa actions for stock & order queries
- Context-aware reasoning logic
Open:
index.html
Then right-click to open with Live Server on VS Code.
product_idpage_url
to Rasa through:
event.metadata = {
product_id: pid,
page_url: url
};Try queries like:
- “Tell me about this product”
- “Give me details about this”
- “Can you describe this item?”
- “Track order OD90001”
- “Cancel my order”
- “Refund status kya hai?”
- “refund policy kya hai”
- “shipping options kya hai”
- “Awesome”
- “Perfect, thank you!”
- “What’s the weather?”
Everything should respond correctly if metadata + backend + Rasa are running.
Check the frontend's:
onSocketEvent.user_utteredEnsure:
uvicorn main:app --reload --port 8000is running.
Retrain:
rasa trainEnsure Python is 3.9.6 .
rasa trainrasa run actionsrasa shellrasa run --enable-api --cors "*"cd trenchy-backend
uvicorn main:app --reload --port 8000b677ecd998a71bbbb01b67c876f88c39251f2eb2