How ejathinreddy/customer-support-agent works
Fieldmark is an embedded AI support chatbot for a fictional field-service SaaS company. A visitor chats through the JavaScript widget; the Flask backend classifies the request, retrieves relevant knowledge, and uses an LLM to formulate a response or handle escalation. Escalations can capture contact details, persist records, and notify support by email. The README documents Anthropic support and the embedded demo site; some of those implementation details are not sampled, so their links are documented rather than inferred from unseen code.
Main entry points: widget.js Chat widget · app.py Flask chat API · llm.py LLM adapter · index.html Demo website
Components 17
Chat experience
- Demo website
demo-site/index.html - Chat widget
widget/widget.js - Widget styling
widget/widget.css
Support workflow
- Flask chat API
backend/app.py - Intent classifier
backend/classifier.py - Answer orchestration
backend/app.py - LLM adapter
backend/llm.py - Contact capture
widget/widget.js - Escalation handler
backend/app.py - Escalation records
backend/escalations.json
Knowledge retrieval
- PDF retrieval
backend/retrieval.py - Support knowledge PDFs
backend/knowledge_base
External services
- Groq API
- Anthropic API
- SMTP email service
Other components
- Site visitor
- Support agent
Connections 18
- Site visitor → Demo website: visits
README.md - Demo website → Chat widget: embeds
README.md - Site visitor → Chat widget: chats
widget/widget.js - Chat widget → Widget styling: loads styles
widget/widget.js - Chat widget → Flask chat API: posts messages
widget/widget.js - Flask chat API → Intent classifier: classifies intent
backend/app.py - Flask chat API → PDF retrieval: retrieves context
backend/app.py - Flask chat API → Answer orchestration: routes chat
backend/app.py - Answer orchestration → LLM adapter: requests completion
backend/app.py - PDF retrieval → Support knowledge PDFs: reads PDFs
backend/retrieval.py - LLM adapter → Groq API: calls provider
backend/llm.py - LLM adapter → Anthropic API: calls provider
backend/llm.py - Flask chat API → Chat widget: returns answer
README.md - Chat widget → Contact capture: offers handoff
widget/widget.js - Contact capture → Escalation handler: submits details
widget/widget.js - Escalation handler → Escalation records: stores record
README.md - Escalation handler → SMTP email service: sends notification
README.md - SMTP email service → Support agent: emails
README.md