This project implements a production-ready, interactive GitHub Issue Analyzer Agent using Java 17, Maven, and the Google Agent Development Kit (ADK) version 1.3.0. The agent is designed to triage issues, profile users, analyze comments, and triage pull requests.
The project follows a modular architecture leveraging the Google ADK framework.
Main: The entry point that launches the agent with a Dev UI (AdkWebServer) and demonstrates session management.IssueAnalyzerAgent: Defines the agent's persona, instructions, and tools. It usesLlmAgentbuilder and registers tools asFunctionTool.tools: Contains specialized classes registered as tools for the agent, invoked based on user requests:TriageTool: The initial entry point for fetching and categorizing issues.UserProfilingTool: Fetches deep details for any GitHub user (Author, Commenter, Reviewer).CommentAnalysisTool: Summarizes discussions on issues.PullRequestTool: Fetches and analyzes Pull Request details.UserRepositoriesTool: Lists public repositories of a user.
GitHubClient: A helper class to interact with the GitHub REST API using OkHttp and Gson. Used by the tools to fetch data. Supports pagination for fetching repositories.
Multi-turn conversational context is maintained. Due to ADK schema generation limitations with ToolContext, a custom State class (using ThreadLocal) is used to store temporary state (e.g., temp:current_issue).
- Java 17 or higher
- Maven 3.6 or higher
Navigate to the project directory and run:
mvn clean compileSet the following environment variables to allow the agent to function correctly:
export GITHUB_OWNER=your_github_owner
export GITHUB_REPO=your_github_repo
export GITHUB_TOKEN=your_github_token
export GOOGLE_CLOUD_PROJECT=your_project_id
export GOOGLE_CLOUD_LOCATION=your_location
export GOOGLE_GENAI_USE_VERTEXAI=trueYou can run the agent using the exec-maven-plugin:
mvn exec:javaThis will start the development engine interface (web server) on port 8080.
The agent can handle the following operations via its tools:
- Triage Issue: Summarizes the issue, extracts metadata, and categorizes it as a Bug or Feature Request.
- Profile User: Fetches details for a given GitHub username (author, commenter, reviewer, etc.).
- Analyze Comments: Summarizes discussions on the issue.
- List User Repositories: Lists the public repositories of a user (with pagination support).
- Triage Pull Request: Fetches details of a pull request, including author, assignees, and reviewers.