Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ovos-a2a-solver-plugin

An OVOS ChatEngine plugin. It lets an ovos-persona send its reasoning to an external agent that speaks the Agent2Agent (A2A) protocol.

This plugin implements the consumer side of OpenVoiceOS/ovos-persona#164.


What is A2A?

Agent2Agent (A2A) is an open protocol. It lets software agents work together no matter how each one is built inside. An A2A-compliant server does three things:

  1. It exposes a discovery document at GET /.well-known/agent.json (the agent card). This card describes the server's identity and its skills and capabilities.
  2. It accepts tasks at its root URL as JSON-RPC 2.0 requests (tasks/send for a blocking call, tasks/sendSubscribe for SSE streaming).
  3. It returns structured responses with typed artifact parts: text, file, or data.

This plugin implements only the client (consumer) side. It calls remote A2A agents from inside an OVOS persona.


Installation

pip install ovos-a2a-solver-plugin

This plugin needs Python 3.10 or later, and ovos-plugin-manager >= 2.3.0a1.


Configuration

Add the plugin as the engine for an ovos-persona persona:

# ~/.config/mycroft/personas/my-a2a-persona.yaml
name: my-a2a-persona
engine: ovos-a2a-solver
engine_config:
  agent_url: "https://my-a2a-agent.example.com"   # required
  auth_header: "Bearer <token>"                    # optional
  timeout: 60                                      # seconds (default 60)
  streaming: false                                 # set true to use SSE streaming
Key Type Default Description
agent_url str (none) Required. Root URL of the A2A server.
auth_header str None Full Authorization header value, for example Bearer <token>.
Key Type Default Description
timeout float 60 HTTP timeout in seconds.
streaming bool False Use tasks/sendSubscribe (SSE) instead of the blocking tasks/send. The server must advertise capabilities.streaming: true.

Persona wiring example

from ovos_persona import PersonaService
# PersonaService loads persona YAML files automatically.
# Once the plugin is installed, setting engine: ovos-a2a-solver in the
# persona YAML is all that is needed.
svc = PersonaService(config={})
reply = svc.chat("What is the capital of Portugal?", persona="my-a2a-persona")
print(reply)  # "Lisbon."

You can also use the engine directly:

from ovos_a2a_solver import A2AChatEngine
from ovos_plugin_manager.templates.agents import AgentMessage, MessageRole

engine = A2AChatEngine(config={
    "agent_url": "https://my-a2a-agent.example.com",
})

messages = [
    AgentMessage(role=MessageRole.SYSTEM, content="You are a helpful assistant."),
    AgentMessage(role=MessageRole.USER, content="Hello!"),
]
reply = engine.continue_chat(messages)
print(reply.content)

For streaming:

engine = A2AChatEngine(config={
    "agent_url": "https://my-a2a-agent.example.com",
    "streaming": True,
})

for chunk in engine.stream_tokens(messages):
    print(chunk, end="", flush=True)

A2AClient (low-level usage)

Use the A2AClient class on its own, without OPM:

from ovos_a2a_solver import A2AClient

with A2AClient("https://my-a2a-agent.example.com") as client:
    card = client.fetch_agent_card()
    print(card.name, card.skills)

    answer = client.send_task(
        "Summarise the A2A spec in one sentence.",
        session_id="my-session",
    )
    print(answer)

Protocol notes

Agent-card discovery

On __init__ the engine fetches GET {agent_url}/.well-known/agent.json and logs the agent's name. A failure here is not fatal. The engine continues and still attempts tasks. This matters when the card endpoint sits behind auth.

Message history

The OVOS ChatEngine receives the full conversation list. The plugin maps it to A2A history as follows:

OVOS role A2A mapping
system Injected as the first user-role history turn (A2A has no system role)
user user history turns. The last user message becomes the task message
assistant assistant history turns

Streaming

When streaming: true, the plugin calls tasks/sendSubscribe and yields text chunks over SSE. If the server's agent card reports capabilities.streaming: false, the plugin falls back to the blocking tasks/send and logs a warning.


Development

git clone https://github.com/TigreGotico/ovos-a2a-solver-plugin
cd ovos-a2a-solver-plugin
pip install -e ".[test]"
pytest test/ -v


Credits

Developed by TigreGótico for OpenVoiceOS.

NGI0 Commons Fund

This project was funded through the NGI0 Commons Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101135429.


License

Apache License 2.0. See LICENSE.

Metadata

Release files for ovos-a2a-solver-plugin 0.0.2a3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ovos-a2a-solver-plugin 0.0.2a3
File Size Uploaded Provenance
ovos_a2a_solver_plugin-0.0.2a3.tar.gz 20.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ovos-a2a-solver-plugin 0.0.2a3
File Interpreter ABI Platform
ovos_a2a_solver_plugin-0.0.2a3-py3-none-any.whl Python 3 none any Details

Total release size: 36.6 kB

Release files / ovos_a2a_solver_plugin-0.0.2a3.tar.gz

Download URL ovos_a2a_solver_plugin-0.0.2a3.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
76fe9a45976cab050a77d8001e080058aa0de8ecfce767b43233b34d097c8c58
BLAKE2b-256 checksum
How to use checksums
7e09aa8c291c88783afd24f10bcb7f36a62c572f0eb6df4cb534105ba306e3a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ovos_a2a_solver_plugin-0.0.2a3-py3-none-any.whl

Download URL ovos_a2a_solver_plugin-0.0.2a3-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97741789ef5620f6c97e7e28a099166fb2672318fd10c8af03f077145dd1cbf4
BLAKE2b-256 checksum
How to use checksums
a72c552a2e264b0007a8e7b14c5b8f39b58f207ff41fbb5d540927156ea18790
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for ovos-a2a-solver-plugin 0.0.2a3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page