Progress.Memory.Extensions.AI 0.2.1

Prefix Reserved
dotnet add package Progress.Memory.Extensions.AI --version 0.2.1
                    
NuGet\Install-Package Progress.Memory.Extensions.AI -Version 0.2.1
                    
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="Progress.Memory.Extensions.AI" Version="0.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Progress.Memory.Extensions.AI" Version="0.2.1" />
                    
Directory.Packages.props
<PackageReference Include="Progress.Memory.Extensions.AI" />
                    
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 Progress.Memory.Extensions.AI --version 0.2.1
                    
#r "nuget: Progress.Memory.Extensions.AI, 0.2.1"
                    
#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 Progress.Memory.Extensions.AI@0.2.1
                    
#: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=Progress.Memory.Extensions.AI&version=0.2.1
                    
Install as a Cake Addin
#tool nuget:?package=Progress.Memory.Extensions.AI&version=0.2.1
                    
Install as a Cake Tool

Progress.Memory.Extensions.AI

NuGet License: MIT

Microsoft.Extensions.AI integration for Progress Memory.

Adds automatic memory injection and LLM-callable memory tools to any IChatClient-based pipeline — OpenAI, Azure OpenAI, Ollama, or any other M.E.AI-compatible provider.

Not using Microsoft.Extensions.AI?
For Semantic Kernel agents, use Progress.Memory.SemanticKernel instead.

Requirements

  • .NET 8, 9, or 10
  • Progress.Memory (auto-included as a dependency)
  • Microsoft.Extensions.AI ≥ 10.6.0

Installation

dotnet add package Progress.Memory.Extensions.AI

Integration modes

Choose one or combine both:

Mode When to use
Middleware (UseProgressMemory) Silent auto-injection — memories are recalled and optionally saved on every request without changing your chat loop
Tools (WithProgressMemoryTools) LLM-controlled — the model decides when to call remember, recall, and forget

Mode 1 — Middleware (auto-inject)

Wrap any IChatClient with the UseProgressMemory middleware. On every call:

  1. The last user message is used to search for relevant past memories.
  2. Matching facts are prepended as a system message before the request reaches the LLM.
  3. If autoRemember: true, the completed exchange is saved to memory (awaited inline) after the response.

Minimal example

// Register the memory client
builder.Services.AddProgressMemory(new ProgressMemoryConfig(
    BackendBaseUrl: "https://memory.example.com",
    SdkApiKey: "pmem_p_..."));

// Build an IChatClient with memory middleware
builder.Services.AddChatClient(pipeline => pipeline
    .UseProgressMemory(sp, userId: "user-123", agentId: "my-agent", autoRemember: true)
    .Use(new OpenAIChatClient(openAIClient, "gpt-4o")));

Dynamic identity (multi-tenant apps)

Use delegate overloads so identity is resolved at request time rather than at startup:

builder.Services.AddChatClient(pipeline => pipeline
    .UseProgressMemory(
        sp,
        getUserId:  () => httpContextAccessor.HttpContext!.User.FindFirst("sub")!.Value,
        getAgentId: () => "my-agent",
        autoRemember: true)
    .Use(new OpenAIChatClient(openAIClient, "gpt-4o")));

Parameters

Parameter Type Default Description
memory IProgressMemoryClient — The memory client
userId / getUserId string / Func<string> — User identity for scoping
agentId / getAgentId string / Func<string> — Agent identity for scoping
topK int 10 Maximum memories injected per request
autoRemember bool false Save each exchange automatically after the LLM responds
conversationContext IConversationContext? null Threads turns into one conversation resource

Mode 2 — Tools (LLM-controlled)

Attach remember, recall, and forget as AIFunction tools so the LLM can invoke them autonomously when it decides memory is relevant.

var options = new ChatOptions()
    .WithProgressMemoryTools(memoryClient, userId: "user-123", agentId: "my-agent");

var response = await chatClient.CompleteAsync(messages, options);

The LLM schema describes each tool so the model knows when and how to use them.

Tool descriptions

Tool Invoked when
remember User states a stable preference, goal, constraint, or personal fact
recall A question may be answered better with prior context
forget User explicitly asks to erase a memory, or a stored fact is confirmed stale

Combining both modes

Use the middleware for seamless silent recall and add tools for LLM-directed write/delete:

builder.Services.AddChatClient(pipeline => pipeline
    .UseProgressMemory(sp, userId: "user-123", agentId: "my-agent")  // silent recall
    .Use(new OpenAIChatClient(openAIClient, "gpt-4o")));

// At call time, add tools for explicit remember/forget
var options = new ChatOptions()
    .WithProgressMemoryTools(memoryClient, userId: "user-123", agentId: "my-agent");
var response = await chatClient.CompleteAsync(messages, options);

Conversation threading

All turns within the same IConversationContext instance are linked into one conversation resource. Pass a shared ConversationContext instance across turns:

var context = new ConversationContext();

builder.Services.AddChatClient(pipeline => pipeline
    .UseProgressMemory(sp, userId: "user-123", agentId: "my-agent",
                       conversationContext: context)
    .Use(...));

See also

  • Progress.Memory — core client and DI registration
  • Progress.Memory.SemanticKernel — Semantic Kernel integration
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 is compatible.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.1 159 8/19/2026
0.1.3 142 7/10/2026