kernel-memory: [Bug] Using a persistent memory store (PostgresMemory) with a volatile document store (SimpleFileStorage Volatile) will lead to duplicate memory records
Context / Scenario
Using a persistent memory store (PostgresMemory) with a volatile document store (SimpleFileStorage Volatile) will lead to duplicate memory records over multiple executions. Set up Kernel Memory to use a persistent document store like Azure Blobs, AWS S3, SimpleFileStorage on disk, etc. Otherwise, use KernelMemoryBuilderBuildOptions.AllowMixingVolatileAndPersistentData to suppress this exception when invoking kernelMemoryBuilder.Build(<options here>).
Init:
KernelMemoryBuilderBuildOptions kernelMemoryBuilderBuildOptions = new()
{
AllowMixingVolatileAndPersistentData = true
};
return kmBuilder
......
.Build<MemoryServerless>(kernelMemoryBuilderBuildOptions);
What happened?
Error correction
Importance
edge case
Platform, Language, Versions
KM 0.96.250115.1
Relevant log output
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 29
Commits related to this issue
- Support Build() options in KM builder extension methods Fix https://github.com/microsoft/kernel-memory/issues/977 — committed to dluc/kernel-memory by dluc 2 years ago
- Support Build() options in KM builder extension methods (#980) Fix https://github.com/microsoft/kernel-memory/issues/977 — committed to microsoft/kernel-memory by dluc 2 years ago
I found the problem, MemoryStream.Position = 0 before importing the document from the stream