The `agent-framework-copilotstudio` library provides a Python integration for connecting to Microsoft Copilot Studio agents using the Microsoft Agent Framework. It enables developers to build, orchestrate, and deploy AI agents and multi-agent workflows, supporting both low-code Copilot Studio agents and custom Python agents. The library is actively maintained, with frequent preview releases (indicated by 'b' in version numbers), and is part of Microsoft's broader Agent Framework ecosystem.
pip install agent-framework-copilotstudio --preVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize and interact with a `CopilotStudioAgent`. It assumes the necessary environment variables (`COPILOTSTUDIOAGENT__ENVIRONMENTID`, `COPILOTSTUDIOAGENT__SCHEMANAME`, `COPILOTSTUDIOAGENT__AGENTAPPID`, `COPILOTSTUDIOAGENT__TENANTID`) are configured for authentication and agent identification. The example includes both a standard `run` command and a streaming `run` for real-time responses.
Verify all required environment variables are correctly defined. Confirm your Azure AD app registration has public client flows enabled, necessary Power Platform API permissions, and admin consent. Ensure the Copilot Studio agent is published and its environment ID is in the `Default-<guid>` format.
Provide detailed and unambiguous topic descriptions within Copilot Studio, focusing on outcomes rather than just features. This helps the underlying large language model correctly route user queries.
Always manually add new agent components to your solution after creation. Although you may create an agent within the solution's context, new sub-components often require explicit inclusion.
Design multi-agent systems to avoid direct multilevel chaining. Consider alternative orchestration patterns or single-level interactions where a primary agent delegates to other agents without deep nesting.
Review your Power Platform data policies. Ensure all connectors utilized by your Copilot Studio agent are allowed and configured within the appropriate data groups to prevent DLP violations. Consult with your Power Platform administrator if necessary.