{"id":6500,"library":"agent-framework-devui","title":"DevUI for Microsoft Agent Framework","description":"agent-framework-devui is a lightweight, standalone sample application providing a debug UI for the Microsoft Agent Framework. It offers an OpenAI-compatible API server for running and testing AI agents and workflows, supporting directory-based discovery, in-memory entity registration, and a gallery of sample entities. It also includes an OpenAI Proxy feature, enabling direct testing of OpenAI models via the interface while keeping API keys secure on the server. Primarily designed as an 'inner-loop' developer tool, it visualizes agent execution, including reasoning, actions, and observations.","status":"active","version":"1.0.0b260409","language":"en","source_language":"en","source_url":"https://github.com/microsoft/agent-framework","tags":["agent framework","debug ui","ai agents","microsoft","openai api","workflow","developer tools","observability"],"install":[{"cmd":"pip install agent-framework-devui --pre","lang":"bash","label":"Install pre-release version"}],"dependencies":[{"reason":"Core framework for which DevUI provides a user interface.","package":"agent-framework","optional":false},{"reason":"Required for interacting with OpenAI-compatible APIs and clients used by agents.","package":"openai","optional":true}],"imports":[{"note":"Main function to launch the DevUI.","symbol":"serve","correct":"from agent_framework.devui import serve"},{"note":"Class for defining AI agents within the framework.","symbol":"Agent","correct":"from agent_framework import Agent"},{"note":"Client for connecting agents to OpenAI-compatible chat models.","symbol":"OpenAIChatClient","correct":"from agent_framework.openai import OpenAIChatClient"}],"quickstart":{"code":"import os\nfrom agent_framework import Agent\nfrom agent_framework.openai import OpenAIChatClient\nfrom agent_framework.devui import serve\n\n# NOTE: Set OPENAI_API_KEY environment variable for actual API calls\n# Example for a simple tool\ndef get_weather(location: str) -> str:\n    \"\"\"Get weather for a location.\"\"\"\n    return f\"Weather in {location}: 72°F and sunny\"\n\n# Create your agent\nagent = Agent(\n    name=\"WeatherAgent\",\n    client=OpenAIChatClient(api_key=os.environ.get('OPENAI_API_KEY', '')) if os.environ.get('OPENAI_API_KEY') else None, # Pass API key if available\n    tools=[get_weather]\n)\n\n# Launch debug UI - this opens a browser to http://localhost:8080\nprint(\"Launching DevUI... access at http://localhost:8080\")\nserve(entities=[agent], auto_open=True)","lang":"python","description":"This quickstart demonstrates how to define a simple agent with a tool and then launch the DevUI to interact with it. The `serve` function starts the web UI and API server, making the agent accessible for testing and debugging in a browser. Ensure `OPENAI_API_KEY` is set as an environment variable if you intend for the agent to use an actual OpenAI client."},"warnings":[{"fix":"Refer to the official GitHub repository (microsoft/agent-framework) for the latest API changes and consider installing directly from source for the most up-to-date features, or pin to a specific pre-release version.","message":"The Microsoft Agent Framework, including DevUI, is currently in a development/preview stage. APIs and features are subject to frequent changes, and building from source is sometimes recommended over pre-release packages to ensure the latest updates.","severity":"breaking","affected_versions":"All 1.x.x pre-release versions"},{"fix":"For production environments or advanced features, it is recommended to build a custom interface and API server using the core Agent Framework SDK.","message":"DevUI is explicitly stated as a 'sample app' and 'not intended for production use.' Its primary purpose is for local development, testing, and debugging of agents and workflows within the Agent Framework, rather than deployment.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Set `OPENAI_API_KEY` (or `GITHUB_TOKEN`) as an environment variable in your development environment before launching DevUI or the agent application.","message":"When using DevUI's OpenAI Proxy feature or agents that interact with OpenAI-compatible clients (like `OpenAIChatClient`), an `OPENAI_API_KEY` (or a `GITHUB_TOKEN` for GitHub Models) must be configured as an environment variable on the backend for proper authentication.","severity":"gotcha","affected_versions":"All versions"},{"fix":"When integrating MCP tools with agents intended for DevUI, ensure that `async with` is not used in their definition or interaction logic.","message":"A specific architectural consideration for developers is to avoid using `async with` context managers when creating agents with Model Context Protocol (MCP) tools for DevUI.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always include the `--pre` flag during `pip install` to ensure the package is found and installed correctly. Omission may result in 'No matching distribution found' errors.","message":"Due to its pre-release status, installation of `agent-framework-devui` typically requires the `--pre` flag with pip (e.g., `pip install agent-framework-devui --pre`) to access the latest beta versions.","severity":"gotcha","affected_versions":"All 1.x.x pre-release versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[{"fix":"Install the package using pip: 'pip install agent-framework'.","cause":"The 'agent_framework' package is not installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'agent_framework'"},{"fix":"Ensure you are using the correct version of 'agent-framework-devui' and check the module's documentation for the correct import statement.","cause":"The 'DevServer' class is not available in the 'agent_framework.devui' module, possibly due to version incompatibility or incorrect import.","error":"ImportError: cannot import name 'DevServer' from 'agent_framework.devui'"},{"fix":"Verify the module's documentation for the correct usage of the 'serve' function and ensure compatibility with your version.","cause":"The 'serve' function is not defined in the 'agent_framework' module, possibly due to incorrect usage or version mismatch.","error":"AttributeError: module 'agent_framework' has no attribute 'serve'"},{"fix":"Review the function's signature in the module's documentation and update your code accordingly.","cause":"The 'serve' function does not accept 'entities_dir' as a keyword argument, indicating a possible API change or incorrect usage.","error":"TypeError: serve() got an unexpected keyword argument 'entities_dir'"},{"fix":"Ensure the directory structure follows the required format with '__init__.py' files exporting 'agent' or 'workflow' variables as per the documentation.","cause":"The specified directory does not contain any valid agents or workflows for discovery.","error":"ValueError: No entities found in the specified directory"}]}