Agentic AI Notebook
Phase 15

Build a Microsoft Agent

~2 min read

Concept & How It Works

  • Key points are in the visual diagram above.

Learn these elsewhere (not covered in depth here)

  • Security — Phase 20
  • Python tool — Phase 7

Why Does It Exist?

AutoGen shines in conversational teams. It fails when you forget termination and cost.

Real-World Analogy

A time-boxed workshop: 8 turns, a scribe, a critic, then you leave the room.
Loading diagram...

Visual Workflows

What is Build a Microsoft Agent?

Loading diagram...

Example

Scenario

Task: 'plot y=x^2'. Coder writes matplotlib in the proxy. Critic checks the file exists. Stop.

Solution

In Microsoft Agent Framework, apply Build a Microsoft Agent to this scenario: Task: 'plot y=x^2'. Identify the inputs, run the technique, validate the output, and note one thing you would monitor in production.

Practice Task

Do this before moving to the next module — reading alone is not enough.

Open the Code Walkthrough below and run it locally. Change one parameter related to Build a Microsoft Agent (e.g. model, temperature, top_k, or tool name), observe the difference in output, and write 2–3 sentences explaining what changed.

Code Walkthrough

Highlighted lines show where Build a Microsoft Agent happens in the code.

Build a Microsoft Agent
1user = UserProxyAgent(2    "user",3    human_input_mode="NEVER",4    code_execution_config={"work_dir": "scratch", "use_docker": True},5)6# initiate_chat with max_round=8 and a critic that emits TERMINATE

Commands to Remember

Commands to Remember

  • Sandbox code exec
  • max_round=8
  • Critic terminates
  • Save the transcript

Common Mistakes

  • use_docker False on untrusted code
  • Infinite critic loop

Cheat Sheet

Quick recap — the most important points from this module.

Cheat Sheet

quick ref
  • Time-box the chat
  • Sandbox
  • One executor
  • Transcript is the eval