{"id":50094802,"url":"https://github.com/redis-developer/a2a-redis","last_synced_at":"2026-05-23T02:35:48.232Z","repository":{"id":307748588,"uuid":"1028681615","full_name":"redis-developer/a2a-redis","owner":"redis-developer","description":"Redis integrations for Google's A2A Python SDK","archived":false,"fork":false,"pushed_at":"2026-01-22T21:00:33.000Z","size":280,"stargazers_count":12,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-23T13:07:49.458Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/redis-developer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-07-29T22:48:48.000Z","updated_at":"2026-01-22T21:00:28.000Z","dependencies_parsed_at":"2025-08-02T00:57:32.334Z","dependency_job_id":"8c3c6ee5-6af6-40da-b14b-6616ea868fc0","html_url":"https://github.com/redis-developer/a2a-redis","commit_stats":null,"previous_names":["redis-developer/a2a-redis"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/redis-developer/a2a-redis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fa2a-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fa2a-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fa2a-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fa2a-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redis-developer","download_url":"https://codeload.github.com/redis-developer/a2a-redis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fa2a-redis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33380804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T01:21:08.577Z","status":"online","status_checked_at":"2026-05-23T02:00:05.530Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-05-23T02:35:47.741Z","updated_at":"2026-05-23T02:35:48.226Z","avatar_url":"https://github.com/redis-developer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# a2a-redis\n\nRedis integrations for the Agent-to-Agent (A2A) Python SDK.\n\nThis package provides Redis-backed implementations of core A2A components for persistent task storage, reliable event queue management, and push notification configuration using Redis.\n\n## Features\n\n- **RedisTaskStore \u0026 RedisJSONTaskStore**: Redis-backed task storage using hashes or JSON\n- **RedisStreamsQueueManager \u0026 RedisStreamsEventQueue**: Persistent, reliable event queues with consumer groups\n- **RedisPubSubQueueManager \u0026 RedisPubSubEventQueue**: Real-time, low-latency event broadcasting\n- **RedisPushNotificationConfigStore**: Task-based push notification configuration storage\n- **Consumer Group Strategies for Streams**: Flexible load balancing and instance isolation patterns\n\n## Installation\n\n```bash\npip install a2a-redis\n```\n\n## Quick Start\n\n```python\nfrom a2a_redis import RedisTaskStore, RedisStreamsQueueManager, RedisPushNotificationConfigStore\nfrom a2a_redis.utils import create_redis_client\nfrom a2a.server.request_handlers import DefaultRequestHandler\nfrom a2a.server.apps import A2AStarletteApplication\n\n# Create Redis client with connection management\nredis_client = create_redis_client(url=\"redis://localhost:6379/0\", max_connections=50)\n\n# Initialize Redis components\ntask_store = RedisTaskStore(redis_client, prefix=\"myapp:tasks:\")\nqueue_manager = RedisStreamsQueueManager(redis_client, prefix=\"myapp:queues:\")\npush_config_store = RedisPushNotificationConfigStore(redis_client, prefix=\"myapp:push:\")\n\n# Use with A2A request handler\nrequest_handler = DefaultRequestHandler(\n    agent_executor=YourAgentExecutor(),\n    task_store=task_store,\n    queue_manager=queue_manager,\n    push_config_store=push_config_store,\n)\n\n# Create A2A server\nserver = A2AStarletteApplication(\n    agent_card=your_agent_card,\n    http_handler=request_handler\n)\n```\n\n## Queue Components\n\nThe package provides both high-level queue managers and direct queue implementations:\n\n### Queue Managers\n- `RedisStreamsQueueManager` - Manages Redis Streams-based queues\n- `RedisPubSubQueueManager` - Manages Redis Pub/Sub-based queues\n- Both implement the A2A SDK's `QueueManager` interface\n\n### Event Queues\n- `RedisStreamsEventQueue` - Direct Redis Streams queue implementation\n- `RedisPubSubEventQueue` - Direct Redis Pub/Sub queue implementation\n- Both implement the `EventQueue` interface through protocol compliance\n\n## Queue Manager Types: Streams vs Pub/Sub\n\n### RedisStreamsQueueManager\n\n**Key Features:**\n- **Persistent storage**: Events remain in streams until explicitly trimmed\n- **Guaranteed delivery**: Consumer groups with acknowledgments prevent message loss\n- **Load balancing**: Multiple consumers can share work via consumer groups\n- **Failure recovery**: Unacknowledged messages can be reclaimed by other consumers\n- **Event replay**: Historical events can be re-read from any point in time\n- **Ordering**: Maintains strict insertion order with unique message IDs\n\n**Use Cases:**\n- Task event queues requiring reliability\n- Audit trails and event history\n- Work distribution systems\n- Systems requiring failure recovery\n- Multi-consumer load balancing\n\n**Trade-offs:**\n- Higher memory usage (events persist)\n- More complex setup (consumer groups)\n- Slightly higher latency than pub/sub\n\n### RedisPubSubQueueManager\n\n**Key Features:**\n- **Real-time delivery**: Events delivered immediately to active subscribers\n- **No persistence**: Events not stored, only delivered to active consumers\n- **Fire-and-forget**: No acknowledgments or delivery guarantees\n- **Broadcasting**: All subscribers receive all events\n- **Low latency**: Minimal overhead for immediate delivery\n- **Minimal memory usage**: No storage of events\n\n**Use Cases:**\n- Live status updates and notifications\n- Real-time dashboard updates\n- System event broadcasting\n- Non-critical event distribution\n- Low-latency requirements\n- Simple fan-out scenarios\n\n**Not suitable for:**\n- Critical event processing requiring guarantees\n- Systems requiring event replay or audit trails\n- Offline-capable applications\n- Work queues requiring load balancing\n\n## Components\n\n### Task Storage\n\n#### RedisTaskStore\nStores task data in Redis using hashes with JSON serialization. Works with any Redis server.\n\n```python\nfrom a2a_redis import RedisTaskStore\n\ntask_store = RedisTaskStore(redis_client, prefix=\"mytasks:\")\n\n# A2A TaskStore interface methods\nawait task_store.save(\"task123\", {\"status\": \"pending\", \"data\": {\"key\": \"value\"}})\ntask = await task_store.get(\"task123\")\nsuccess = await task_store.delete(\"task123\")\n\n# List all task IDs (utility method)\ntask_ids = await task_store.list_task_ids()\n```\n\n#### RedisJSONTaskStore\nStores task data using Redis's JSON module for native JSON operations and complex nested data.\n\n```python\nfrom a2a_redis import RedisJSONTaskStore\n\n# Requires Redis 8 or RedisJSON module\njson_task_store = RedisJSONTaskStore(redis_client, prefix=\"mytasks:\")\n\n# Same interface as RedisTaskStore but with native JSON support\nawait json_task_store.save(\"task123\", {\"complex\": {\"nested\": {\"data\": \"value\"}}})\n```\n\n### Queue Managers\n\nBoth queue managers implement the A2A QueueManager interface with full async support:\n\n```python\nimport asyncio\nfrom a2a_redis import RedisStreamsQueueManager, RedisPubSubQueueManager\nfrom a2a_redis.streams_consumer_strategy import ConsumerGroupConfig, ConsumerGroupStrategy\n\n# Choose based on your requirements:\n\n# For reliable, persistent processing\nstreams_manager = RedisStreamsQueueManager(redis_client, prefix=\"myapp:streams:\")\n\n# For real-time, low-latency broadcasting\npubsub_manager = RedisPubSubQueueManager(redis_client, prefix=\"myapp:pubsub:\")\n\n# With custom consumer group configuration (streams only)\nconfig = ConsumerGroupConfig(strategy=ConsumerGroupStrategy.SHARED_LOAD_BALANCING)\nstreams_manager = RedisStreamsQueueManager(redis_client, consumer_config=config)\n\nasync def main():\n    # Same interface for both managers\n    queue = await streams_manager.create_or_tap(\"task123\")\n\n    # Enqueue events\n    await queue.enqueue_event({\"type\": \"progress\", \"message\": \"Task started\"})\n    await queue.enqueue_event({\"type\": \"progress\", \"message\": \"50% complete\"})\n\n    # Dequeue events\n    try:\n        event = await queue.dequeue_event(no_wait=True)  # Non-blocking\n        print(f\"Got event: {event}\")\n        await queue.task_done()  # Acknowledge the message (streams only)\n    except RuntimeError:\n        print(\"No events available\")\n\n    # Close queue when done\n    await queue.close()\n\nasyncio.run(main())\n```\n\n### Consumer Group Strategies\n\nThe Streams queue manager supports different consumer group strategies:\n\n```python\nfrom a2a_redis.streams_consumer_strategy import ConsumerGroupStrategy, ConsumerGroupConfig\n\n# Multiple instances share work across a single consumer group\nconfig = ConsumerGroupConfig(strategy=ConsumerGroupStrategy.SHARED_LOAD_BALANCING)\n\n# Each instance gets its own consumer group\nconfig = ConsumerGroupConfig(strategy=ConsumerGroupStrategy.INSTANCE_ISOLATED)\n\n# Custom consumer group name\nconfig = ConsumerGroupConfig(strategy=ConsumerGroupStrategy.CUSTOM, group_name=\"my_group\")\n\nstreams_manager = RedisStreamsQueueManager(redis_client, consumer_config=config)\n```\n\n### RedisPushNotificationConfigStore\n\nStores push notification configurations per task. Implements the A2A PushNotificationConfigStore interface.\n\n```python\nfrom a2a_redis import RedisPushNotificationConfigStore\nfrom a2a.types import PushNotificationConfig\n\nconfig_store = RedisPushNotificationConfigStore(redis_client, prefix=\"myapp:push:\")\n\n# Create push notification config\nconfig = PushNotificationConfig(\n    url=\"https://webhook.example.com/notify\",\n    token=\"secret_token\",\n    id=\"webhook_1\"\n)\n\n# A2A interface methods\nawait config_store.set_info(\"task123\", config)\n\n# Get all configs for a task\nconfigs = await config_store.get_info(\"task123\")\nfor config in configs:\n    print(f\"Config {config.id}: {config.url}\")\n\n# Delete specific config or all configs for a task\nawait config_store.delete_info(\"task123\", \"webhook_1\")  # Delete specific\nawait config_store.delete_info(\"task123\")  # Delete all\n```\n\n## Requirements\n\n- Python 3.11+\n- redis \u003e= 4.0.0\n- a2a-sdk \u003e= 0.2.16 (Agent-to-Agent Python SDK)\n- uvicorn \u003e= 0.35.0\n\n## Optional Dependencies\n\n- RedisJSON module for `RedisJSONTaskStore` (enhanced nested data support)\n- Redis Stack or Redis with modules for full feature support\n\n## Development\n\n```bash\n# Clone the repository\ngit clone https://github.com/a2aproject/a2a-redis.git\ncd a2a-redis\n\n# Create virtual environment and install dependencies\nuv venv\nsource .venv/bin/activate  # or .venv\\Scripts\\activate on Windows\nuv sync --dev\n\n# Run tests with coverage\nuv run pytest --cov=a2a_redis --cov-report=term-missing\n\n# Run linting and formatting\nuv run ruff check src/ tests/\nuv run ruff format src/ tests/\nuv run pyright src/\n\n# Install pre-commit hooks\nuv run pre-commit install\n\n# Run examples\nuv run python examples/basic_usage.py\nuv run python examples/redis_travel_agent.py\n```\n\n## Testing\n\nTests use Redis database 15 for isolation and include both mock and real Redis integration tests:\n\n```bash\n# Run all tests\nuv run pytest\n\n# Run specific test file\nuv run pytest tests/test_streams_queue_manager.py -v\n\n# Run with coverage\nuv run pytest --cov=a2a_redis --cov-report=term-missing\n```\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredis-developer%2Fa2a-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredis-developer%2Fa2a-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredis-developer%2Fa2a-redis/lists"}