A framework for building, orchestrating and deploying AI agents and multi-agent workflows with support for Go.
606
stars
723
commits
Go
primary language
Sep 11, 2026
updated

Microsoft Agent Framework (MAF) is an open, multi-language framework for building production-grade AI agents and multi-agent workflows. This repository contains the Go implementation of Microsoft Agent Framework, along with Go samples and documentation to help you get started.
Microsoft Agent Framework is built for teams taking agents from prototype to production. It provides a consistent foundation for building, orchestrating, and operating agent systems while keeping architecture choices open as requirements evolve, and supports a broad ecosystem including Microsoft Foundry, Azure OpenAI, OpenAI, Model Context Protocol (MCP), Agent2Agent (A2A), AG-UI, and the GitHub Copilot SDK.
The .NET and Python implementations are available in the upstream Microsoft Agent Framework repository.
Note: Microsoft Agent Framework for Go is in public preview and is currently evolving outside the core upstream codebase. As adoption and feedback grow, we expect closer alignment with the broader MAF ecosystem.
Watch the full Agent Framework introduction (30 min)
MAF is a strong fit if you:
Explore new MAF capabilities and real implementation patterns on the official blog.
For a detailed .NET-to-Go feature comparison, see the .NET and Go SDK feature comparison. In short, the Go SDK covers core agents, tools, middleware, workflows, observability, and interoperability integrations, while .NET currently has broader product integrations and several features that are not implemented yet in Go.
Go
go get github.com/microsoft/agent-framework-go
Create a simple Microsoft Foundry agent that writes a haiku about the Microsoft Agent Framework.
package main
import (
"cmp"
"context"
"fmt"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/microsoft/agent-framework-go/provider/foundryprovider"
)
func main() {
endpoint := os.Getenv("FOUNDRY_PROJECT_ENDPOINT")
model := cmp.Or(os.Getenv("FOUNDRY_MODEL"), "gpt-4o-mini")
// Authenticate to Microsoft Foundry.
token, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
panic(err)
}
// Create a Microsoft Foundry agent.
a := foundryprovider.NewAgent(endpoint, token, foundryprovider.ModelDeployment(model),
foundryprovider.AgentConfig{
Instructions: "You are a helpful assistant.",
},
)
// Run the agent.
ctx := context.Background()
fmt.Println(a.RunText(ctx, "Write a haiku about the Microsoft Agent Framework").Collect())
}
| Problem | Cause | Fix |
|---|---|---|
| Authentication errors when using Azure credentials | Not signed in to Azure CLI or another configured credential source | Run az login before starting your app, or configure the specific credential your app uses |
| API key errors | Wrong or missing API key | Verify the key and ensure it is for the correct resource or provider |
| Provider endpoint errors | Missing or incorrect endpoint, deployment, model, or API version | Check the environment variables and constructor options used by the sample or provider |
Tip:
DefaultAzureCredentialis convenient for development but in production, consider using a specific credential, such as managed identity, to avoid latency issues, unintended credential probing, and potential security risks from fallback mechanisms.
For environment variable configuration specific to each sample, refer to the README or source in the sample directory under examples.
[!IMPORTANT] If you use Microsoft Agent Framework to build applications that operate with any third-party servers, agents, code, or non-Azure Direct models ("Third-Party Systems"), you do so at your own risk. Third-Party Systems are Non-Microsoft Products under the Microsoft Product Terms and are governed by their own third-party license terms. You are responsible for any usage and associated costs.
We recommend reviewing all data being shared with and received from Third-Party Systems and being cognizant of third-party practices for handling, sharing, retention, and location of data. It is your responsibility to manage whether your data will flow outside of your organization's Azure compliance and geographic boundaries and any related implications, and that appropriate permissions, boundaries, and approvals are provisioned.
You are responsible for carefully reviewing and testing applications you build using Microsoft Agent Framework in the context of your specific use cases, and making all appropriate decisions and customizations. This includes implementing your own responsible AI mitigations such as metaprompt, content filters, or other safety systems, and ensuring your applications meet appropriate quality, reliability, security, and trustworthiness standards. See also: Transparency FAQ.
This repository does not configure Microsoft telemetry collection by default. Some packages and samples include optional OpenTelemetry instrumentation or connect to Microsoft-hosted services. To turn off framework instrumentation, do not configure OpenTelemetry exporters or telemetry middleware in your application. Service telemetry, if any, is governed by the services you choose to call.
The Agent Framework for Go is in public preview. Declarative agents, RAG, CodeAct, and functional workflows are not yet available. File issues on GitHub at https://github.com/microsoft/agent-framework-go/issues.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos is subject to those third-party policies.
Go
100.0%
A framework for building, orchestrating and deploying AI agents and multi-agent workflows with support for Go.
606
stars
723
commits
Go
primary language
Sep 11, 2026
updated

