Content
# Agent-to-Agent (A2A) Collaboration System
This project demonstrates an Agent-to-Agent (A2A) collaboration system where two specialized agents work together to analyze and design software requirements. The system consists of a Product Owner Agent and an Architect Agent that collaborate to provide comprehensive analysis of requirements and technical architecture.
## Architecture
The system consists of two main components:
1. **Product Owner Agent**
- Endpoint: http://localhost:8000
- Responsibilities:
- Requirement analysis
- Priority management
- Stakeholder communication
- Collaboration with Architect Agent
2. **Architect Agent**
- Endpoint: http://localhost:8002
- Responsibilities:
- System design
- Technical analysis
- Architecture review
- Collaboration with Product Owner Agent
## LLM Integration
The system uses Salesforce's internal LLM Gateway with the following configuration:
- Model: `llmgateway__OpenAIGPT4OmniMini` (GPT-4 variant)
- API Endpoint: `https://bot-svc-llm.sfproxy.einstein.dev1-uswest2.aws.sfdc.cl`
- Authentication: API Key based
## Prerequisites
- Python 3.13 or higher
- Virtual environment
- Salesforce internal network access
- Valid LLM Gateway API key
## Setup
1. Create and activate a virtual environment:
```bash
python3 -m venv venv
source venv/bin/activate
```
2. Install required packages:
```bash
pip install fastapi uvicorn httpx
pip install ~/Downloads/sfdc_llm_gateway_python_sdk-1.0.4-py3-none-any.whl
```
## Running the System
1. Start the Product Owner Agent:
```bash
python3 product_owner_agent.py
```
2. Start the Architect Agent:
```bash
python3 architect_agent.py
```
3. Register the agents with each other:
```bash
# Register Architect Agent with Product Owner Agent
curl -X POST http://localhost:8000/register_agent -H "Content-Type: application/json" -d '{"name": "Architect Agent", "description": "An agent that handles system architecture and technical design", "capabilities": ["system_design", "technical_analysis", "architecture_review"], "endpoint": "http://localhost:8002"}'
# Register Product Owner Agent with Architect Agent
curl -X POST http://localhost:8002/register_agent -H "Content-Type: application/json" -d '{"name": "Product Owner Agent", "description": "An agent that manages product requirements and priorities", "capabilities": ["requirements_analysis", "priority_management", "stakeholder_communication"], "endpoint": "http://localhost:8000"}'
```
## Usage
### Submitting a Requirement
To submit a requirement for analysis:
```bash
curl -X POST http://localhost:8000/analyze_requirement -H "Content-Type: application/json" -d '{
"title": "User Authentication System",
"description": "Create a user authentication system with login and registration features...",
"priority": "high",
"stakeholders": ["Security Team", "UX Team", "Development Team"]
}'
```
The system will:
1. Analyze the requirement (Product Owner Agent)
2. Forward it for technical review (Architect Agent)
3. Return a comprehensive analysis including:
- Requirement analysis
- Technical considerations
- Recommendations
- Security considerations
## API Endpoints
### Product Owner Agent (http://localhost:8000)
- `GET /.well-known/agent.json`: Get agent configuration
- `POST /register_agent`: Register another agent
- `POST /analyze_requirement`: Submit a requirement for analysis
- `POST /set_priority`: Set priority for a requirement
### Architect Agent (http://localhost:8002)
- `GET /.well-known/agent.json`: Get agent configuration
- `POST /register_agent`: Register another agent
- `POST /design_system`: Design a system
- `POST /review_architecture`: Review system architecture
## Error Handling
The system includes comprehensive error handling and logging:
- Connection errors
- API failures
- Invalid requests
- Timeout handling
## Logging
Logging is configured at DEBUG level for both agents and the LLM service. Logs include:
- Agent initialization
- API requests and responses
- Error conditions
- Collaboration events
## Security Considerations
- API key authentication
- HTTPS communication
- Input validation
- Error handling without exposing sensitive information
## Contributing
1. Fork the repository
2. Create a feature branch
3. Commit your changes
4. Push to the branch
5. Create a Pull Request
## License
This project is proprietary and confidential. Unauthorized copying, distribution, or use is strictly prohibited.