|
| 1 | +# ADK Release Analyzer Agent |
| 2 | + |
| 3 | +The ADK Release Analyzer Agent is a Python-based agent designed to help keep |
| 4 | +documentation up-to-date with code changes. It analyzes the differences between |
| 5 | +two releases of the `google/adk-python` repository, identifies required updates |
| 6 | +in the `google/adk-docs` repository, and automatically generates a GitHub issue |
| 7 | +with detailed instructions for documentation changes. |
| 8 | + |
| 9 | +This agent can be operated in two distinct modes: |
| 10 | + |
| 11 | +* an interactive mode for local use |
| 12 | +* a fully automated mode for integration into workflows. |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## Interactive Mode |
| 17 | + |
| 18 | +This mode allows you to run the agent locally to review its recommendations in |
| 19 | +real-time before any changes are made. |
| 20 | + |
| 21 | +### Features |
| 22 | + |
| 23 | +* **Web Interface**: The agent's interactive mode can be rendered in a web |
| 24 | +browser using the ADK's `adk web` command. |
| 25 | +* **User Approval**: In interactive mode, the agent is instructed to ask for |
| 26 | +your confirmation before creating an issue on GitHub with the documentation |
| 27 | +update instructions. |
| 28 | +* **Question & Answer**: You ask questions about the releases and code changes. |
| 29 | +The agent will provide answers based on related information. |
| 30 | + |
| 31 | +### Running in Interactive Mode |
| 32 | +To run the agent in interactive mode, first set the required environment |
| 33 | +variables, ensuring `INTERACTIVE` is set to `1` or is unset. Then, execute the |
| 34 | +following command in your terminal: |
| 35 | + |
| 36 | +```bash |
| 37 | +adk web contributing/samples/adk_documentation |
| 38 | +``` |
| 39 | + |
| 40 | +This will start a local server and provide a URL to access the agent's web |
| 41 | +interface in your browser. |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## Automated Mode |
| 46 | + |
| 47 | +For automated, hands-off analysis, the agent can be run as a script (`main.py`), |
| 48 | +for example as part of a CI/CD pipeline. The workflow is configured in |
| 49 | +`.github/workflows/analyze-releases-for-adk-docs-updates.yml` and automatically |
| 50 | +checks the most recent two releases for docs updates. |
| 51 | + |
| 52 | +### Workflow Triggers |
| 53 | +The GitHub workflow is configured to run on specific triggers: |
| 54 | + |
| 55 | +- **Release Events**: The workflow executes automatically whenever a new release |
| 56 | +is `published`. |
| 57 | + |
| 58 | +- **Manual Dispatch**: The workflow also runs when manually triggered for |
| 59 | +testing and retrying. |
| 60 | + |
| 61 | +### Automated Issue Creation |
| 62 | + |
| 63 | +When running in automated mode, the agent operates non-interactively. It creates |
| 64 | +a GitHub issue with the documentation update instructions directly without |
| 65 | +requiring user approval. This behavior is configured by setting the |
| 66 | +`INTERACTIVE` environment variable to `0`. |
| 67 | + |
| 68 | +--- |
| 69 | + |
| 70 | +## Setup and Configuration |
| 71 | + |
| 72 | +Whether running in interactive or automated mode, the agent requires the |
| 73 | +following setup. |
| 74 | + |
| 75 | +### Dependencies |
| 76 | + |
| 77 | +The agent requires the following Python libraries. |
| 78 | + |
| 79 | +```bash |
| 80 | +pip install --upgrade pip |
| 81 | +pip install google-adk |
| 82 | +``` |
| 83 | + |
| 84 | +### Environment Variables |
| 85 | + |
| 86 | +The following environment variables are required for the agent to connect to |
| 87 | +the necessary services. |
| 88 | + |
| 89 | +* `GITHUB_TOKEN`: **(Required)** A GitHub Personal Access Token with issues:write permissions for the documentation repository. |
| 90 | +* `GOOGLE_API_KEY`: **(Required)** Your API key for the Gemini API. |
| 91 | +* `DOC_OWNER`: The GitHub organization or username that owns the documentation repository (defaults to `google`). |
| 92 | +* `CODE_OWNER`: The GitHub organization or username that owns the code repository (defaults to `google`). |
| 93 | +* `DOC_REPO`: The name of the documentation repository (defaults to `adk-docs`). |
| 94 | +* `CODE_REPO`: The name of the code repository (defaults to `adk-python`). |
| 95 | +* `LOCAL_REPOS_DIR_PATH`: The local directory to clone the repositories into (defaults to `/tmp`). |
| 96 | +* `INTERACTIVE`: Controls the agent's interaction mode. Set to 1 for interactive mode (default), and 0 for automated mode. |
| 97 | + |
| 98 | +For local execution, you can place these variables in a `.env` file in the |
| 99 | +project's root directory. For automated workflows, they should be configured as |
| 100 | +environment variables or secrets. |
0 commit comments