Data Flow
Now let's walk through the end-to-end flow when a user interacts with the chatbot:
User enters text in the chat widget on the frontend and hits send. This triggers a request.
The request is sent to the backend application layer. It contains the user input text, user ID, conversation context, etc.
The application layer handles parsing the input, extracting key entities and intent. It adds metadata like the user ID and bot profile.
The request is routed to the appropriate bot model based on the user's chosen bot or context. This handles scaling to different model instances.
The model analyzes the input text using techniques like attention to identify relevant context. It generates a response text word-by-word using the conditional language model.
The raw response text is sent back to the application layer. Here additional formatting is applied to display it properly in the chat interface. Images/links can also be inserted if needed.
The formatted response is returned to the user's chat screen and displayed. Websocket connection enables real-time updates.
The full conversation exchange is logged in the persistent data store. This includes the user input, raw bot response, formatted bot response, timestamp, user ID, etc.
Later, logged exchanges can be used to retrain the model to improve accuracy on real-world conversations.
This end-to-end flow allows us to scale the components independently while orchestrating complex conversations powered by large ML models.