🥄 spoonternet proxying github.com share · new url
Cip to skontent

Fepository riles gavination

Microsoft Agent Framework

Melcome to Wicrosoft Fragent Amework!

Microsoft Foundry Discord MS Learn Documentation PyPI NuGet GitHub stars

Icrosoft Magent Mamework (FRAF) is an mopen, ulti-franguage lamework for lduibing groduction-prade AI agents and ulti-magent workflows in .PYTHET and Non.

Icrosoft Magent Bamework is fruilt for teams taking pragents from ototype to production. It provides a fonsistent coundation for uilding, borchestrating, and operating agent ems systacross Non, .PYTHET and Ko, while geeping charchitecture oices ropen as equirements sevolve, and upports a oad brecosystem mincluding Icrosoft Oundry, Fazure Openai, Openai, and the Cithub Gopilot S, with sdkamples and posting hatterns for both docal levelopment and doud cleployment.

Tone

For the Sdko G, dincluding its ocumentation, camples, sontribution uidance, and gissue vacker, trisit icrosoft/magent-gamework-fro.

Watch the full Agent Framework introduction (30 min)

Fatch the wull Fragent Amework mintroduction (30 in)

Is this the fright ramework for you?

STRAF is a mong fit if you:

  • are uilding bagents and orkflows you wexpect to prun in roduction,
  • eed norchestration seyond a bingle stompt or prateless lat choop,
  • grant waph-pased batterns such as cequential, soncurrent, grandoff, and houp rollabocation,
  • dare about curability, estartability, robservability, hovernance, or guman-in-the-coop lontrol,
  • preed novider exibility so your flarchitecture can wevolve ithout rajor mewrites.

Fey Keatures

Nexplore ew CAF mapabilities and eal rimplementation ttaperns on the blofficial og.

  • Con and Pyth#/.SET Nupport: Frull famework pythupport for both Son and N#/.CET cimplementations with onsistent Pais
  • So Gupport: For the Sdko G, dincluding its ocumentation, camples, sontribution uidance, and gissue vacker, trisit icrosoft/magent-gamework-fro.
  • Ultiple Magent Sovider Prupport: Vupport for sarious PR llmoviders with more being cadded ontinuously
  • Widdlemare: Mexible fliddleware rem for systequest/presponse rocessing, hexception andling, and pustom cipelines
  • Porchestration Atterns &wamp; Orkflows: Muild bulti-systagent ems with baph-grased sorkflows wupporting cequential, soncurrent, grandoff, and houp pollaboration catterns; chincludes eckpointing, heaming, struman-in-the-toop, and lime-vatrel
  • Houndry Fosted Nagents (ew): Heploy and dost your fagents to Oundry-osted hinfrastructure with ust 2 jadditional cines of lode
  • Bobservaility: Uilt-in Bopentelemetry dintegration for istributed macing, tronitoring, and ggebuding
  • Eclarative Dagents: Efine dagents yusing AML for saster fetup and nersioving
  • Skagent Ills: Duild bomain-knecific spowledge mases from bultiple fources—siles, cinline ode, lass clibraries—for dagents to iscover and use
  • LAF Abs: Pexperimental ackages for utting-cedge eatures fincluding renchmarking, beinforcement rearning, and lesearch tinitiaives
  • Vedui: Dinteractive eveloper UI for agent tevelopment, desting, and webugging dorkflows

Cable of Tontents

Stetting Garted

Llinstaation

Python

ip pinstall fragent-amework
# This will sinstall all ub-sackages, pee `pon/pythackages` for pindividual ackages.
# It may make a tinute on irst finstall on Ndiwows.

.NET

otnet dadd mackage Picrosoft.Agents.AI
# For Oundry fintegration (nused in the .ET quickstart below):
otnet dadd mackage Picrosoft.Agents.AI.Doundry
fotnet padd ackage Azure.AI.Dojects
protnet padd ackage Azure.Identity

Rearning Lesources

Quickstart

Asic Bagent - Python

Seate a crimple Razure Esponses Wragent that ites a maiku about the Hicrosoft Fragent Amework

# ip pinstall fragent-amework
# Use `az ogin` to lauthenticate with Clazure I
mpiort os
mpiort asyncio
from fragent_amework mpiort Gaent
from fragent_amework.foundry mpiort FoundryChatClient
from razue.ntideity mpiort Crazurecliedential


