How mohamedashraf2005/marbert_egyptian-intent-router_with_rag works
This is a Streamlit customer-service chatbot for Egyptian Arabic e-commerce and logistics questions. A user submits a message; the app classifies its intent and routes it to a deterministic reply or, for supported complex intents, a retrieval-grounded response. The RAG subsystem chunks a local knowledge file, embeds and searches those chunks, then asks Groq to generate an answer. The README also describes thumbs-up/down feedback for active learning. The app excerpt is partial, so some routing details are supported by the README rather than inspected implementation.
Main entry points: app.py Chat and feedback UI · rag_engine.py Context chunking · e_commerce_NLP_BOT.txt E-commerce knowledge · classifier.py Intent classifier
Components 13
Chat experience
- Chat and feedback UI
app.py - Feedback capture
app.py
Intent routing
- Intent classifier
classifier.py - Static replies
app.py - Intent training data
data/Egyptian_intents_data.csv
Knowledge retrieval
- E-commerce knowledge
data/e_commerce_NLP_BOT.txt - Context chunking
rag_engine.py - In-memory vector index
rag_engine.py - Intent-filtered retrieval
rag_engine.py
Response generation
- Grounded response generation
rag_engine.py
Other components
- Customer
- Sentence-transformers model
- Groq API
Connections 12
- Customer → Chat and feedback UI: submits query
README.md - Chat and feedback UI → Intent classifier: classifies query
README.md - Chat and feedback UI → Static replies: routes simple intents
README.md - Chat and feedback UI → Grounded response generation: routes complex intents
app.py - Chat and feedback UI → Feedback capture: records rating
README.md - E-commerce knowledge → Context chunking: provides source text
rag_engine.py - Context chunking → In-memory vector index: indexes chunks
rag_engine.py - Context chunking → Sentence-transformers model: encodes chunks
rag_engine.py - Intent-filtered retrieval → Sentence-transformers model: encodes query
rag_engine.py - Intent-filtered retrieval → In-memory vector index: searches vectors
rag_engine.py - Grounded response generation → Intent-filtered retrieval: retrieves context
rag_engine.py - Grounded response generation → Groq API: requests completion
rag_engine.py