Skip to content

Lab 023: Tools and Memory in Microsoft Agent FrameworkΒΆ

Level: L200 Journey: ai-agents Time: ~90 min Cost: free

Phase 3 Β· local first

The required route is deterministic and local. The Real route is optional and includes an estimate and cleanup.

What You'll LearnΒΆ

  • Expose typed tools with explicit authorization
  • Use bounded short-term and durable memory
  • Replace obsolete SK planners with explicit orchestration
  • Test injection and memory-isolation boundaries

PrerequisitesΒΆ

  • Python 3.10+ and a terminal
  • No credentials for the required route
  • Read the linked official specification before using a hosted adapter

Visual modelΒΆ

flowchart LR
  A[MAF Agent] --> P[Policy]
  P --> T[Typed tools]
  P --> S[Session memory]
  P --> D[Durable store]
  T --> E[Evidence]

ScenarioΒΆ

OutdoorGear needs a reviewable workshop implementation with deterministic fixtures, explicit trust boundaries, measurable acceptance criteria, and a reversible optional hosted adapter.

Guided exerciseΒΆ

Step 1: define_toolsΒΆ

  1. Run the deterministic fixture for this step.
  2. Record the declared input, output, policy decision, and failure behavior.
  3. Change one bounded behavior and run the local test again.

Evidence: Save the command, result, and one sentence explaining why the evidence is trustworthy.

Step 2: bound_memoryΒΆ

  1. Run the deterministic fixture for this step.
  2. Record the declared input, output, policy decision, and failure behavior.
  3. Change one bounded behavior and run the local test again.

Evidence: Save the command, result, and one sentence explaining why the evidence is trustworthy.

Step 3: route_explicitlyΒΆ

  1. Run the deterministic fixture for this step.
  2. Record the declared input, output, policy decision, and failure behavior.
  3. Change one bounded behavior and run the local test again.

Evidence: Save the command, result, and one sentence explaining why the evidence is trustworthy.

Step 4: red_teamΒΆ

  1. Run the deterministic fixture for this step.
  2. Record the declared input, output, policy decision, and failure behavior.
  3. Change one bounded behavior and run the local test again.

Evidence: Save the command, result, and one sentence explaining why the evidence is trustworthy.

Run locallyΒΆ

cd docs/docs/en/labs/lab-023
python -m unittest discover -v

Simulation / Real pathΒΆ

Use the included deterministic fixtures and local validator. Estimated cost: **US$0**.

Supporting kitΒΆ

The site build generates stable PDF and ZIP downloads. CI also keeps a temporary artifact mirror for 30 days.

Scored knowledge checkΒΆ

Why keep a local contract?
Answer

It provides a deterministic baseline before adding hosted variability and cost.

When is the Real route complete?
Answer

Only after validation evidence and cleanup are recorded.

How should tool output be treated?
Answer

As untrusted data until policy and schema validation succeed.

Exit criteriaΒΆ

  • Local tests pass without credentials.
  • The diagram has a text explanation and does not depend on color.
  • The scored quiz was reviewed.
  • The Real path has a cost cap and cleanup plan.
  • Sources and stability status were checked.

Official public sourcesΒΆ