It stores previous user and bot messages in a list and includes the last few when forming a new query to maintain context.
It appends each interaction to a history list and uses recent entries when generating the next response.
Use Hugging Face for embeddings and a language model for replies; test with different queries to check if it remembers context. Use unit tests for parts (like context builder) and simulate full conversations to validate responses.
● Unanswered Questions: Reply with a fallback message like "I don't have that info."
● Ambiguous Queries: Ask follow-up questions to clarify.
● Multiple Questions at Once: Split and answer both parts separately.
● Too Much Context: Use only the last few messages to keep responses focused.