Quickstart: Create and test a basic agent (preview)

[This article is prerelease documentation and is subject to change.]

This article describes how to build your first agent with the Microsoft 365 Agents SDK for C#. It also describes how to test your agent locally with the Bot Framework Emulator.

Note

You might see both agent and bot used in the documentation. Bot is the legacy term. An agent is what you build with the Microsoft 365 Agents SDK.

To create your first agent with the Microsoft 365 Agents SDK, you don't need an Azure subscription or Azure Bot Service (ABS) resource. This quickstart focuses on creating and testing your first agent locally. When you get beyond initial exploration, we recommend you try other methods such as dev tunnels. You can learn more about testing in Test your agent.

Note

The Microsoft 365 Agents SDK is currently in Public Preview supporting C# only. Support for Python and node.js is coming soon.

This example and template do not support authentication of either incoming or outgoing communication. The example simply echoes the user's input message in the emulator to display the two-way communication and to help developers started with the SDK. It is not intended for use in production scenarios.

Prerequisites

Perform the following steps to create a new agent using the Echobot agent sample using Visual Studio. Instructions for Visual Studio Code and CLI are coming soon.

Create a new agent

In Visual Studio, download the Echobot agent sample from the repo, extract it, and open the solution in Visual Studio. The sample has all the files you need to configure an Echobot agent.

Start your agent

  1. Open the solution that you downloaded from the GitHub Repository for the Echobot agent.
  2. Run the project without debugging.
  3. Visual Studio builds the application, deploys it to localhost, and launches the web browser to display the application page. The application page should be blank, with some text.

At this point, your agent is running locally on port 3978.

Test your agent locally

You can now test your agent locally using the emulator:

  1. Open the Bot Framework Emulator.
  2. Ensure you have your code open and select Run without debugging.
  3. Select Open Bot.
  4. In the Bot URL field, enter the address http://localhost:3978/api/messages.
  5. Select Connect.

Your agent opens and you can now enter a message. The code you built is running and echoing the message you sent.

Summary

The Echobot agent sample is built and runs locally. To learn more about the sample see Structure of an Echobot agent.