Menu

Post image 1
Post image 2
1 / 2
0

How I added memory export and import to my open-source AI library published: true

DEV Community·Aftab Bashir·28 days ago
#TVHEtOJm
#ai#openai#dotnet#blazor#fullscreen#userid
Reading 0:00
15s threshold

When I built BlazorMemory, I knew from the start that storing memories in the browser had one obvious problem. What happens when you clear your browser data? Or switch devices? Everything is gone. v0.3.0 fixes that with two new methods: ExportAsync and ImportAsync . What it does Export serialises all memories for a user to JSON: var json = await memory . ExportAsync ( userId ); Enter fullscreen mode Exit fullscreen mode The output looks like this: { "userId" : "demo_user" , "exportedAt" : "2025-03-15T10:00:00Z" , "version" : "1.0" , "memories" : [ { "id" : "abc123" , "content" : "User is a senior .NET engineer" , "learnedAt" : "2025-03-14T09:30:00Z" } ] } Enter fullscreen mode Exit fullscreen mode Notice embeddings are not in the export. They are large (1,536 floats per memory) and they are model-specific. If you exported with text-embedding-3-small and later imported using a different model, the similarity search would break. So the export skips them, and import re-generates them fresh.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More