Create reusable component collections (preview)

A component collection is a collection of reusable agent components. Copilot components include topics, knowledge, actions, and entities. You can share component collections between multiple agents within your environment. You can also use a solution to export and import component collections to move their content across multiple environments to meet your application lifecycle management (ALM) scenarios.

To edit a component collection, or add a component collection to an agent, you must be the person who created the collection, or a user with the system customizer or system admin role. Once a component collection is available for an agent, all agent authors can see and use the collection but they can't change the components inside the collection. Learn more about configuring user security in an environment.

Create component collections

You can create component collections directly from the Settings page for an agent. You can also create them from the Library page. When you add agent components to a collection, this operation moves the selected components to the collection. The originating agent now contains references to these components within the collection. You can now share the collection with other agents in your environment, or package it in a solution to be imported into other environments.

Create a component collection from an agent

  1. Open the agent that contains the components you want to make available as a component collection.

  2. Go to Settings and select Component collections.

  3. If you're about to create the first component collection in your environment, select Create. Otherwise, select New.

  4. Enter a name and a description for your component collection.

  5. Select Next.

  6. Select the components you want to add to the component collection. You can use the categories and the Search field to narrow down the list of components.

  7. Select Next.

  8. Review the content of your collection, and select Create.

Create a component collection from the library

  1. In the side navigation, select Library.

  2. Select Add new, then select Component collection.

  3. Enter a name and a description for your component collection.

  4. Select Finish.

  5. Connect the agent that contains the components you want to share to your new component collection.

  6. Add components from the selected agent to the collection.

Connect an agent to a component collection

  1. Go to the library and select the desired component collection. You can select the Component collection category and the Search field to narrow down the list of component collections.

  2. In the Installed on area, select Add agent.

  3. Select the agent in which you want to use the component collection, and select Add.

    You can add any components from the connected agents to your component collection. All the connected agents can also use any components from that collection.

Add components from an agent to a collection

  1. Go to the library and select the desired component collection. You can select the Component collection category and the Search field to narrow down the list of component collections.

  2. [Connect the agent](#connect-an agent-to-a-component-collection) that you want to add to the component collection, if it isn't already listed in the Installed on area.

  3. Select Add, then select Add from an agent.

  4. Select the desired agent, and select Next.

  5. Select the components you want to add to the component collection. You can use the categories and the Search field to narrow down the list of components.

  6. Select Next.

  7. Review the content of your collection, and select Add to collection.

Create a solution to export and import component collections

You use solutions to export agent components from one environment and import them into another. The solution acts as a carrier for the components. You can export and import multiple agent components in one solution.

  1. Go to the Solutions page.

  2. Select New solution.

  3. Enter the following information for the new solution:

    • Display name: The name to show in the list of solutions. You can change it later.
    • Name: The unique name of the solution, generated from Display name. You can only change it before you save the solution.
    • Publisher: Select the default publisher or create a new one. Consider creating a single publisher and use it consistently across all environments for your solution. Learn more about solution publishers.
    • Version: Enter a number for the version of your solution. The version number is included in the file name when you export the solution.
  4. Select Create.

Add component collections to a solution

  1. Go to the Solutions page, and open the desired solution if it isn't already.

  2. Select Add existing, point to Agent, and select Component collection.

    A panel appears, showing all available component collections.

  3. Select the component collections you want to export, and then select Add at the bottom of the panel.

Export a solution to share component collections in other environments

You export and import component collections by exporting and importing the solutions that contain them from one environment to another.

  1. Go to the Solutions page.

  2. Select the Commands icon () for the solution that contains the component collections you want to export, and then select Export solution.

  3. Enter or select the following options:

    • Version number: Copilot Studio automatically increments your solution version. You can accept the default or enter your own.
    • Export as: Select the package type, either Managed or Unmanaged. Learn more about managed and unmanaged solutions.
  4. Select Export. The export might take several minutes to complete. Watch the status message at the top of the Solutions page.

  5. When the export is finished, select the Download button to download a .zip file.

    The file name has this format: SolutionName_Version_SolutionType.zip—for example, ContosoSolution_1_0_0_1_managed.zip.

Import a solution to add component collections to an environment

  1. Go to the Solutions page.

  2. Select the environment where you want to import your component collection.

  3. Select Import solution.

  4. In the Import panel, select Browse, select the .zip file that contains the solution with your component collection, and then select Next.

  5. Select Import. The import might take several minutes to complete. Watch the status message at the top of the Solutions page.

  6. Wait a few moments while the import completes.

If the import isn't successful, select Download log file to download an XML file that contains details about what caused the import to fail. The most common reason an import fails is that the solution doesn't contain some required components.

Add imported component collections to your agent

After importing a component collection, you can use it in your agents.

  1. Open the agent where you want to use the component collection.

  2. Go to the Settings page and select Component collections.

  3. Next to the imported component collection, select the ellipsis () and select Add to agent.

    A message appears prompting you to confirm.

  4. Select Add to agent.

    The name of your agent appears under Active for for this component collection.

  5. Review the components from the imported collection, and publish the agent to make the changes available to your customers.

Add components to a component collection in a custom solution

If you add new agent components to a component collection in Copilot Studio, you must also add them to any unmanaged solution that refers to this component collection.

  1. Go to the Solutions page, and open the unmanaged solution that contains the component collection to update.

  2. In the Objects pane, select Agent component collections.

  3. Select the Commands icon () for the collection you want to update, point to Advanced, and select Add required objects.

  4. Select OK.

    In the Objects pane, you can select Agent components to verify that the expected components now appear.

Open the solution explorer

In Copilot Studio, select the ellipsis () in the side navigation, and select Solutions.

The Solutions page opens in a new browser tab.

Known issue

If you uploaded files as knowledge sources for an agent, adding such files to a component collection removes them from the originating agent. As a workaround, you can move such files from the component collection back to their originating agent.