{"id":27790829,"url":"https://github.com/imfangs/a2a4j","last_synced_at":"2026-04-25T12:36:04.979Z","repository":{"id":290032484,"uuid":"973163666","full_name":"imfangs/a2a4j","owner":"imfangs","description":"A2A-4J is a Java implementation of the Agent-to-Agent (A2A) protocol. The A2A protocol facilitates standardized communication between AI agents, enabling them to exchange tasks, messages, and artifacts.","archived":false,"fork":false,"pushed_at":"2025-04-26T12:13:11.000Z","size":66,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-04-25T12:36:02.764Z","etag":null,"topics":["a2a","a2a-protocol","agents","ai","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imfangs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-26T11:58:12.000Z","updated_at":"2025-07-11T10:19:42.000Z","dependencies_parsed_at":"2025-04-26T13:23:37.695Z","dependency_job_id":"05311e3e-4b24-4fe3-af4c-4c528102aa1e","html_url":"https://github.com/imfangs/a2a4j","commit_stats":null,"previous_names":["imfangs/a2a4j"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/imfangs/a2a4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imfangs%2Fa2a4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imfangs%2Fa2a4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imfangs%2Fa2a4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imfangs%2Fa2a4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imfangs","download_url":"https://codeload.github.com/imfangs/a2a4j/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imfangs%2Fa2a4j/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32262801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a2a","a2a-protocol","agents","ai","java"],"created_at":"2025-04-30T18:45:57.116Z","updated_at":"2026-04-25T12:36:04.959Z","avatar_url":"https://github.com/imfangs.png","language":"Java","funding_links":[],"categories":["Server Implementations"],"sub_categories":["🌐 General Purpose Implementations"],"readme":"# A2A-4J: Java Implementation of Agent-to-Agent Protocol\n\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) \u003c!-- TODO: Add other badges (build status, coverage, maven central) --\u003e\n\n## Overview\n\nA2A-4J is a Java implementation of the Agent-to-Agent (A2A) protocol. The A2A protocol facilitates standardized communication between AI agents, enabling them to exchange tasks, messages, and artifacts.\n\nThis project provides a high-quality, production-ready Java library leveraging the Spring ecosystem (Spring Boot 3.x).\n\n**Core Features:**\n*   Complete implementation of the A2A protocol specification.\n*   Server implementation using Spring WebFlux/MVC.\n*   Reactive and Blocking Client implementations.\n*   Support for task streaming (Server-Sent Events).\n*   Pluggable storage options (In-memory, Redis).\n*   OpenAPI documentation generation.\n\n## Quick Start\n\n\u003c!-- TODO: Add concise Maven/Gradle dependency snippets --\u003e\n\n**Example: Basic Server Setup**\n```java\n// 1. Define a TaskHandler (e.g., using BasicTaskHandler)\nTaskHandler taskHandler = new BasicTaskHandler(message -\u003e \n    \"Hello back! You said: \" + BasicTaskHandler.getMessageContent(message)\n);\n\n// 2. Create a TaskManager\nTaskManager taskManager = new BasicTaskManager(taskHandler);\n\n// 3. Define AgentCard (metadata for your agent)\nAgentCard agentCard = AgentCard.builder()\n    .name(\"My Simple Agent\")\n    .description(\"A basic A2A-4J Agent\")\n    .capabilities(new Capabilities()) // Use default capabilities\n    .build();\n\n// 4. Get the Spring ApplicationContext\n// (Assuming you are in a Spring Boot application)\nApplicationContext context = ... ; \n\n// 5. Create and start the A2A Server\nA2AServer server = new A2AServer(\n    \"/\", // Base path for A2A endpoints\n    agentCard,\n    taskManager,\n    context\n);\nserver.start(false); // Start in foreground\n\nSystem.out.println(\"A2A Server running on port 8080 (default)\");\n```\n\n**Example: Basic Client Usage**\n```java\n// 1. Create an A2AClient instance\nA2AClient client = A2AClientImpl.builder()\n    .baseUrl(\"http://localhost:8080\") // URL of the target A2A server\n    .build();\n\n// 2. Get the server's AgentCard (optional, good for verification)\nAgentCard remoteAgentCard = client.getAgentCard().block();\nSystem.out.println(\"Connected to: \" + remoteAgentCard.getName());\n\n// 3. Create a message to send\nMessage userMessage = new Message(Role.USER, \"Hi Agent!\");\n\n// 4. Send the task (blocking example)\nSendTaskResponse response = client.sendTask(\n    userMessage,\n    \"my-task-id-1\",   // Unique Task ID\n    \"my-session-id\", // Optional Session ID\n    10,             // Optional priority\n    \"my-request-id\" // Optional request ID\n).block();\n\n// 5. Process the response\nif (response != null \u0026\u0026 response.getResult() != null) {\n    Task resultTask = response.getResult();\n    System.out.println(\"Task completed. Result: \" + resultTask);\n    // Access artifacts, status, etc. from resultTask\n} else if (response != null \u0026\u0026 response.getError() != null) {\n    System.err.println(\"A2A Error: \" + response.getError().getMessage());\n} else {\n    System.err.println(\"No response received or unexpected error.\");\n}\n\n// 6. Close the client when done\nclient.close();\n```\n\nFor more detailed examples, please see the `a2a4j-examples` module.\n\n### Storage\n\nThe server supports pluggable storage for tasks:\n*   **In-Memory:** Default, suitable for testing and development.\n*   **Redis:** Requires Redis configuration (See `a2a4j-storage-redis`).\n\n\u003c!-- TODO: Explain how to select/configure storage --\u003e\n\n## Project Structure\n\nThe project is organized into the following Maven modules:\n\n*   `a2a4j-models`: Core data models defined by the A2A protocol schema.\n*   `a2a4j-server`: Server implementation (controllers, task management, storage interface).\n*   `a2a4j-client`: Client implementation for interacting with A2A servers.\n*   `a2a4j-storage-redis`: Redis-based storage implementation.\n*   `a2a4j-spring-boot-starter`: Spring Boot auto-configuration and starter.\n*   `a2a4j-examples`: Usage examples.\n\n## Contributing\n\nContributions are welcome! Please feel free to:\n*   Report bugs and suggest features\n*   Set up your development environment\n*   Submit pull requests\n*   Adhere to code style\n\n## License\n\nThis project is licensed under the Apache License 2.0. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimfangs%2Fa2a4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimfangs%2Fa2a4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimfangs%2Fa2a4j/lists"}