Quickstart guide for building agents with generative AI

It's even simpler to build an agent using AI-powered capabilities in Microsoft Copilot Studio. Whether you're new to conversational AI or a seasoned developer, our intelligence platform is with you and your team every step of the way.

This quickstart helps you get started quickly to create an agent with generative AI capabilities. For a summary of the available features, see AI-based agent authoring overview.

Prerequisites

How agent conversations work

Copilot Studio uses customized NLU model and AI capabilities to understand what a user types, then responds with the best agent topic. A agent topic is a portion of a conversational thread between a user and the agent. Topics are linked together to form nodes. For more information, see Use topics to design an agent conversation.

For example, you might create an agent for your customers to ask common questions about your business. Your support overhead is reduced by deflecting support calls. In the agent, you can create a topic about your store's opening hours and name the topic Store hours.

When a customer asks a question such as "When do you open?" or "What are your opening hours?", the agent uses natural language understanding (NLU) to understand the intent behind the question. The agent matches that intent to the best topic, the Store hours topic.

The agent follows the conversation flow, which is a group of connected nodes, that you define in the Store hours topic. These questions use if/else arguments, or logic gates, to determine which store the customer wants. The final output of the topic shows the hours and contact information for that store's location.

However, you can't anticipate all the types of questions your customers ask. To help mitigate this, Copilot Studio incorporates powerful new AI-powered capabilities that use the latest advancements in NLU models. With your agent linked to a public or Bing-indexed website, your agent automatically generates responses. These responses are conversational, plain language, and don't depend on the agent builder to create topics for every eventuality.

As well, when AI general knowledge is enabled, your agent can access information not in its website or other knowledge sources.

Your agent uses AI powered by the Azure OpenAI GPT model, also used in Bing, to create agent topics from a simple description of your needs. Similarly, you can modify and update any topic in your agent by describing the changes you want to make.

Ready to get started? The first step is to create your agent.

Create an agent with instant knowledge

For any user-sent message that can't be matched to an existing topic, your agent can look for an answer on a fallback website or other knowledge source. The agent turns the answer into a simple message that it sends to the user.

  1. Go to the Microsoft Copilot Studio home page.

  2. Create an agent. There are many ways to create an agent but, for this quickstart, you might open the Agents page, select + New agent, and then select Skip to configure.

    Screenshot of the Agents page with the New agent option.

  3. In the configuration page, enter a name for your agent or accept the default, Agent or Agent n. Optionally add a description.

  4. In the Knowledge section, select Add knowledge and then Public websites.

  5. In Add public websites, enter the URL of a public or Bing-indexed website. This website is where the agent can search for answers if it can't find the right topic for a user question. Select Add to save the URL and Add again to exit the window.

    Tip

    Any URL with text works, for example https://www.microsoft.com/en-us/store/.

    To add a URL or other knowledge sources after creating a website, go to the Knowledge page.

    Screenshot of the knowledge website.

  6. Select Create to finish creating your agent.

    Copilot Studio displays an overview of the agent you created, with ideas for what to do next.

    Notice the Knowledge section, which shows the website you added. It also includes the option Allow the AI to use its own general knowledge, enabled by default, which lets the agent answer questions outside the specific knowledge sources.

    Screenshot of the knowledge sources.

Test your agent for knowledge

Your agent is now ready to answer questions based on its knowledge sources. Use the Test pane to try it out:

  1. Select the Test button at the top right of the Copilot Studio page.

  2. To view the underlying action of the agent while it's answering your questions, select ... in the Test pane and choose Track between topics.

    Screenshot of the tracking option.

  3. In the Ask a question prompt, ask the agent a question related to the website. For example, type What is your return policy? or Do you give military discounts?

    The agent retrieves information from the website and returns a response. The response provides one or more links to where it found that information.

    In the authoring canvas, you can see the conversation flow and the nodes that the agent used to answer your question. In this case, the agent used the Conversational boosting system topic to find the information and respond to your question.

  4. Now ask a general question, for example Why is the sky blue? or even a nonsense question such as What color is the sky in your world? If Allow AI general Knowledge is enabled, the agent can answer questions like these.

    It might take a few minutes for the AI general knowledge to be available. If you don't get an answer immediately, try again.

    Answers to general knowledge questions.

    For AI general knowledge answers, the agent reminds users that the information might not be accurate.

If the agent can't find an answer, it prompts you to rephrase the question. After two prompts, if it still can't determine your intent, it escalates to a live agent through the Escalate system topic.

You notice that even general knowledge has its limits. Although the agent can answer many questions, it doesn't have access to live information such as news or weather reports. You add this capability using generative orchestration later in this quickstart.

For more information, see Generative answers and AI general knowledge. You can also find instructions for enabling generative AI in agents you already created.

Note

After you test your agent, select the reset icon at the top of the Test agent pane to clear previous conversations. Resetting makes it easier to follow the flow of the current topic without getting confused by previous conversations.

Screenshot of Test agent pane reset button that looks like a circular arrow.

You can return to the authoring canvas at any time to revise the conversation path. The Test agent pane automatically refreshes when you select Save after editing your topics.

If error codes appear in the test pane, see Understand error codes.

Auto-create a new topic

You can create a new topic by describing what you want the topic to do. Copilot Studio uses your description to generate a topic with conversational responses and multiple types of nodes.

  1. With your agent open on the Topics page, select Add a topic > Create from description with Copilot.

    Note

    If you don't see Create from description, do the following to enable it:

    1. On the top menu bar, select the Settings icon then General settings.
    2. Turn on Build and iterate on your topics by describing what you want.
  2. In the window that appears, enter a name in Name your topic.

  3. In the Create a topic to... field, describe your topic in simple, plain English. See the examples to understand the structure of a description and select View more examples for more ideas.

    Screenshot of the Create it with Copilot pop-up window.

  4. Select Create and then Save.

Once your topic is created, you can test it. In the Test pane, ask a question that matches the intent of the topic you created. For example, if you created a topic about job opportunities, enter I'm looking for a job.

You can explore ways to extend and enhance your topic in Create and edit topics with Copilot.

Use generative orchestration

An agent configured to use generative orchestration automatically chooses topics, actions, and knowledge sources to respond to the user. Instead of relying on trigger phrases for each topic, or calling actions manually from within a topic, the agent can use its own logic to select the most appropriate actions at runtime.

Note

Generative orchestration is a preview feature. Preview features aren't meant for production use and may have restricted functionality. These features are available before an official release so that customers can get early access and provide feedback.

  1. Turn on generative orchestration: select the Settings button then Generative AI. Select Generative. (The default is Classic.)

    Screenshot of the Generative AI settings.

  2. Select Save.

  3. Select your preferred level of strictness for content moderation and then select Save again.

  4. Exit the Settings page and select the Actions tab.

  5. Create an action: select Add an action. Follow the instructions in Use actions with custom agents (preview) to add a weather website.

    Screenshot of the Add action button.

When you add this action and turn on generative orchestration, the agent has access to live information, as well as specific topics, specific knowledge sources, and AI general knowledge.

To see the action of the agent as it answers your questions, select the Activity map icon in the Test pane and turn it On. In the activity map, select the Tracking between topics icon and turn it On.

Screenshot of the tracking buttons.

For example, ask the agent What's the weather in Montreal in fahrenheit? The agent uses the action you created to find the answer.

Screenshot of the weather response.

Add features to further develop your agent

You can enhance your agent to make it unique and enjoyable. Try adding images and video clips, adaptive cards, entities, and variable expressions.

For more information, see Key concepts - Enhanced authoring of agent or continue your agent-building journey by exploring the rest of the Microsoft Copilot Studio documentation.