e-naxosMAF COURSE / COURS
Français

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

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.

Projects
ProjectRole
demos/Demo170_MemoryDrift/Demo170.App.csprojApp
shared/Maf.Memory/Maf.Memory.csprojShared implementation
shared/Maf.DemoConnection/Maf.DemoConnection.csprojConnection

Launch from the root

dotnet run --project demos/Demo170_MemoryDrift/Demo170.App.csproj -c Release --no-build

Modes 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

shared/Maf.Memory/ContextExperiment.cs · L11–L26 · 9a895c94534c

Source code · Maf.Memory · Folder

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

Continue and verify

Prerequisites

Continue reading

Complete demo folder · README

lot008-memory-rag-1 · 2026-10-24 · 9a895c94534cd5fc6f3da883e37e5f7856e588c1