Tech and Telecom

Microsoft Shows How to Build Your Own AI Agent from Scratch

Microsoft has launched a four-part developer series explaining how to build a CLI-style AI agent that can plan tasks, use tools, retain information, and safely take action for a user.

The series uses Microsoft Agent Framework and provides examples in .NET and Python side by side.

Microsoft describes this type of assistant as a “claw,” but explains that the underlying system is an agent harness built around a language model.

Ad Powered By Advergic
Loading ad . . .
Ad - Continue scrolling to read

What is an Agent Harness?

An agent harness is a software loop that connects a language model with the systems it needs to complete practical tasks.

The model provides the reasoning, while the harness gives it access to tools, planning, memory, approval controls, and monitoring.

A capable harness can allow an agent to call tools, create and adjust a plan, retain information across conversations, and request permission before carrying out sensitive actions.

It can also record what the agent did and provide a way to deploy it as a working service.

Microsoft Agent Framework provides these capabilities as reusable components, reducing the amount of supporting infrastructure developers must create themselves.

Four-Part Guide

The first part of the series introduces a basic agent harness with a custom stock-price tool, web search, and planning.

The planning system includes task lists and separate plan and execution modes, allowing the agent to break a broad request into smaller steps and track its progress.

The second part will add file access, allowing the agent to read a portfolio from a CSV file and write reports.

It will also introduce human approval for risky actions and durable memory stored through files and Microsoft Foundry.

The third part will cover skills, Foundry-managed skills, shell access, CodeAct, and background agents that can complete several tasks concurrently.

The final part will focus on production use. It will cover OpenTelemetry observability, Microsoft Purview governance, evaluation, and deployment through Foundry Hosted Agents.

Microsoft says all four parts are supported by runnable samples that developers can follow and test themselves.

Model Still Matters

Microsoft says the harness expands what a model can do, but the underlying model remains responsible for reasoning and decision-making.

During each step, the model must follow both the user’s instructions and the operating instructions supplied by the harness.

It must select the correct tool, follow a multi-stage plan, interpret the information returned by its tools, and recognise when an action requires approval.

Microsoft recommends using a current, high-capability model for these tasks. Older or smaller models can still run inside the harness, but they may struggle to follow layered instructions and could require more guidance from the user.

Recent improvements in instruction-following, tool calling, context length, and multi-step reasoning have made these agents more practical than earlier systems.

Personal Finance Assistant

Microsoft uses a personal finance and investment assistant as the running example throughout the series.

The agent can look up stock prices, search for market information, read a user’s portfolio, perform analyses, and prepare reports.

The example also includes actions with different levels of risk.

Researching a stock or reading a portfolio may not require approval, while placing a trade or sending a report would require the user’s permission.

Some requests also require the agent to prepare and follow a plan before completing the work.

Microsoft says this example provides a practical way to demonstrate tools, planning, memory, approvals, and other parts of the agent harness within a single project.

Stay Connected with ProPakistani

Get the latest tech news, telecom insights, and product launches wherever you prefer.

Add ProPakistani to Preferred Sources and see more of our stories in Google Search and Top Stories.

Share
Published by
Afaq Wajdan Malik