{"id":8809,"library":"agent-framework-lab","title":"Microsoft Agent Framework Lab","description":"agent-framework-lab provides experimental modules as part of the Microsoft Agent Framework, focusing on cutting-edge features, benchmarking, reinforcement learning, and research initiatives. It is currently in a beta development stage (1.0.0b251024) and is designed for developers building, learning to build, or exploring AI agents using modern frameworks and tooling.","status":"active","version":"1.0.0b251024","language":"en","source_language":"en","source_url":"https://github.com/microsoft/agent-framework","tags":["AI","agents","Microsoft","experimental","LLM","framework"],"install":[{"cmd":"pip install agent-framework-lab","lang":"bash","label":"Install `agent-framework-lab`"},{"cmd":"pip install agent-framework","lang":"bash","label":"Install the complete Agent Framework (includes lab modules)"}],"dependencies":[{"reason":"Required Python version","package":"python","version":">=3.10","optional":false},{"reason":"Core components of the Microsoft Agent Framework","package":"agent-framework-core","version":">=1.0.0","optional":false}],"imports":[{"note":"Common core agent class","symbol":"Agent","correct":"from agent_framework.core import Agent"},{"note":"For creating messages in conversations","symbol":"Message","correct":"from agent_framework import Message"},{"note":"Example of an LLM client, requires `agent-framework-openai` package","symbol":"OpenAIChatClient","correct":"from agent_framework.openai import OpenAIChatClient"},{"note":"Example import for an experimental module from the `lab` sub-package. Specific modules will vary.","symbol":"some_lab_module","correct":"from agent_framework.lab import some_lab_module"}],"quickstart":{"code":"import os\nfrom agent_framework import Message\nfrom agent_framework.openai import OpenAIChatClient\nfrom agent_framework.core import Agent\n\n# Ensure your OpenAI API key is set as an environment variable\n# Or, if using Azure OpenAI, set AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEY, etc.\n# Agent Framework does not automatically load .env files; use `load_dotenv()` if needed.\nOPENAI_API_KEY = os.environ.get('OPENAI_API_KEY', '')\n\nif not OPENAI_API_KEY:\n    print(\"Warning: OPENAI_API_KEY environment variable not set. This example may fail.\")\n\nasync def main():\n    client = OpenAIChatClient(api_key=OPENAI_API_KEY)\n    \n    # Create a simple agent\n    agent = Agent(\n        name=\"MyFirstAgent\",\n        instructions=\"You are a helpful assistant.\",\n        client=client\n    )\n    \n    # Send a message to the agent\n    response = await agent.run(\n        messages=[Message(\"user\", \"Hello, how are you?\")]\n    )\n    \n    print(f\"Agent: {response.content[0].text}\")\n\nif __name__ == \"__main__\":\n    import asyncio\n    asyncio.run(main())\n","lang":"python","description":"This quickstart demonstrates creating a basic agent using the core Microsoft Agent Framework and an OpenAI chat client. Modules from `agent-framework-lab` would typically extend or be integrated into such agents and workflows, for example, by providing specialized tools, evaluation components, or experimental agent behaviors."},"warnings":[{"fix":"Consult the official migration guides (e.g., from Semantic Kernel or AutoGen) and update code to use the new API patterns, especially for `agent-framework-core`, `agent-framework-openai`, and `agent-framework-foundry`.","message":"The 1.0.0 release of Microsoft Agent Framework introduced significant architectural changes, particularly around provider-leading client design, the extraction of OpenAI code from core, and standardized naming. Previous beta versions are not directly compatible.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Use these modules with caution in production environments. Pin exact versions of `agent-framework-lab` and be prepared for API changes in future updates. Monitor the GitHub repository for updates to the 'Labs directory'.","message":"`agent-framework-lab` contains experimental modules. Features and APIs within this sub-package are subject to rapid change, may be unstable, and are not guaranteed for long-term support.","severity":"gotcha","affected_versions":"All beta versions"},{"fix":"Manually load `.env` files at the start of your application using `dotenv.load_dotenv()` or set environment variables directly in your shell/IDE before running your application.","message":"The Agent Framework does not automatically load environment variables from `.env` files. API keys and other configurations must be explicitly loaded or set in the environment.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review the `agent-framework` changelog and upgrade guides. Ensure `agent-framework-core` and provider packages like `agent-framework-openai` are updated to 1.0.0 or later and adapt your code to the new, leaner core and separate provider packages.","message":"Prior to 1.0.0, there were deprecated kwargs compatibility paths, core dependencies were heavier, and OpenAI provider implementation was bundled. These have been removed or refactored.","severity":"breaking","affected_versions":"<1.0.0"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"For Azure AI Foundry, connect directly to a Foundry-hosted agent using `FoundryAgent`. For other Azure-related components, refer to the updated documentation for new import paths and classes in `agent-framework-foundry` or other specific Azure packages.","cause":"The Azure-specific implementations, especially for `AzureAIProjectAgentProvider`, have been moved or refactored in version 1.0.0 and are no longer directly under `agent_framework.azure`.","error":"ModuleNotFoundError: No module named 'agent_framework.azure'"},{"fix":"Update your code to pass the message content as the positional `content` argument, which expects a list of content items (e.g., `Message('user', [TextContent('Your message')])` or simply `Message('user', 'Your message')` if using string for simple text content).","cause":"The `text` parameter in the `Message` constructor was deprecated and then removed in later versions (specifically, around the 1.0.0 release).","error":"TypeError: Message constructor got an unexpected keyword argument 'text'"},{"fix":"Refer to the updated `agent-framework-core` documentation for the correct, non-aliased class names or replacement patterns for context and history providers.","cause":"Deprecated aliases like `BaseContextProvider` and `BaseHistoryProvider` were removed from `agent_framework.core` in version 1.0.0.","error":"ImportError: cannot import name 'BaseContextProvider' from 'agent_framework.core'"}]}