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

Most upvoted comments

I found the problem, MemoryStream.Position = 0 before importing the document from the stream