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
<PackageReference Include="Progress.Memory.Extensions.AI" Version="0.2.1" />
<PackageVersion Include="Progress.Memory.Extensions.AI" Version="0.2.1" />
<PackageReference Include="Progress.Memory.Extensions.AI" />
paket add Progress.Memory.Extensions.AI --version 0.2.1
#r "nuget: Progress.Memory.Extensions.AI, 0.2.1"
#:package Progress.Memory.Extensions.AI@0.2.1
#addin nuget:?package=Progress.Memory.Extensions.AI&version=0.2.1
#tool nuget:?package=Progress.Memory.Extensions.AI&version=0.2.1
Progress.Memory.Extensions.AI
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:
- The last user message is used to search for relevant past memories.
- Matching facts are prepended as a system message before the request reaches the LLM.
- 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 | Versions 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. |
-
net10.0
- Microsoft.Extensions.AI (>= 10.6.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)
- Progress.Memory (>= 0.2.1)
-
net9.0
- Microsoft.Extensions.AI (>= 10.6.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)
- Progress.Memory (>= 0.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.