AgentMemoryOS.Postgres 1.0.0

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

AgentMemoryOS

Durable, tiered memory for Microsoft Agent Framework (MAF) agents. .NET 10 / C#.

LLM agents are amnesiacs. Between turns — and especially between sessions — they start from zero: the same facts get re-explained, corrections never stick, and hard-won context evaporates the moment a conversation ends. AgentMemoryOS gives a MAF agent a memory that persists and improves.

It ports the memory-os pattern onto MAF's AIContextProvider lifecycle, so memory lives inside the agent's own request loop instead of bolted on beside it:

  • Before each turn it injects an always-on workspace plus gated, deduplicated recall — only what's relevant, never the whole corpus, so you don't pay for context bloat.
  • After each turn it extracts durable observations (skipping greetings and small talk) and hands them off the request path.
  • In the background a reconciler turns those observations into trust-scored facts and a vector-searchable index — so memory gets sharper over time without slowing the agent down.

Three tiers, mapped to how agents actually use memory:

Tier What it holds When it's recalled
L1 Workspace always-on markdown (who the user is, standing instructions) every turn
L3 Facts trust-scored statements, reinforced by repeated observation when relevant
L5 Vector semantic recall over everything observed when relevant

Every store call is keyed by a MemoryScope, so today's single agent and tomorrow's swarm (many agents sharing one template's memory) run the same code.

  • Default: zero-dependency in-memory stores + a deterministic CPU embedder — dotnet add and go.
  • Optional: Postgres + pgvector (durable facts + vectors), Redis (cache-aside).
  • Backends: any OpenAI-compatible endpoint (vLLM, Ollama, …) or Azure AI Foundry — you bring the IChatClient, the library reuses it as the extractor.

Quick start

Install à la carte, or the metapackage for the whole stack:

dotnet add package AgentMemoryOS            # core (in-memory, zero dependencies)
dotnet add package AgentMemoryOS.Postgres   # optional: durable Postgres + pgvector store
dotnet add package AgentMemoryOS.Redis      # optional: Redis cache-aside
# ...or everything in one reference:
dotnet add package AgentMemoryOS.All

One call wires the stores, caching, the background reconciler, and the provider; a second attaches memory to an agent. Memory reuses the IChatClient you already registered — the packages never build a chat client for you.

using Microsoft.Extensions.DependencyInjection;

services.AddSingleton<IChatClient>(myChatClient);

services.AddTieredMemory(memory => memory
    .UsePostgres(postgresConnectionString)   // omit for the zero-dependency in-memory default
    .UseRedisCache(redisConnectionString)    // optional cache-aside
    .Configure(o => o.MinTrust = 0.5));

// later, from the resolved IServiceProvider:
var agent = chatClient.CreateMemoryAgent(serviceProvider, o =>
{
    o.Name = "Assistant";
    o.ChatOptions = new ChatOptions { Instructions = "You are a helpful assistant." };
});

The builder owns registration ordering, so UsePostgres / UseRedisCache / Configure compose in any order. There is also an IConfiguration overload — services.AddTieredMemory(config.GetSection("Memory"), memory => memory.UsePostgres(conn)) — that binds the recall options from configuration.

How it works

TieredMemoryProvider : AIContextProvider overrides recall (before the model call) and capture (after it); a background MemoryReconciler materializes captured observations into trust-scored facts and a vector index, off the request path. Stores sit behind small interfaces keyed by MemoryScope, so swapping in-memory for Postgres/Redis — or a single agent for a shared swarm — never touches provider logic. The full rationale is in the design doc.

Running it locally

Standing up the example app, the local model + datastore stack (Postgres / Redis / vLLM), the Azure AI Foundry path, and build/test instructions all live in HOW-TO-DEV.md.

License

MIT.

Product Compatible and additional computed target framework versions.
.NET 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 (1)

Showing the top 1 NuGet packages that depend on AgentMemoryOS.Postgres:

Package Downloads
AgentMemoryOS.All

Metapackage bundling the MAF tiered-memory provider with the PostgreSQL + pgvector and Redis backends. Install this for the whole stack, or reference the individual packages a la carte.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 184 6/5/2026