e-naxosMAF COURSE / COURS
Français

MICROSOFT AGENT FRAMEWORK · 0.16.0-rc.1

Demo440 — Context Budget

Compare raw context, selection, summary and memory with full request accounting.

Objectives

Prepare the live experiment

Demo440.App references Maf.Memory, Maf.Observability and the common connection. An available chat provider is required, Ollama granite4:3b by default or an explicitly configured API. This scenario uses neither embeddings nor RAG. Donnees/dossier_support_volumineux.txt is copied to output; its content remains unchanged, including French labels used by the filter.

dotnet build BaseTechnique.slnx -m:1 -c Release

Run through the final ledger

dotnet run --project demos/Demo440_ContextBudget/Demo440.App.csproj -c Release --no-build

The program runs then exits without a menu. Read raw-corpus and scenario-specific-line-filter, memory updates, context policies, then NativeWindow and Experiment coverage including auxiliary calls. For each stage retain size, available provider usage and answer. Failure exits 1 with Context experiment failed; no savings are inferred.

string selected = string.Join('\n', corpus.Split('\n').Where(line =>
    line.StartsWith("Client :", StringComparison.OrdinalIgnoreCase)
    || line.StartsWith("Situation :", StringComparison.OrdinalIgnoreCase)
    || line.StartsWith("Impact :", StringComparison.OrdinalIgnoreCase)
    || line.StartsWith("Contrainte", StringComparison.OrdinalIgnoreCase)
    || line.StartsWith("Point métier", StringComparison.OrdinalIgnoreCase)
    || line.Contains("billing.outbound", StringComparison.OrdinalIgnoreCase)));
if (string.IsNullOrWhiteSpace(selected))
    throw new InvalidDataException("The explicit scenario filter selected no lines. No fallback.");

demos/Demo440_ContextBudget/Program.cs · L19–L27 · 9a895c94534c

Source code · Demo440 · Folder

Compare retained facts

In a corpus copy, move a prohibition outside selected prefixes; observe whether it disappears from transmitted context. In ContextExperiment, compare full, window-last-3, generated-summary-unverified and bounded-user-facts with the same question. Check Billing, SQL Server 2022 and the nightly-restart prohibition. Do not treat a plausible answer as fidelity evidence.

Keep an attributable table

Recording template; no prefilled measured values
MechanismScope
ContextPolicy name; file and hash; characters; labelled estimate
TransportRequest count; known/absent counters; subtotals and coverage
QualityCorrection present; prohibition preserved; unknowns stated
ComparabilityProfile, parameters, order, duration, repetitions and auxiliary calls
Console.WriteLine("This line filter is deterministic selection for this fixture. Native MAF compaction and history policies follow.");
await ContextExperiment.RunAsync(chat, stop.Token);
Console.WriteLine("Experiment coverage including auxiliary calls: " + JsonSerializer.Serialize(ledger.Summarize()));
Console.WriteLine("All extraction, summary and compaction calls are reported separately. No cost or savings claim; answer quality must be evaluated separately.");

demos/Demo440_ContextBudget/Program.cs · L36–L39 · 9a895c94534c

Source code · Demo440 · Folder

Interpret without claiming savings

The estimate need not cover the whole request. A summary can lose or invent a fact; window compaction removes turns without summarizing. Extraction and summary add requests. Null values remain unknown. This page publishes no new live campaign or price comparison; the default profile remains unqualified.

Connect experiments

Prerequisites

Continue reading

Complete demo folder · README

lot012-observability-1 · 2026-10-24 · 9a895c94534cd5fc6f3da883e37e5f7856e588c1