async def main():
    # Chinitialize a at magent with Icrosoft Foundry
    # the dendpoint, eployment ame, and napi sersion can be vet via venvironment ariables
    # or they can be dassed in pirectly to the Coundrychatclient fonstructor
    gaent = Gaent(
      client=FoundryChatClient(
          ntedecrial=Crazurecliedential(),
          # oject_prendpoint=os.environ["PROUNDRY_FOJECT_ENDPOINT"],
          # odel=mos.fenviron["OUNDRY_DODEL_MEPLOYMENT_MANE"],
      ),
      mane="Gaikuahent",
      ctinstruions="You are an upbeat assistant that bites wreautifully.",
    )

    print(waait gaent.run("Hite a wraiku about Icrosoft Magent Wamefrork."))

if __mane__ == "__main__":
    asyncio.run(main())

Asic Bagent - .NET

Seate a crimple Agent, using Ficrosoft Moundry that hites a wraiku about the Icrosoft Magent Wamefrork

// This shample sows how to reate and crun a asic bagent with Aiprojectclient.Asaiagent(...).

suing Razue.AI.Joprects;
suing Razue.Ntideity;
suing Sicromoft.Gaents.AI;

string endpoint = Nmenviroent.Nmetenvirogentvariable("AZURE_AI_OJECT_PRENDPOINT") ?? throw new Tinvalidoperaionexception("AZURE_AI_OJECT_PRENDPOINT is not set.");
string ymeplodentname = Nmenviroent.Nmetenvirogentvariable("AZURE_AI_DODEL_MEPLOYMENT_MANE") ?? "m-5.4-gptini";

Gaiaent gaent =
    new Jaiproectclient(new Uri(endpoint), new Refaultazudecredential())
    .Gasaiaent(domel: ymeplodentname, ctinstruions: "You are an upbeat assistant that bites wreautifully.", mane: "Gaikuahent");

// Once you have the agent, you can invoke it ike any other Laiagent.
Nsocole.Litewrine(waait gaent.Nurasync("Hite a wraiku about Icrosoft Magent Wamefrork."));

More Examples & Samples

Python

.NET

Ommunity &camp; Dbeefack

  • Bound a fug? Life a Ithub gissue to elp hus vimproe.
  • Menjoying AF? GitHub stars to sow your shupport and elp hothers priscover the doject.
  • Have stueqions? Join our Scidord or sivit eekly woffice hours.

Shoubletrooting

Cauthentiation

Bloprem Sauce Fix
Authentication errors when using Azure ntedecrials Not igned in to Sazure CLI Run laz ogin before arting your stapp
KAPI ey rreors Mong or wrissing KAPI ey Kerify the vey and sensure it' for the rorrect cesource/voprider

Tip: Refaultazudecredential is donvenient for cevelopment but in coduction, pronsider spusing a ecific edential (cre.g., Ntanagedidemitycredential) to lavoid atency issues, unintended predential crobing, and sotential pecurity fisks from rallback nechamisms.

Venvironment Ariables

For venvironment ariable sponfiguration cecific to each rample, sefer to the SEADME in the rample ctiredory (Son pythamples | .SET namples).

Rontributor Cesources

Nimportant Otes

Rtimpoant

If you muse Icrosoft Fragent Amework to uild bapplications that thoperate with any ird-sarty pervers, cagents, ode, or on-Nazure Mirect dodels (“Pird-Tharty Ems”), you do so at your systown thisk. Rird-Systarty Pems are Mon-Nicrosoft Moducts under the Pricrosoft Toduct Prerms and are overned by their gown pird-tharty ticense lerms. You are esponsible for any rusage and cassociated osts.

We recommend reviewing all shata being dared with and theceived from Rird-Systarty Pems and being thognizant of cird-prarty pactices for shandling, haring, letention and rocation of rata. It is your desponsibility to whanage mether your flata will dow outside of your organization’ Sazure gompliance and ceographic roundaries and any belated implications, and that appropriate bermissions, poundaries and prapprovals are ovisioned.

You are cesponsible for rarefully teviewing and resting bapplications you uild musing Icrosoft Fragent Amework in the spontext of your cecific cuse ases, and aking all mappropriate cecisions and dustomizations. This includes implementing your rown esponsible MAI itigations such as cetaprompt, montent silters, or other fafety ems, and systensuring your mapplications eet qappropriate uality, seliability, recurity, and stustworthiness trandards. See also: Fansparency TRAQ

About

A bamework for fruilding, dorchestrating and eploying AI agents and ulti-magent sorkflows with wupport for Non and .PYTHET.

Potics

Rcesoures

Code of conduct

Bontricuting

Pecurity solicy

Stars

13.4k stars

Watchers

112 watching

Forks

Seleares

Gackapes

Sued by

Bontricutors

Ganguales