BlazorMemory 0.4.0

dotnet add package BlazorMemory --version 0.4.0
                    
NuGet\Install-Package BlazorMemory -Version 0.4.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BlazorMemory" Version="0.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BlazorMemory" Version="0.4.0" />
                    
Directory.Packages.props
<PackageReference Include="BlazorMemory" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BlazorMemory --version 0.4.0
                    
#r "nuget: BlazorMemory, 0.4.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BlazorMemory@0.4.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BlazorMemory&version=0.4.0
                    
Install as a Cake Addin
#tool nuget:?package=BlazorMemory&version=0.4.0
                    
Install as a Cake Tool

<div align="center">

BlazorMemory

Give your .NET AI assistant persistent memory.

NuGet NuGet Downloads License: MIT .NET 8

BlazorMemory Demo

</div>


BlazorMemory sits between your chat logic and your LLM. It extracts facts from conversations, stores them as vector embeddings, and injects relevant context into future prompts. Your assistant remembers the user across sessions.

It works in Blazor WASM with no backend. Memories live in the browser's IndexedDB. It also works server-side with EF Core if you need SQL storage.

Quickstart

dotnet add package BlazorMemory
dotnet add package BlazorMemory.Storage.IndexedDb
dotnet add package BlazorMemory.Embeddings.OpenAi
dotnet add package BlazorMemory.Extractor.OpenAi
// Program.cs
builder.Services
    .AddBlazorMemory()
    .UseIndexedDbStorage()
    .UseOpenAiEmbeddings(apiKey)
    .UseOpenAiExtractor(apiKey);
// In your chat service
public class ChatService(IMemoryService memory)
{
    public async Task<string> ChatAsync(string message, string userId)
    {
        // Pull relevant memories
        var memories = await memory.QueryAsync(message, userId,
            new QueryOptions { Limit = 5, Threshold = 0.65f });

        // Build system prompt
        var context = string.Join("\n", memories.Select(m => $"- {m.Content}"));
        var prompt  = $"You are a helpful assistant.\n\nWhat you know:\n{context}";

        // Call your LLM
        var reply = await CallLlmAsync(prompt, message);

        // Extract and store new facts
        await memory.ExtractAsync($"User: {message}\nAssistant: {reply}", userId);

        return reply;
    }
}

Drop-in component

Add the memory panel to your UI with one line:

dotnet add package BlazorMemory.Components
<MemoryPanel UserId="@userId" IsOpen="true" />

The panel shows stored memories, handles delete and clear, and has built-in export and import buttons. No extra wiring.

Export and import

Users can download their memories as JSON and restore them later:

// Export
var json = await memory.ExportAsync(userId);

// Import
await memory.ImportAsync(userId, json);

Embeddings are excluded from the export and re-generated on import. This keeps the file small and makes imports work regardless of which embedding provider the target app uses.

Namespaces

Scope memories by topic:

await memory.ExtractAsync(conversation, userId, namespace: "work");

var results = await memory.QueryAsync(query, userId, new QueryOptions
{
    Namespace = "work"
});

Server-side with EF Core

dotnet add package BlazorMemory.Storage.EfCore
builder.Services
    .AddBlazorMemory()
    .UseEfCoreStorage<YourDbContext>()
    .UseOpenAiEmbeddings(apiKey)
    .UseOpenAiExtractor(apiKey);

Use Anthropic instead of OpenAI

dotnet add package BlazorMemory.Extractor.Anthropic
builder.Services
    .AddBlazorMemory()
    .UseIndexedDbStorage()
    .UseOpenAiEmbeddings(openAiKey)
    .UseAnthropicExtractor(anthropicKey);

Packages

Package Description
BlazorMemory Core library
BlazorMemory.Components Drop-in MemoryPanel component
BlazorMemory.Storage.IndexedDb Browser storage, no backend needed
BlazorMemory.Storage.InMemory For testing
BlazorMemory.Storage.EfCore SQL Server, PostgreSQL, SQLite
BlazorMemory.Embeddings.OpenAi OpenAI text-embedding-3-small
BlazorMemory.Extractor.OpenAi OpenAI gpt-4o-mini
BlazorMemory.Extractor.Anthropic Anthropic Claude

Run the sample app

git clone https://github.com/aftabkh4n/BlazorMemory
cd BlazorMemory/samples/ChatApp.BlazorWasm
dotnet run

Open http://localhost:5000, enter your OpenAI key, and start chatting.

Run the tests

dotnet test

38 tests across 4 test projects.

Roadmap

  • Relevance feedback ("forget this" / "this is important")
  • pgvector support for PostgreSQL
  • More Blazor components

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on BlazorMemory:

Package Downloads
BlazorMemory.Storage.IndexedDb

Browser IndexedDB storage adapter for BlazorMemory. Zero-backend persistent memory for Blazor WebAssembly apps — everything stays in the user's browser.

BlazorMemory.Extractor.Anthropic

Anthropic Claude-powered fact extractor and memory consolidator for BlazorMemory. Uses claude-haiku by default.

BlazorMemory.Extractor.OpenAi

OpenAI-powered fact extractor and memory consolidator for BlazorMemory. Uses gpt-4o-mini by default for fast, cheap extraction.

BlazorMemory.Embeddings.OpenAi

OpenAI embeddings provider for BlazorMemory. Uses text-embedding-3-small by default for fast, cheap vector embeddings.

BlazorMemory.Storage.InMemory

In-memory storage adapter for BlazorMemory. Ideal for testing, prototyping, and development.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.0 166 5/18/2026
0.3.0 225 5/4/2026
0.2.0 210 4/16/2026
0.1.0 241 3/15/2026