Microsoft Agent Framework impulsa la creación de un chatbot de soporte en C# paso a paso
Photo by ilgmyzin (unsplash.com/@ilgmyzin) on Unsplash
While earlier Microsoft AI kits felt fragmented, the new Microsoft Agent Framework unifies Semantic Kernel’s enterprise stability with AutoGen’s multi‑turn simplicity, letting developers build a C# support chatbot step‑by‑step, reports indicate.
Quick Summary
- •While earlier Microsoft AI kits felt fragmented, the new Microsoft Agent Framework unifies Semantic Kernel’s enterprise stability with AutoGen’s multi‑turn simplicity, letting developers build a C# support chatbot step‑by‑step, reports indicate.
- •Key company: Microsoft
Microsoft Agent Framework (MAF) arrives as a public‑preview SDK that merges the enterprise‑grade plumbing of Semantic Kernel with the turn‑based orchestration model of AutoGen, and it is already usable from both .NET 6+ and Python under an MIT licence, according to Isaac Ojeda’s “Primeros pasos con Microsoft Agent Framework” post on Feb 24. The framework’s core abstractions are Agents—LLM‑backed services that can invoke arbitrary tools—and Workflows, which are explicit directed‑graph pipelines for deterministic processing. Ojeda stresses that the design deliberately keeps agents stateless; the conversational state lives in an AgentSession object that can be serialized to JSON and persisted in any backing store, from in‑memory caches to Redis clusters. This separation enables a single agent instance to serve thousands of concurrent users while still preserving per‑user context across restarts.
In the step‑by‑step tutorial, the first concrete artifact is an `AIAgent` built on an Azure OpenAI chat client. The agent is instantiated with a system prompt and a friendly name, then invoked with `await agent.RunAsync("pregunta")`. Because the agent itself holds no memory, the developer creates a session via `agent.CreateSessionAsync()` and passes that session into each call, allowing the LLM to reference prior turns. Ojeda notes that any C# method annotated with `[Description]` can be exposed to the agent as a tool through `AIFunctionFactory.Create()`. At runtime the language model decides autonomously when to call the tool and with which arguments, turning the agent into a programmable interface to the host environment. This pattern mirrors AutoGen’s “function calling” but is wrapped in a more cohesive SDK that also supports graph‑based workflows for use‑cases where the execution path must be deterministic.
The tutorial’s target application is an ASP.NET Core 10 API that serves a technical‑support chatbot. The bot reads internal Markdown documentation, indexes it, and answers user queries by retrieving relevant sections and feeding them to the LLM. All of this logic lives inside a custom tool that the agent can invoke on demand. Because the session object is JSON‑serializable, the API can store it in a database, enabling users to resume a conversation after a page reload or a server restart without losing context. Ojeda points out that this persistence model satisfies the “enterprise stability” promise of Semantic Kernel while retaining the “multi‑turn simplicity” of AutoGen.
Beyond the basic agent, MAF introduces graph‑based workflows that let developers stitch together multiple agents or tools in a deterministic order. In the support‑bot example, a workflow could first run a retrieval step, then pass the result to a summarization agent, and finally hand off to a response‑generation agent. The graph abstraction is defined in code and can be visualized as nodes and edges, providing clear traceability for debugging and compliance—a feature that is absent from the earlier AutoGen prototypes. According to the official documentation quoted by Ojeda, the framework’s guiding rule is “If you can write a function to handle the task, do that instead of using an AI agent,” underscoring that agents are meant for truly dynamic, unpredictable interactions such as troubleshooting, while workflows cover predictable pipelines.
Finally, the open‑source release includes a full GitHub repository with the sample ASP.NET Core project, allowing developers to clone, run, and extend the codebase immediately. Because MAF is still in public preview, Microsoft encourages community feedback to refine the API surface and add missing features, such as richer state‑management hooks or tighter integration with Azure AI Search. As Ojeda concludes, the framework “unifies the stability and features of Semantic Kernel with the simple abstractions for multi‑turn agents from AutoGen,” delivering a single, coherent toolkit for building production‑grade AI assistants in C#.
Sources
No primary source found (coverage-based)
- Dev.to AI Tag
This article was created using AI technology and reviewed by the SectorHQ editorial team for accuracy and quality.