Adding memory to Semantic Kernel
Semantic Kernel uses text embeddings to simulate memory. When an AI agent wants to see what it knows, it searches a database of text embeddings and pulls back the results with the largest similarity score.
Memory is available via a separate NuGet package. Because this capability is still early in development, we’ll need to explicitly reference its version and we’ll need to disable a series of SKEXP
flags, as shown here:
#r "nuget: Microsoft.SemanticKernel.Plugins.Memory, 1.16.0-alpha" using Microsoft.SemanticKernel.Memory; #pragma warning disable SKEXP0001, SKEXP0010, SKEXP0050
These #pragma
statements effectively acknowledge that we understand semantic memory is considered a preview feature, is subject to change, and should not yet be used for real-world production scenarios.
Reminder about preview features
As I mentioned earlier in this chapter, Semantic Kernel is still rapidly evolving. Expect that portions of...