{"id":14404,"library":"agent-framework-ag-ui","title":"Agent Framework AG-UI Integration","description":"This library provides integration for the Agent Framework with the AG-UI protocol, enabling agents to communicate with AG-UI compliant frontends. It's currently in beta (1.0.0b260409) and offers components to bridge `agent-framework` agents to the AG-UI ecosystem. The project aims to facilitate the development of interactive AI agents with standardized UI interfaces.","status":"active","version":"1.0.0b260409","language":"en","source_language":"en","source_url":"https://github.com/ag-ui/agent-framework-ag-ui","tags":["agent","framework","AI","AGI","UI","websocket","protocol","async"],"install":[{"cmd":"pip install agent-framework-ag-ui","lang":"bash","label":"Install latest beta"}],"dependencies":[{"reason":"Core framework this library integrates with.","package":"agent-framework","optional":false}],"imports":[{"symbol":"AgUiServer","correct":"from agent_framework_ag_ui.server import AgUiServer"},{"symbol":"AgUiAgent","correct":"from agent_framework_ag_ui.agent import AgUiAgent"}],"quickstart":{"code":"import asyncio\nfrom agent_framework.agent import Agent\nfrom agent_framework.storage import InMemoryStorage\nfrom agent_framework_ag_ui.server import AgUiServer\n\nclass MySimpleAgent(Agent):\n    def __init__(self, name, storage):\n        super().__init__(name, storage)\n\n    async def handle_message(self, message):\n        print(f\"MySimpleAgent received message from UI: {message.content}\")\n        # Example: Reply to the UI\n        await self.send_message(message.create_reply(\"Acknowledged from agent!\"))\n\nasync def main():\n    # Setup core agent-framework components\n    storage = InMemoryStorage()\n    agent = MySimpleAgent(\"MyTestAgent\", storage)\n\n    # Initialize the AG-UI server\n    ag_ui_server = AgUiServer(host=\"127.0.0.1\", port=8000)\n\n    # Register the core agent with the AG-UI server to expose it to the UI\n    await ag_ui_server.register_agent(agent)\n\n    print(f\"AG-UI Server starting on ws://127.0.0.1:8000. Connect a UI to interact.\")\n    print(\"Press Ctrl+C to stop.\")\n    await ag_ui_server.run() # This will block and run the server\n\nif __name__ == \"__main__\":\n    try:\n        asyncio.run(main())\n    except KeyboardInterrupt:\n        print(\"\\nServer stopped.\")","lang":"python","description":"Sets up an `AgUiServer` to expose a basic `agent-framework` agent via the AG-UI WebSocket protocol. This allows AG-UI compatible frontends to connect and interact with the agent. The example includes a simple `agent-framework` agent that replies to received messages."},"warnings":[{"fix":"Monitor project releases closely. Expect potential breaking changes in minor/patch versions during beta. Pin exact beta versions for stability using `pip install agent-framework-ag-ui==1.0.0b260409`.","message":"This library is currently in beta. APIs and internal implementations are subject to change without strict backward compatibility guarantees. The core `agent-framework` it depends on is also under active development.","severity":"breaking","affected_versions":"1.0.0b*"},{"fix":"Ensure `agent-framework` is installed (`pip install agent-framework`) and review its documentation for core agent concepts (e.g., `Agent`, `Storage`, `Message`) before using `agent-framework-ag-ui`.","message":"This library is an *integration* for `agent-framework`. It does not provide the core agent capabilities itself. Users must understand and implement `agent-framework` agents to effectively use this integration.","severity":"gotcha","affected_versions":"all"},{"fix":"Always run the server and agent logic within an `asyncio` event loop (e.g., `asyncio.run(main())`). All functions interacting with the library typically need to be `async def` and calls to library methods require `await`.","message":"The `agent-framework` ecosystem, including `agent-framework-ag-ui`, is entirely asynchronous. All interactions and server operations are `async`/`await` based, requiring an `asyncio` event loop.","severity":"gotcha","affected_versions":"all"},{"fix":"Consult the AG-UI protocol specification or example UI implementations to understand how to interact with the exposed WebSocket endpoint and what messages to send/expect.","message":"This library implements the AG-UI protocol. Effective use requires understanding the protocol's message types and interaction patterns for building compatible UIs or connecting to existing AG-UI frontends.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[],"ecosystem":"pypi"}