MICROSOFT AGENT FRAMEWORK · 0.16.0-rc.1
Demo170 — Memory Drift
Corrections concern module and database; look for the prohibition on restarting the batch in each context.
Objectives
- Observe corrections and prevent stale facts from silently replacing current facts.
Prepare the demo
Start at the root of the complete distribution built in Release. Shared projects Maf.Memory and Maf.DemoConnection are required. Answers use live chat without embeddings. Local read, reset, forget and save commands need no generated answer. Demo170 calls chat directly for its comparison.
| Project | Role |
|---|---|
| demos/Demo170_MemoryDrift/Demo170.App.csproj | App |
| shared/Maf.Memory/Maf.Memory.csproj | Shared implementation |
| shared/Maf.DemoConnection/Maf.DemoConnection.csproj | Connection |
Launch from the root
dotnet run --project demos/Demo170_MemoryDrift/Demo170.App.csproj -c Release --no-buildModes and procedure
Launch the program: the fixed chronology and five strategies run automatically, without a menu. Record context, answers, provider usage and serialized session size.
public static IChatClient CreateRequestView(IChatClient chat)
{
#pragma warning disable MAAI001
return chat.AsBuilder().UseAIContextProviders(new CompactionProvider(
new SlidingWindowCompactionStrategy(CompactionTriggers.TurnsExceed(3), minimumPreservedTurns: 3))).Build();
#pragma warning restore MAAI001
}
/// <summary>Reduces retained history after each completed exchange; serialization saves the reduced list.</summary>
public static InMemoryChatHistoryProvider CreateBoundedHistory()
{
#pragma warning disable MAAI001
return new(new InMemoryChatHistoryProviderOptions
{
ChatReducer = new SlidingWindowCompactionStrategy(CompactionTriggers.TurnsExceed(3), minimumPreservedTurns: 3).AsChatReducer(),
ReducerTriggerEvent = InMemoryChatHistoryProviderOptions.ChatReducerTriggerEvent.AfterMessageAdded
Results and useful failures
Corrections concern module and database; look for the prohibition on restarting the batch in each context. An empty summary or one longer than 700 characters fails without fallback. The overall cancellation limit is ten minutes.
These observations are expected from inspecting the linked public code revision. The site lot separately reruns deterministic tests: it does not present an unmeasured generated answer or provider score as observed output.
Persistence and limits
Facts in Demo150/160 and the Demo170 comparison stay in-process. Demo130 retains SQLite context only; Demo140 retains its JSON snapshot. Forgetting one session does not purge other stores or backups. Admission errors remain visible without fallback. Scripted tests alone qualify no model.
dotnet test tests/Maf.Memory.Tests/Maf.Memory.Tests.csproj -m:1 -c Release --no-build --no-restore