Part 4/8:
To empower the bot with memory beyond simple logs, Shapiro introduces embedding techniques — transforming chat content into high-dimensional vectors. Using models like Google’s Universal Sentence Encoder, each dialogue segment is embedded, enabling efficient similarity searches among past interactions.
This allows the bot to retrieve relevant historical conversations when needed, making responses more context-aware. He explains that by comparing current inputs’ embeddings with stored vectors using dot products, the system can identify and incorporate the most pertinent previous exchanges.
Implementing Long-Term Memory
The process involves:
Saving dialogue logs with associated embeddings.
On each new user input, computing its embedding.