Jira A2A Proof of Concept
Overview
The Jira A2A system is a DevOps workflow automation platform using the tRPC-A2A-Go framework. It consists of independent Go agents that communicate via A2A messages, each implementing the standard TaskProcessor interface.
Agent-to-Agent (A2A) Communication
Agent-to-Agent (A2A) is a decentralized messaging pattern where independent services (agents) exchange strongly-typed tasks and results over a transport layer—in this case, gRPC—without tight coupling or shared state. Each agent publishes and subscribes to tasks using the trpc-a2a-go library, which:
Defines a common TaskProcessor interface for sending and handling tasks.
Serializes tasks as protobuf messages and transports them over gRPC.
Handles routing, retry, and backoff transparently between agents.
For more details, see the official trpc-a2a-go GitHub repo and its pkg.go.dev documentation.
System Architecture
System Sequence Diagram
The following Mermaid sequence diagram illustrates the step-by-step message flow between major system components:
Key Components
JiraRetrievalAgent: Handles Jira webhook events, extracts ticket information, coordinates with other agents, and posts analysis results back to Jira.
InformationGatheringAgent: Analyzes ticket information, integrates with LLM for intelligent analysis, generates insights and recommendations, and returns structured analysis results.
CopilotAgent (Planned): Receives implementation requirements, integrates with GitHub Copilot API, generates code, and creates pull requests.
LLM Integration: Provides AI-powered analysis, generates summaries and insights, identifies missing information, and recommends next actions.
tRPC-A2A-Go Library: Underlying agent-to-agent communication framework used by this system; see the upstream repo for details.
System Workflow
Webhook Reception: JiraRetrievalAgent receives a webhook from Jira
Data Extraction: JiraRetrievalAgent extracts ticket details
Task Creation: JiraRetrievalAgent creates a "ticket-available" task
Analysis Request: JiraRetrievalAgent sends the task to InformationGatheringAgent
Information Analysis: InformationGatheringAgent processes the task with LLM assistance
Results Return: InformationGatheringAgent returns structured insights to JiraRetrievalAgent
Jira Update: JiraRetrievalAgent posts a comment to the Jira ticket
Code Implementation: (Future) JiraRetrievalAgent triggers CopilotAgent for code generation
Pull Request Creation: (Future) CopilotAgent creates a GitHub pull request
Current Implementation Status
JiraRetrievalAgent: Fully implemented (webhook handling, Jira API integration, task coordination)
InformationGatheringAgent: Fully implemented (task processing, LLM integration, analysis generation)
CopilotAgent: Planned, not implemented
Component Details
JiraRetrievalAgent
Purpose: Handles Jira webhooks, coordinates agents, and updates Jira tickets.
Key Functions:
Processes incoming Jira webhook events
Retrieves ticket information from Jira API
Transforms Jira data into structured tasks
Sends tasks to the InformationGatheringAgent
Posts analysis results back to Jira tickets
Webhook Example:
{
"timestamp": 1714824000000,
"webhookEvent": "jira:issue_created",
"issue_event_type_name": "issue_created",
"user": {
"accountId": "5d1234567890abcdef123456",
"displayName": "Alice Example"
},
"issue": {
"id": "10002",
"key": "PROJ-456",
"fields": {
"summary": "Cannot log in to the system",
"description": "User reports being unable to log in with correct credentials.",
"issuetype": { "name": "Bug" },
"priority": { "name": "High" }
}
}
}
InformationGatheringAgent
Purpose: Analyzes ticket information to provide structured insights and recommendations.
Key Functions:
Receives "ticket-available" tasks from JiraRetrievalAgent
Processes ticket data using LLM for analysis
Generates structured insights and recommendations
Returns analysis results to JiraRetrievalAgent
Analysis Example:
{
"ticketId": "PROJ-123",
"analysisResult": {
"keyThemes": "authentication, login, security",
"riskLevel": "high",
"priority": "high",
"technicalImpact": "Users unable to access the system, potential security issue",
"businessImpact": "Loss of productivity, customer frustration",
"suggestedComponents": "auth-service, user-management",
"missingInformation": "Browser details, error messages, steps to reproduce"
},
"summary": "This appears to be a critical login issue affecting users' ability to access the system. It's likely related to the authentication service and should be addressed with high priority."
}
LLM Integration
Integrates with OpenAI API (or alternative LLM providers)
Implements prompt engineering for consistent analysis
Handles API communication, rate limiting, and error handling
Extracts structured data from LLM responses
Configuration Example:
LLM_ENABLED=true
LLM_PROVIDER=openai
LLM_MODEL=gpt-4
LLM_API_KEY=your-openai-api-key
LLM_MAX_TOKENS=4000
LLM_TEMPERATURE=0.0
Running the Application
Using Make
make run-all # Start all agents
make run-info # Start InformationGatheringAgent
make run-jira # Start JiraRetrievalAgent
make logs-all # View all logs
make stop-all # Stop all agents
Using Docker Compose
docker-compose up -d
Manually
# Start InformationGatheringAgent
cd cmd/infogathering
go build
./infogathering
# Start JiraRetrievalAgent
cd cmd/jiraretrieval
go build
./jiraretrieval
Testing
Simulating a Jira Webhook
curl -X POST http://localhost:8081/webhook \
-H "Content-Type: application/json" \
-d '{
"ticketId": "TEST-123",
"event": "created"
}'
Setup
Prerequisites
Go 1.16 or higher
Access to a Jira instance
Configuration
The application uses environment variables for configuration:
# Server configuration
export SERVER_PORT=8080
export SERVER_HOST=localhost
# Agent configuration
export AGENT_NAME=InformationGatheringAgent
export AGENT_VERSION=1.0.0
export AGENT_URL=http://localhost:8080
# Jira configuration
export JIRA_BASE_URL=https://your-jira-instance.atlassian.net
export JIRA_USERNAME=your-jira-username
export JIRA_API_TOKEN=your-jira-api-token
# Authentication
export AUTH_TYPE=apikey # "jwt" or "apikey"
export API_KEY=your-api-key
export JWT_SECRET=your-jwt-secret # Only needed if AUTH_TYPE=jwt
Running the Application
Build and run the InformationGatheringAgent:
cd cmd/infogathering
go build
./infogathering
The agent will start on the configured port (default: 8080) and listen for "ticket-available" tasks.
Testing
Simulating a Jira Webhook
You can simulate a Jira webhook by sending a POST request to the agent:
curl -X POST http://localhost:8080/task \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{
"ticketId": "PROJ-123",
"summary": "Implement new feature",
"metadata": {
"priority": "High",
"reporter": "John Doe"
}
}'
Using the Client Example
The client_example.go
file contains examples of how to use the A2A client to send a "ticket-available" task and how to simulate a Jira webhook.
Future Work
JiraRetrievalAgent
Listen for new Jira ticket webhooks
Emit a "ticket-available" A2A task with ticket information
Known Limitations and Future Improvements
Components are tightly coupled; refactoring for modularity is planned
Limited context in error messages; structured logging should be improved
Insufficient unit and integration tests; coverage will be expanded
Configuration validation and security enhancements are planned
CopilotAgent and code generation are planned for future releases
Contributing
Fork the repository
Create a feature branch
Make your changes
Write tests for your changes
Submit a pull request
License
Last updated
Was this helpful?