You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: agentic_rag/README.md
+211Lines changed: 211 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -454,6 +454,217 @@ Query a specific collection:
454
454
python local_rag_agent.py --query "How to implement a queue?" --collection "Repository Collection"
455
455
```
456
456
457
+
## 3. Agent2Agent (A2A) Protocol Integration
458
+
459
+
The agentic_rag system now includes full support forthe Agent2Agent (A2A) protocol, enabling seamless communication and collaboration with other AI agents. This integration transforms the system into an interoperable agent that can participatein multi-agent workflows and ecosystems.
460
+
461
+
### 3.1 Why A2A Protocol Implementation?
462
+
463
+
**Enhanced Interoperability**: The A2A protocol enables the agentic_rag system to communicate with other AI agents using a standardized protocol, breaking down silos between different AI systems and frameworks.
464
+
465
+
**Scalable Multi-Agent Workflows**: By implementing A2A, the system can participate in complex multi-agent workflows where different agents handle specialized tasks (document processing, analysis, synthesis) and collaborate to solve complex problems.
466
+
467
+
**Industry Standard Compliance**: A2A is an open standard developed by Google, ensuring compatibility with other A2A-compliant agents and future-proofing the system.
468
+
469
+
**Enterprise-Grade Security**: A2A includes built-in security mechanisms including authentication, authorization, and secure communication protocols.
470
+
471
+
**Agent Discovery**: The protocol enables automatic discovery of other agents and their capabilities, allowing for dynamic agent composition and task delegation.
472
+
473
+
### 3.2 A2A Implementation Architecture
474
+
475
+
The A2A implementation consists of several key components:
476
+
477
+
#### 3.2.1 Core A2A Infrastructure
478
+
479
+
- **A2A Models** (`a2a_models.py`): Pydantic models for JSON-RPC 2.0 communication
480
+
- **A2A Handler** (`a2a_handler.py`): Main request handler and method router
481
+
- **Task Manager** (`task_manager.py`): Long-running task execution and status tracking
482
+
- **Agent Registry** (`agent_registry.py`): Agent discovery and capability management
483
+
- **Agent Card** (`agent_card.py`): Capability advertisement and metadata
484
+
485
+
#### 3.2.2 Supported A2A Methods
486
+
487
+
The system supports the following A2A protocol methods:
488
+
489
+
- `document.query`: Query documents using RAG with intelligent routing
490
+
- `document.upload`: Process and store documents in vector database
491
+
- `task.create`: Create long-running tasks for complex operations
492
+
- `task.status`: Check status of running tasks
493
+
- `task.cancel`: Cancel running tasks
494
+
- `agent.discover`: Discover other agents and their capabilities
495
+
- `agent.card`: Get agent capability information
496
+
- `health.check`: System health and status check
497
+
498
+
### 3.3 A2A Endpoints
499
+
500
+
The system exposes the following A2A endpoints:
501
+
502
+
- `POST /a2a`: Main A2A protocol endpoint for agent communication
503
+
- `GET /agent_card`: Get the agent's capability card
504
+
- `GET /a2a/health`: A2A health check endpoint
505
+
506
+
### 3.4 Usage Examples
507
+
508
+
#### 3.4.1 Basic A2A Communication
509
+
510
+
```bash
511
+
# Query documents via A2A protocol
512
+
curl -X POST http://localhost:8000/a2a \
513
+
-H "Content-Type: application/json" \
514
+
-d '{
515
+
"jsonrpc": "2.0",
516
+
"method": "document.query",
517
+
"params": {
518
+
"query": "What is machine learning?",
519
+
"collection": "PDF",
520
+
"use_cot": true
521
+
},
522
+
"id": "1"
523
+
}'
524
+
```
525
+
526
+
#### 3.4.2 Task Management
527
+
528
+
```bash
529
+
# Create a long-running task
530
+
curl -X POST http://localhost:8000/a2a \
531
+
-H "Content-Type: application/json" \
532
+
-d '{
533
+
"jsonrpc": "2.0",
534
+
"method": "task.create",
535
+
"params": {
536
+
"task_type": "document_processing",
537
+
"params": {
538
+
"document": "large_document.pdf",
539
+
"chunk_count": 100
540
+
}
541
+
},
542
+
"id": "2"
543
+
}'
544
+
545
+
# Check task status
546
+
curl -X POST http://localhost:8000/a2a \
547
+
-H "Content-Type: application/json" \
548
+
-d '{
549
+
"jsonrpc": "2.0",
550
+
"method": "task.status",
551
+
"params": {
552
+
"task_id": "task-id-from-previous-response"
553
+
},
554
+
"id": "3"
555
+
}'
556
+
```
557
+
558
+
#### 3.4.3 Agent Discovery
559
+
560
+
```bash
561
+
# Discover agents with specific capabilities
562
+
curl -X POST http://localhost:8000/a2a \
563
+
-H "Content-Type: application/json" \
564
+
-d '{
565
+
"jsonrpc": "2.0",
566
+
"method": "agent.discover",
567
+
"params": {
568
+
"capability": "document.query"
569
+
},
570
+
"id": "4"
571
+
}'
572
+
573
+
# Get agent card
574
+
curl -X GET http://localhost:8000/agent_card
575
+
```
576
+
577
+
### 3.5 Testing A2A Implementation
578
+
579
+
The A2A implementation includes comprehensive tests covering all functionality:
This project is open source. Please submit your contributions by forking this repository and submitting a pull request! Oracle appreciates any contributions that are made by the open source community.
0 commit comments