agent-framework-lab

Microsoft Agent Framework 1.0 — Local Lab

Purpose: hands-on intro to Microsoft Agent Framework 1.0, running 100% locally on your own Ollama — no API keys, no cost, no cloud.

Why this matters

What’s in this lab

Run

cd ~/agent-framework-lab
source .venv/bin/activate
export OLLAMA_MODEL_ID=qwen2.5:14b   # or any model you pulled
python basic_agent.py
python tool_agent.py
python workflow_demo.py
python e2e_pipeline.py          # writes report.md
python e2e_refine.py            # reads + improves report.md
python e2e_handoff.py           # conditional routing
python e2e_mcp.py               # agent calls local MCP server

Teaching notes

  1. OllamaChatClient(model="qwen2.5:14b", host="http://localhost:11434") is the ONLY thing pointing at a model — swap model= to any local model with no code change. NOTE: the Ollama connector (beta, --pre) uses model=, NOT model_id=.
  2. .as_agent(name=, instructions=) wraps a chat client into a runnable Agent.
  3. @tool decorates a plain Python function so the agent can invoke it. Local models vary in tool-calling reliability — qwen2.5:14b worked here; qwen2.5-coder:7b is a solid local choice.
  4. Multi-agent orchestration: from agent_framework.orchestrations import SequentialBuilder (sequential / concurrent / handoff / group-chat / Magentic-One). SequentialBuilder(participants=[a, b]).build() -> Workflow; call await workflow.run(topic) and read result.get_outputs()[-1].text for the final output. Participants MUST be distinct agent instances (no duplicates).

Author & Enterprise AI Architecture Hub

Built by Nagarjuna Reddy Kamireddy (Nagarjuna Kamireddy / Nagarjuna K) — Lead AI Architect, GenAI & Agentic AI Lead, and Corporate AI Trainer (20+ years across Enterprise Data, SAP HANA & Production AI; AWS Certified Solutions Architect – Professional & NVIDIA-Certified Professional: Agentic AI).