Registry / llm-agents / agent-framework-ag-ui

agent-framework-ag-ui

JSON →
library1.0.0b260409pypiunverified

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.

llm-agentsweb-frameworkcommunication
pip install agent-framework-ag-ui
Install & Compatibility
Where this runs
tested against v1.0.0rc4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 6.35s
py 3.11
✓ —
✓ 5.5s
py 3.12
✓ —
✓ 4.7s
py 3.13
✓ —
✓ 4.75s
py 3.9
✕ build_error
✕ build_error
57MB installed
● package 57MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AgUiServer
from agent_framework_ag_ui.server import AgUiServer
AgUiAgent
from agent_framework_ag_ui.agent import AgUiAgent

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.

import asyncio from agent_framework.agent import Agent from agent_framework.storage import InMemoryStorage from agent_framework_ag_ui.server import AgUiServer class MySimpleAgent(Agent): def __init__(self, name, storage): super().__init__(name, storage) async def handle_message(self, message): print(f"MySimpleAgent received message from UI: {message.content}") # Example: Reply to the UI await self.send_message(message.create_reply("Acknowledged from agent!")) async def main(): # Setup core agent-framework components storage = InMemoryStorage() agent = MySimpleAgent("MyTestAgent", storage) # Initialize the AG-UI server ag_ui_server = AgUiServer(host="127.0.0.1", port=8000) # Register the core agent with the AG-UI server to expose it to the UI await ag_ui_server.register_agent(agent) print(f"AG-UI Server starting on ws://127.0.0.1:8000. Connect a UI to interact.") print("Press Ctrl+C to stop.") await ag_ui_server.run() # This will block and run the server if __name__ == "__main__": try: asyncio.run(main()) except KeyboardInterrupt: print("\nServer stopped.")
Debug
Known issues
breakingThis 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.
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`.
affects: 1.0.0b*
gotchaThis 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.
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`.
affects: all
gotchaThe `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.
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`.
affects: all
gotchaThis 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.
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.
affects: all
Upgrade
Version history
1.0.0rc4latest on PyPI
Audit
Dependencies
agent-frameworkrequiredCore framework this library integrates with.
Agent activity
91 hits · last 30 days
node
14
claudebot
4
ahrefsbot
3
amazonbot
1
Resources

No resource links recorded.