Download the PHP package neuron-core/a2a without Composer
On this page you can find all versions of the php package neuron-core/a2a. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package a2a
A2A PHP Server
A framework-agnostic PHP implementation of the A2A (Agent-to-Agent) Protocol that enables AI agents to communicate and collaborate across different platforms, frameworks, and organizations.
Table of Contents
- Introduction
- Features
- Quick Start
- Standalone Usage
- Laravel Integration
- Core Concepts
- API Reference
- Advanced Usage
Introduction
The A2A (Agent-to-Agent) Protocol is an open standard that enables seamless communication and collaboration between AI agents. It provides a common language for agents built using diverse frameworks and by different vendors, fostering interoperability and breaking down silos.
Official Specification: https://a2a-protocol.org/latest/specification/
What This Library Provides
- ✅ Complete A2A Protocol Implementation - JSON-RPC 2.0 over HTTP
- ✅ Multi-Agent Architecture-Host multiple specialized agents in one application
Features
Supported A2A Methods
- ✅
message/send- Send messages and receive agent responses - ✅
tasks/get- Retrieve a specific task by ID - ✅
tasks/list- List tasks with filtering and pagination - ✅
tasks/cancel- Cancel a running task - ✅
agent/getAuthenticatedExtendedCard- Get agent capabilities
Framework Support
- ✅ Laravel—Full integration with Artisan commands and routes
- ✅ Standalone - Framework-agnostic HTTP interfaces
- 🔄 Other Frameworks—Easy to add adapters (Symfony, Slim, etc.)
Quick Start
Standalone Usage
1. Create Your Agent Server
You can create your own server class extending NeuronCore\A2A\A2AServer. This class provides the main entry point to
expose your AI agent to the world. You need to implement two components to create a server:
- Task Repository - Store and retrieve tasks
- Message Handler - Handle messages and return task results
2. Implement Task Repository
3. Implement Message Handler (Your AI Logic)
The message handler is responsible for handling incoming messages and returning task results. It's the place where you execute your AI Agent and return the results.
4. Use the Server
See examples/a2a.php for a complete working example.
Laravel Integration
Laravel gets first-class support with Artisan commands, service providers, and routing helpers.
1. Register Service Provider
In config/app.php or bootstrap/providers.php based on your project structure:
2. Generate an Agent server
This generates:
app/A2A/DataAnalystServer.php- Main serverapp/A2A/DataAnalystTaskRepository.php- Task storageapp/A2A/DataAnalystMessageHandler.php- AI logic
You must implement the Task Repository and Message Handler.
4. Register Routes
In routes/api.php:
Done! Your agent is live at:
POST /a2a/data-analyst- JSON-RPC endpointGET /a2a/data-analyst/.well-known/agent-card.json- Agent card
Multiple Agents
Create and register as many agents as needed:
Each agent is completely independent with its own:
- Task repository
- Message handler (AI logic)
- Middleware configuration
Core Concepts
Message Structure
Messages follow the A2A protocol:
Agent Card
The agent card is a JSON manifest that describes:
- Agent identity (name, description, version)
- Provider information
- Available skills with examples
- Input/output formats
- Authentication requirements
- Protocol capabilities
Task Context
Tasks can be grouped by contextId for conversation continuity:
- Multiple tasks can share the same context
- Use
tasks/listwithcontextIdfilter to retrieve related tasks - Useful for multi-turn conversations
API Reference
A2AServer Abstract Class
Abstract Methods:
Public Methods:
TaskRepositoryInterface
MessageHandlerInterface
Advanced Usage
Custom Task Repository
Use Eloquent, Redis, File, or any storage backend:
Authentication & Middleware
Laravel example with custom middleware:
File Attachments
Handle file uploads in messages:
Structured Data
Send and receive structured JSON data:
Contributing
When contributing to this project:
- Use modern PHP 8.1+ features
- Maintain interface-driven design
- Write minimal, clean code
- Focus on simplicity and clarity
License
MIT License—See LICENSE file for details