Skip to content

Commit 329e278

Browse files
edengilbertkapetrPetrBulanekpilartomasjezekra1
authored
Add blog post: How to Run a BeeAI Framework Agent as an A2A Server (#1513)
* Add blog post: How to Run a BeeAI Framework Agent as an A2A Server Signed-off-by: Eden Gilbert <[email protected]> * Finalize A2A Server blog post after preview edits Signed-off-by: Eden Gilbert <[email protected]> * Update a2a-server.mdx Updated based on gemini feedback Signed-off-by: Eden Gilbert <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * feat(ui): group trajectories (#1482) Signed-off-by: Petr Kadlec <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * fix(ui): proactive access_token refresh to avoid refresh race (#1501) Signed-off-by: Petr Kadlec <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * fix(ui): runtime envs and feature flags cleanup (#1479) Signed-off-by: Eden Gilbert <[email protected]> * feat(ui): render mermaid diagrams and latex syntax in markdown (#1488) Signed-off-by: Eden Gilbert <[email protected]> * feat(sdk): utilize platform auth in mcp extension (#1508) Signed-off-by: Tomas Pilar <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * feat(server): add user info endpoint (#1505) Signed-off-by: Radek Ježek <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * docs: remove redundant ToC from connectors guide (#1519) Signed-off-by: Jenna Winkler <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * fix(ui): array length checks (#1526) Signed-off-by: Eden Gilbert <[email protected]> * feat: initial implementation for connectors management in UI (#1443) * feat: initial implementation for connectors management in UI Signed-off-by: Tomas Weiss <[email protected]> * feat: connectors prep work Signed-off-by: Tomas Weiss <[email protected]> * feat: proper error handling Signed-off-by: Tomas Weiss <[email protected]> * fix: missing licence headers Signed-off-by: Tomas Weiss <[email protected]> * fix: imports Signed-off-by: Tomas Weiss <[email protected]> * fix: missing schema Signed-off-by: Tomas Weiss <[email protected]> * chore: post rebase adjustments Signed-off-by: Tomas Weiss <[email protected]> * fix: proper schema Signed-off-by: Tomas Weiss <[email protected]> * fix: code review comments Signed-off-by: Tomas Weiss <[email protected]> --------- Signed-off-by: Tomas Weiss <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * docs: update deployment guide (#1525) Signed-off-by: Eden Gilbert <[email protected]> * feat(ui): make 'add new agent' button admin only (#1527) Signed-off-by: Petr Kadlec <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * docs: overhaul (#1540) Signed-off-by: Tomas Weiss <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * feat(docs): add guide on connecting CLI to remote servers (#1541) Signed-off-by: Tomas Pilar <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * feat(server): refresh unmanaged agent cards (#1528) Signed-off-by: Aleš Kalfas <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * docs: minor changes (#1545) Signed-off-by: Matous Havlena <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * chore: docs workflow (#1502) * chore: docs workflow Signed-off-by: Tomas Weiss <[email protected]> * fix: better quoting Signed-off-by: Tomas Weiss <[email protected]> * fix: better git habndling Signed-off-by: Tomas Weiss <[email protected]> * chore: improve PR template Signed-off-by: Tomas Weiss <[email protected]> * chore: provide docs Signed-off-by: Tomas Weiss <[email protected]> --------- Signed-off-by: Tomas Weiss <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * chore: bump up uvicorn timeouts to 5s, make configurable (#1548) Signed-off-by: Matous Havlena <[email protected]> Signed-off-by: Jan Pokorný <[email protected]> Co-authored-by: Jan Pokorný <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * fix(server): connectors header forwading (#1553) Signed-off-by: Tomas Pilar <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * release: v0.4.2-rc1 Signed-off-by: Eden Gilbert <[email protected]> * docs: add explicit WSL instructions Signed-off-by: Jan Pokorný <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * fix: long operations inside transactions cause db connection exhaustion (#1549) Signed-off-by: Radek Ježek <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * ci: add missing mise.lock checksums Signed-off-by: Jan Pokorný <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * feat(agentstack-cli): clarify agent statuses (fixes #1535) Signed-off-by: Jan Pokorný <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * feat(agentstack-cli): redesign agentstack list output Fixes #1536 Signed-off-by: Jan Pokorný <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * docs(agentstack-cli): add custom help text (#1554) Signed-off-by: Eden Gilbert <[email protected]> * docs: improve WSL2 installation instructions Signed-off-by: Jan Pokorný <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * Update deployment-guide.mdx (#1573) Signed-off-by: Jenna Winkler <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * chore: fixing dead links in the docs (#1557) Signed-off-by: Tomas Weiss <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * refactor(web): use single framewok-diagram.svg file themeable with CSS variables (#1539) Signed-off-by: Eden Gilbert <[email protected]> * refactor(ui): rework Spinner component with CSS only animation, remove lottie-react (#1538) Signed-off-by: Eden Gilbert <[email protected]> * fix(agentstack-cli): properly react to misconfigured WSL2 Signed-off-by: Jan Pokorný <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * docs(agentstack-cli): clarify WSL install steps Signed-off-by: Jan Pokorný <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * feat(agentstack-cli): add `agentstack server switch` alias Signed-off-by: Jan Pokorný <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * feat(ui): remove links to docs and support (#1570) Signed-off-by: Eden Gilbert <[email protected]> * chore(ui): update "starting the agent" copy (#1571) Signed-off-by: Eden Gilbert <[email protected]> * fix(ui): messages being cut off on narrower screens (#1546) Signed-off-by: Eden Gilbert <[email protected]> * feat(ui): hide offline agents (#1434) Signed-off-by: Eden Gilbert <[email protected]> * feat(ui): render Markdown syntax inside trajectories (#1555) Signed-off-by: Eden Gilbert <[email protected]> * chore(server): add resource discovery root fallback to connectors (#1587) Signed-off-by: Tomas Pilar <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * feat(ui): update homepage and sidebar (#1512) Signed-off-by: Eden Gilbert <[email protected]> * chore: remove unnecessary __init__.py (#1494) Signed-off-by: Eden Gilbert <[email protected]> * fix(ui): replace trajectory group with latest content, add docs (#1523) Signed-off-by: Petr Kadlec <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * fix(ui): mute error toasts on session expiration (#1589) Signed-off-by: Petr Kadlec <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * fix: avoid setting up embeddings on RITS resolves #1578 Signed-off-by: Jan Pokorný <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * feat: update beeai-framework Signed-off-by: Tomas Dvorak <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * Update README.md (#1569) * Update README.md Add Radek's agent as reference Signed-off-by: Jenna Winkler <[email protected]> * Update README.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Jenna Winkler <[email protected]> * Update README.md * Update README.md * Update README.md Signed-off-by: Jenna Winkler <[email protected]> --------- Signed-off-by: Jenna Winkler <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Eden Gilbert <[email protected]> * docs: cleanup (#1586) * docs: updates Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Jenna Winkler <[email protected]> * Update docs/docs.json Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Jenna Winkler <[email protected]> * Update authenticate-cli-to-server.mdx Signed-off-by: Jenna Winkler <[email protected]> * Update README.md Signed-off-by: Jenna Winkler <[email protected]> * docs: updates --------- Signed-off-by: Jenna Winkler <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Eden Gilbert <[email protected]> * fix(helm): peroperly configure agent_registry.sync_period_cron Fixes #1211 Signed-off-by: Jan Pokorný <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * fix(tests): skip heavy docling e2e test (#1595) Signed-off-by: Radek Ježek <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * feat: add validation for agent import URL (#1544) Signed-off-by: Eden Gilbert <[email protected]> * feat(agentstack-cli): use better heuristics for determining for adding agents (#1603) Signed-off-by: Eden Gilbert <[email protected]> * feat(agentstack-cli): add server info and confirmations to CLI commands (#1590) Signed-off-by: Eden Gilbert <[email protected]> * feat(cli): add SingleSelect field support to forms (#1596) Signed-off-by: Petr Kadlec <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * fix(ui): display agent-generated images in response markdown (#1601) Signed-off-by: Petr Kadlec <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * feat(ui): render markdown in API error messages (#1593) Signed-off-by: Petr Kadlec <[email protected]> Signed-off-by: Petr Bulánek <[email protected]> Co-authored-by: Petr Bulánek <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * docs: add permissions and tokens page (#1576) Signed-off-by: Radek Ježek <[email protected]> Signed-off-by: Matous Havlena <[email protected]> Co-authored-by: Matous Havlena <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * fix(server): send proxy errors as a2a errors (#1594) Signed-off-by: Radek Ježek <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * fix(tests): use maximize disk space action (#1607) Signed-off-by: Radek Ježek <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * fix(tests): switch to custom model again (#1608) Signed-off-by: Radek Ježek <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * chore: form extension rework (#1481) Signed-off-by: Eden Gilbert <[email protected]> * fix(server): include redirect_uri into connector's token request (#1616) Signed-off-by: Tomas Pilar <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * feat: update beeai framework (#1611) Signed-off-by: Tomas Dvorak <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * fix(cli): agent info command missing auth (#1622) Signed-off-by: Radek Ježek <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * feat(ui): redo sidebar and homepage (#1610) Signed-off-by: Eden Gilbert <[email protected]> * feat: extending TS sdk (#1609) * feat: extending TS sdk Signed-off-by: Tomas Weiss <[email protected]> * fix: code review comments Signed-off-by: Tomas Weiss <[email protected]> * fix: remove GET from the callApi function, still keep the method for extensibility in the future Signed-off-by: Tomas Weiss <[email protected]> * chore: cleanup package.json Signed-off-by: Tomas Weiss <[email protected]> * chore: testing release pipeline Signed-off-by: Tomas Weiss <[email protected]> * chore: install mise Signed-off-by: Tomas Weiss <[email protected]> * fix: no git checks Signed-off-by: Tomas Weiss <[email protected]> * chore: setup release action Signed-off-by: Tomas Weiss <[email protected]> * fix: code review commnets Signed-off-by: Tomas Weiss <[email protected]> --------- Signed-off-by: Tomas Weiss <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * release: v0.4.2-rc2 Signed-off-by: Eden Gilbert <[email protected]> * fix(agents): add temporary fallback imports (#1624) Signed-off-by: Radek Ježek <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * release: v0.4.2-rc3 Signed-off-by: Eden Gilbert <[email protected]> * chore: update release sdk to npm instead of pnpm Signed-off-by: Tomas Weiss <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * release: v0.4.2-rc4 Signed-off-by: Eden Gilbert <[email protected]> * chore: update npm for release Signed-off-by: Tomas Weiss <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * release: v0.4.2-rc5 Signed-off-by: Eden Gilbert <[email protected]> * chore: add release tag for npm Signed-off-by: Tomas Weiss <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * release: v0.4.2-rc6 Signed-off-by: Eden Gilbert <[email protected]> * chore: missing repository Signed-off-by: Tomas Weiss <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> * release: v0.4.2-rc7 Signed-off-by: Eden Gilbert <[email protected]> * chore: run mise fix Signed-off-by: Eden Gilbert <[email protected]> --------- Signed-off-by: Eden Gilbert <[email protected]> Signed-off-by: Eden Gilbert <[email protected]> Signed-off-by: Petr Kadlec <[email protected]> Signed-off-by: Tomas Pilar <[email protected]> Signed-off-by: Radek Ježek <[email protected]> Signed-off-by: Jenna Winkler <[email protected]> Signed-off-by: Tomas Weiss <[email protected]> Signed-off-by: Aleš Kalfas <[email protected]> Signed-off-by: Matous Havlena <[email protected]> Signed-off-by: Jan Pokorný <[email protected]> Signed-off-by: Tomas Dvorak <[email protected]> Signed-off-by: Petr Bulánek <[email protected]> Co-authored-by: Petr Kadlec <[email protected]> Co-authored-by: Petr Bulánek <[email protected]> Co-authored-by: Tomas Pilar <[email protected]> Co-authored-by: Radek Ježek <[email protected]> Co-authored-by: Jenna Winkler <[email protected]> Co-authored-by: Tomáš Weiss <[email protected]> Co-authored-by: Aleš Kalfas <[email protected]> Co-authored-by: Matous Havlena <[email protected]> Co-authored-by: Jan Pokorný <[email protected]> Co-authored-by: Arun Babu Neelicattu <[email protected]> Co-authored-by: Tomas Dvorak <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 5cb5e0f commit 329e278

File tree

2 files changed

+161
-1
lines changed

2 files changed

+161
-1
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,4 @@ jobs:
160160

161161
- name: Publish TS SDK
162162
working-directory: apps/agentstack-sdk-ts
163-
run: npm publish --tag ${{ steps.version.outputs.npmTag }}
163+
run: npm publish --tag ${{ steps.version.outputs.npmTag }}
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
export const metadata = {
2+
title: 'How to Run a BeeAI Framework Agent as an A2A Server',
3+
date: '2025-11-10',
4+
author: 'Eden Gilbert, Ken Ocheltree',
5+
};
6+
7+
The [BeeAI Framework](https://framework.beeai.dev/introduction/welcome) provides native support for the Agent2Agent
8+
(A2A) Protocol, enabling you to build distributed multi-agent systems where different AI agents can communicate
9+
regardless of how or where they're deployed. In this guide, we'll walk through creating a BeeAI agent as an A2A server
10+
and how to connect to it from a client.
11+
12+
## Understanding Agent2Agent (A2A) Communication
13+
14+
AI agents in production require reusable capabilities that work across repositories, languages, and teams. The
15+
[Agent2Agent (A2A) Protocol](https://a2a-protocol.org/latest/) is a new standard for agent-to-agent communication,
16+
allowing different AI agents to interact no matter their original framework or implementation details. RPC (Remote
17+
Procedure Call) is the backbone of A2A: it lets one agent ask another to “run this function and give me the result” or
18+
hand off a task to another agent. BeeAI wraps this in a simple API, so your agent can expose or consume capabilities
19+
without having to worry about the networking details of the A2A protocol. With this, you get modular services from
20+
different specialized agents with clean handoffs and easy scaling. The BeeAI Framework is A2A Native with the ability to
21+
interoperate with any A2A agent system, providing built-in support without complex setup.
22+
23+
### What A2A solves
24+
25+
- **Interoperability:** enables agents to communicate across frameworks/runtimes without custom SDKs
26+
27+
- **Reuse & separation of concerns:** turns capabilities into a service that other agents can call
28+
29+
- **Cost & performance:** specializes agents and models per task, calls the right one on demand
30+
31+
- **Reliability:** RPC contracts make the behavior predictable and debuggable
32+
33+
### When to run an A2A server, client, or both
34+
35+
- **Server:** when exposing a capability for others (eg: “FormatterService” that normalizes or transforms text).
36+
37+
- **Client:** you need to call other agents/services as part of your workflow (eg: an “Author” agent that asks a
38+
“Formatter” agent to clean output).
39+
40+
- **Both:** your agent is reusable as a service and also calls other agents as a service
41+
42+
In this blog, we’ll build a small **FormatterService** (the server) and a **Writer** (the client) so you can see the
43+
end-to-end process.
44+
45+
## Getting started
46+
47+
### Prerequisites
48+
49+
- Python 3.10+
50+
- ollama installed with granite3.3:8b running
51+
- uv installed
52+
53+
In a new project folder, create a virtual environment and install the BeeAI Framework with A2A extras:
54+
55+
```bash
56+
uv init
57+
uv add 'beeai-framework[a2a]'
58+
```
59+
60+
Open the new project in your IDE.
61+
62+
## Step 1: Build the Server’s Agent Logic and Expose the Agent as an A2A Server
63+
64+
Create a new file called **a2a_server.py** that wraps a single agent and makes it available over HTTP as an A2AServer.
65+
66+
```python
67+
# a2a_server.py
68+
from beeai_framework.adapters.a2a import A2AServer, A2AServerConfig
69+
from beeai_framework.agents.requirement import RequirementAgent
70+
from beeai_framework.backend import ChatModel
71+
from beeai_framework.memory import UnconstrainedMemory
72+
from beeai_framework.serve.utils import LRUMemoryManager
73+
74+
def main() -> None:
75+
llm = ChatModel.from_name("ollama:granite3.3:8b")
76+
agent = RequirementAgent(
77+
llm=llm,
78+
memory=UnconstrainedMemory(),
79+
instructions="You are an agent that reverses text input. Reverse the user's input exactly.",
80+
)
81+
82+
# Register the agent with the A2A server and run the HTTP server
83+
A2AServer(
84+
config=A2AServerConfig(port=9999, protocol="jsonrpc"),
85+
memory_manager=LRUMemoryManager(maxsize=100)
86+
).register(agent, send_trajectory=True).serve()
87+
88+
if __name__ == "__main__":
89+
main()
90+
```
91+
92+
## Step 2: Running the Server
93+
94+
Start your agent service from your terminal.
95+
96+
```bash
97+
uv run a2a_server.py
98+
```
99+
100+
Your BeeAI agent is now exposed at [http://localhost:9999](http://localhost:9999). Your computer may request to allow
101+
the port to show the service on your localhost.
102+
103+
## Step 3: Call the Agent from a Client
104+
105+
Save this simple python client as **a2a_client.py**:
106+
107+
```python
108+
# a2a_client.py
109+
import asyncio
110+
from beeai_framework.adapters.a2a.agents import A2AAgent
111+
from beeai_framework.memory.unconstrained_memory import UnconstrainedMemory
112+
async def main() -> None:
113+
114+
agent = A2AAgent(url="http://127.0.0.1:9999", memory=UnconstrainedMemory())
115+
116+
# Send a message
117+
text = input("Enter input: ")
118+
response = await agent.run(text)
119+
120+
# Print the response
121+
print("Agent response:", response.last_message.text)
122+
123+
if __name__ == "__main__":
124+
asyncio.run(main())
125+
```
126+
127+
Any client on your computer (another agent, application, or a script) can call your agent over A2A.
128+
129+
Note: If you had served your agent over a non-local IP address and allowed access on that port, that agent could be
130+
accessed by agents on other computers on your network. Caution is advised on making agents available beyond the
131+
localhost.
132+
133+
The client is run by invoking it in a separate terminal:
134+
135+
```bash
136+
uv run a2a_client.py
137+
```
138+
139+
The client agent dialog appears as follows:
140+
141+
```python
142+
Enter input: Hello World
143+
Agent response: dlroW olleH
144+
```
145+
146+
How It Works
147+
148+
- A2AServer: Hosts a single BeeAI agent and makes it reachable on the same computer over HTTP.
149+
150+
- A2AAgent (client): Sends a request to that server and receives the agent's response.
151+
152+
- One agent per server: Keeps each service focused on one singular capability
153+
154+
## Conclusion
155+
156+
The A2A protocol makes it simple to turn a BeeAI agent into a service that other agents can call. With just a few lines
157+
of Python, you can expose your agent over HTTP and begin composing multi-agent workflows, an essential step toward
158+
building scalable, modular agent ecosystems. Get up and running with BeeAI Framework lighting-fast with the
159+
[quickstart](https://framework.beeai.dev/introduction/quickstart) or go deep on all the capabilities by taking the
160+
[grand tour](https://framework.beeai.dev/introduction/tour). Happy building!

0 commit comments

Comments
 (0)