Microsoft Agent Framework (MAF) is an open, multi-language framework for building production-grade AI agents and multi-agent workflows. This repository contains the Go implementation of Microsoft Agent Framework, along with Go samples and documentation to help you get started.
Microsoft Agent Framework is built for teams taking agents from prototype to production. It provides a consistent foundation for building, orchestrating, and operating agent systems while keeping architecture choices open as requirements evolve, and supports a broad ecosystem including Microsoft Foundry, Azure OpenAI, OpenAI, Model Context Protocol (MCP), Agent2Agent (A2A), AG-UI, and the GitHub Copilot SDK.
The .NET and Python implementations are available in the upstream Microsoft Agent Framework repository.
Note: Microsoft Agent Framework for Go is in public preview and is currently evolving outside the core upstream codebase. As adoption and feedback grow, we expect closer alignment with the broader MAF ecosystem.
Watch the full Agent Framework introduction (30 min)
MAF is a strong fit if you:
Explore new MAF capabilities and real implementation patterns on the official blog.
For a detailed .NET-to-Go feature comparison, see the .NET and Go SDK feature comparison. In short, the Go SDK covers core agents, tools, middleware, workflows, observability, and interoperability integrations, while .NET currently has broader product integrations and several features that are not implemented yet in Go.
Go
go get github.com/microsoft/agent-framework-go
Create a simple Microsoft Foundry agent that writes a haiku about the Microsoft Agent Framework.
package main
import (
"cmp"
"context"
"fmt"
"os"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/microsoft/agent-framework-go/provider/foundryprovider"
)
func main() {
endpoint := os.Getenv("FOUNDRY_PROJECT_ENDPOINT")
model := cmp.Or(os.Getenv("FOUNDRY_MODEL"), "gpt-4o-mini")
// Authenticate to Microsoft Foundry.
token, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
panic(err)
}
// Create a Microsoft Foundry agent.
a := foundryprovider.NewAgent(endpoint, token, foundryprovider.ModelDeployment(model),
foundryprovider.AgentConfig{
Instructions: "You are a helpful assistant.",
},
)
// Run the agent.
ctx := context.Background()
fmt.Println(a.RunText(ctx, "Write a haiku about the Microsoft Agent Framework").Collect())
}
| Problem | Cause | Fix |
|---|---|---|
| Authentication errors when using Azure credentials | Not signed in to Azure CLI or another configured credential source | Run az login before starting your app, or configure the specific credential your app uses |
| API key errors | Wrong or missing API key | Verify the key and ensure it is for the correct resource or provider |
| Provider endpoint errors | Missing or incorrect endpoint, deployment, model, or API version | Check the environment variables and constructor options used by the sample or provider |
Tip:
DefaultAzureCredentialis convenient for development but in production, consider using a specific credential, such as managed identity, to avoid latency issues, unintended credential probing, and potential security risks from fallback mechanisms.
For environment variable configuration specific to each sample, refer to the README or source in the sample directory under examples.
[!IMPORTANT] If you use Microsoft Agent Framework to build applications that operate with any third-party servers, agents, code, or non-Azure Direct models ("Third-Party Systems"), you do so at your own risk. Third-Party Systems are Non-Microsoft Products under the Microsoft Product Terms and are governed by their own third-party license terms. You are responsible for any usage and associated costs.
We recommend reviewing all data being shared with and received from Third-Party Systems and being cognizant of third-party practices for handling, sharing, retention, and location of data. It is your responsibility to manage whether your data will flow outside of your organization's Azure compliance and geographic boundaries and any related implications, and that appropriate permissions, boundaries, and approvals are provisioned.
You are responsible for carefully reviewing and testing applications you build using Microsoft Agent Framework in the context of your specific use cases, and making all appropriate decisions and customizations. This includes implementing your own responsible AI mitigations such as metaprompt, content filters, or other safety systems, and ensuring your applications meet appropriate quality, reliability, security, and trustworthiness standards. See also: Transparency FAQ.
This repository does not configure Microsoft telemetry collection by default. Some packages and samples include optional OpenTelemetry instrumentation or connect to Microsoft-hosted services. To turn off framework instrumentation, do not configure OpenTelemetry exporters or telemetry middleware in your application. Service telemetry, if any, is governed by the services you choose to call.
The Agent Framework for Go is in public preview. Declarative agents, RAG, CodeAct, and functional workflows are not yet available. File issues on GitHub at https://github.com/microsoft/agent-framework-go/issues.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos is subject to those third-party policies.
Go
100.0%