Memory issue when semantic search with embeddings

I solve this issue with an additional module that transforms a contextual question into an stand-alone one. Using your example: “ What does it cost ?” is a contextual question. It only makes sense in the context of an on-going conversation (all the previous utterances). The equivalent stand-alone question would be something like: “How much does starter training cost?” This stand-alone question can be understood even without the prior context. Therefore, it can be embedded and matched against existing knowledge in the knowledge base.

Therefore, when my users ask a question, I run this contextual → stand-alone question module first. I give it the previous utterances as context in combination with the last question, and I ask it to output the equivalent stand-alone version of this question. And then, you can just conduct your semantic search as usual.

It works really well, even with some basic prompt engineering. Let me know if you still have doubts. Hope it helps! :slight_smile:

4 Likes