How edyoda/aichatbot works
EdYoda ChatBotAgent answers learning-advisor questions through WhatsApp, browser chat, or terminal clients. The main flow is an inbound message to the shared chatbot, which routes and retrieves course or FAQ context, generates and validates a Claude response, then returns it through the originating channel. Redis holds session history; the WATI application also logs exchanges and manages deflections and images. Optional branches cover LMS batch-date tools, customer-name capture, and CRM lead qualification and note creation. Unsampled branches are included where the README documents them; uncertain internal calls are omitted.
Main entry points: edyoda_chatbot.py Chatbot engine · main.py WATI webhook app · service.py CRM note service · orchestrator.py Lead and note orchestration
Components 30
Chat channels
- WATI webhook app
app/main.py - Web chat API
web_chat.py - Browser chat UI
static/chat.html - Terminal chat
local_chat.py
Answer generation
- Chatbot engine
app/edyoda_chatbot.py - RAG retrieval
app/edyoda_chatbot.py - Claude responder
app/edyoda_chatbot.py - Reply validator
app/edyoda_chatbot.py - Hot-reloaded prompts
app/system_prompt.txt - MCP client bridge
app/mcp_client.py
Session and logging
- Redis session history
app/chat_history.py - SQLite conversation log
app/db.py
CRM operations
- Customer-name capture
app/name_capture.py - CRM note service
app/crm_notes/service.py - Conversation sourcing
app/crm_notes/source.py - Lead qualification
app/crm_notes/qualify.py - Lead and note orchestration
app/crm_notes/orchestrator.py - Lead deduplication
app/crm_notes/dedup.py - Call-prep summarizer
app/crm_notes/summarize.py - CRM provider interface
app/crm_notes/crm/base.py - Zoho CRM provider
app/crm_notes/crm/zoho.py
External services
- Pinecone indexes
- Claude API
- LMS batch-date tool
mcp_servers/edyoda_lms_server.py - EdYoda LMS
- Zoho CRM
- OpenRouter API
Other components
- WhatsApp user
- Web chat user
- Terminal user
Connections 33
- WhatsApp user → WATI webhook app: sends message
README.md - Web chat user → Browser chat UI: sends message
README.md - Browser chat UI → Web chat API: calls chat API
README.md - Web chat API → Chatbot engine: calls ask
web_chat.py - Terminal user → Terminal chat: enters message
README.md - Terminal chat → Chatbot engine: uses core
README.md - WATI webhook app → Chatbot engine: uses core
README.md - Chatbot engine → RAG retrieval: routes and retrieves
README.md - RAG retrieval → Pinecone indexes: searches indexes
README.md - Chatbot engine → Claude responder: generates reply
README.md - Claude responder → Claude API: requests completion
README.md - Chatbot engine → Reply validator: validates reply
README.md - Reply validator → Claude API: checks and rewrites
README.md - Chatbot engine → Hot-reloaded prompts: loads prompts
README.md - Chatbot engine → Redis session history: reads and writes
app/edyoda_chatbot.py - WATI webhook app → SQLite conversation log: logs exchanges
app/main.py - Chatbot engine → MCP client bridge: uses tool bridge
app/edyoda_chatbot.py - MCP client bridge → LMS batch-date tool: invokes tools
README.md - LMS batch-date tool → EdYoda LMS: looks up batches
mcp_servers/edyoda_lms_server.py - WATI webhook app → Customer-name capture: handles names
app/main.py - Customer-name capture → Redis session history: reads and updates metadata
app/name_capture.py - Customer-name capture → CRM provider interface: looks up and updates leads
app/name_capture.py - WATI webhook app → CRM note service: triggers CRM work
app/main.py - CRM note service → Conversation sourcing: loads conversations
app/crm_notes/service.py - CRM note service → Lead qualification: qualifies conversations
app/crm_notes/service.py - CRM note service → Lead and note orchestration: processes qualified leads
app/crm_notes/service.py - CRM note service → Redis session history: reads and marks state
app/crm_notes/service.py - Lead and note orchestration → Lead deduplication: deduplicates leads
- Lead and note orchestration → Call-prep summarizer: creates call summary
- Lead and note orchestration → CRM provider interface: uses provider
- CRM provider interface → Zoho CRM provider: selects provider
app/crm_notes/crm/base.py - Zoho CRM provider → Zoho CRM: calls CRM API
app/crm_notes/crm/zoho.py - Call-prep summarizer → OpenRouter API: summarizes transcript
app/crm_notes/summarize.py