Briefing

BlazorMemory v0.3.0 Adds Export and Import for Browser‑Based Memories

ai-dev
by Aftab Bashir · OpenAI

Add ExportAsync and ImportAsync to your BlazorMemory service and expose the MemoryPanel component with AllowExport/AllowImport parameters.

What to do now

Implement the ExportAsync and ImportAsync methods in your BlazorMemory service, wire them to the MemoryPanel component, and test JSON export/import flow.

Summary

Storing memories in the browser is fragile—clearing data or switching devices wipes everything—so BlazorMemory v0.3.0 introduces ExportAsync and ImportAsync to serialize and restore user memories in JSON. ExportAsync returns a JSON payload that includes userId, exportedAt, version, and an array of memories with id, content, and learnedAt, but deliberately omits embeddings to keep file size small and avoid model coupling. ImportAsync reads the JSON, skips any memory whose content already exists to avoid duplicates, and regenerates embeddings on import, ensuring compatibility across different embedding providers. The MemoryPanel component now includes Export and Import buttons in its footer, which trigger a browser file download and a file picker that accepts .json files, respectively. These buttons can be hidden via AllowExport and AllowImport parameters. The component is part of the BlazorMemory.Components package and requires the BlazorMemory.Storage.IndexedDb, BlazorMemory.Embeddings.OpenAi, and BlazorMemory.Extractor.OpenAi packages. The implementation uses dotnet add package commands to pull the necessary NuGet packages and a builder.Services.AddBlazorMemory() configuration that sets up IndexedDb storage and OpenAI embeddings. The export/import flow is fully functional out of the box, allowing developers to add persistence to their memory‑based applications without writing custom code.

Key changes

  • ExportAsync serializes memories to JSON without embeddings
  • ImportAsync skips duplicates and regenerates embeddings on import
  • MemoryPanel component includes Export and Import buttons in its footer
  • Buttons can be hidden via AllowExport and AllowImport parameters
  • Requires BlazorMemory.Storage.IndexedDb, BlazorMemory.Embeddings.OpenAi, and BlazorMemory.Extractor.OpenAi packages
  • Configuration uses builder.Services.AddBlazorMemory().UseIndexedDbStorage().UseOpenAiEmbeddings(apiKey).UseOpenAiExtractor(apiKey)
  • Export triggers a browser file download, Import opens a .json file picker
  • All functionality is available out of the box with no extra code

Affects

wp-customers internal

Customer impact

Analyzing matches…

Ask about this story

Impact on an agency? Which customers? Compare historically Risks of waiting