Skip to main content

Vector Institute AI Engineering Bot for Maintenance Tasks

Project description

aieng-bot


PyPI code checks unit tests docs codecov GitHub License

Centralized maintenance bot that automatically manages bot PRs (Dependabot and pre-commit-ci) across all Vector Institute repositories from a single location.

Features

  • Organization-wide monitoring - Scans all VectorInstitute repos every 6 hours
  • Auto-merge - Merges bot PRs (Dependabot and pre-commit-ci) when all checks pass
  • Auto-fix - Fixes test failures, linting issues, security vulnerabilities, and build errors using Claude AI Agent SDK
  • Centralized operation - No installation needed in individual repositories
  • Smart detection - Categorizes failures and applies appropriate fix strategies
  • Transparent - Comments on PRs with status updates

Architecture

┌─────────────────────────────────┐
│  aieng-bot Repository  │
│  (This Repo - Central Bot)      │
│                                 │
│  Runs every 6 hours:            │
│  1. Scans VectorInstitute org   │
│  2. Finds bot PRs               │
│  3. Checks status               │
│  4. Merges or fixes PRs         │
└──────────────┬──────────────────┘
               │
               │ Operates on
               ▼
┌───────────────────────────────────┐
│   VectorInstitute Organization    │
│                                   │
│  ├─ repo-1  (Bot PR #1)           │
│  ├─ repo-2  (Bot PR #2)           │
│  ├─ repo-3  (Bot PR #3)           │
│  └─ repo-N  ...                   │
└───────────────────────────────────┘

Quick Start

Setup (in this repository)

1. Create Anthropic API Key

2. Create GitHub Personal Access Token

  • Go to Settings → Developer settings → Personal access tokens → Fine-grained tokens
  • Configure: Resource owner: VectorInstitute, Repository access: All repositories
  • Permissions: contents: write, pull_requests: write, issues: write
  • Add as repository secret: ORG_ACCESS_TOKEN

3. Enable GitHub Actions

  • Go to Actions tab → Enable workflows

The bot now monitors all VectorInstitute repositories automatically.

How It Works

1. Monitor (every 6 hours)

  • Scans all VectorInstitute repositories for open bot PRs (Dependabot and pre-commit-ci)
  • Checks status of each PR
  • Routes to merge or fix workflow

2. Auto-Merge (when all checks pass)

  • Approves PR and enables auto-merge
  • Comments with status
  • PR merges automatically

3. Auto-Fix (when checks fail)

  • Clones target repository and PR branch
  • Analyzes failure type: test, lint, security, or build
  • Loads appropriate AI prompt template
  • Uses Claude Agent SDK to automatically apply fixes
  • Commits and pushes fixes to PR

Configuration

Required Secrets

  • ANTHROPIC_API_KEY - Anthropic API access for Claude
  • ORG_ACCESS_TOKEN - GitHub PAT with org-wide permissions

Workflows

  • monitor-org-bot-prs.yml - Scans org for bot PRs (Dependabot and pre-commit-ci) every 6 hours
  • fix-remote-pr.yml - Fixes failing PRs using AI

AI Prompt Templates (customize for your needs)

  • fix-merge-conflicts.md - Resolve merge conflicts with best practices
  • fix-test-failures.md - Test failure resolution strategies
  • fix-lint-failures.md - Linting/formatting fixes
  • fix-security-audit.md - Security vulnerability handling
  • fix-build-failures.md - Build/compilation error fixes

Capabilities

Can fix:

  • Merge conflicts (dependency files, lock files, code)
  • Linting and formatting issues
  • Security vulnerabilities (dependency updates)
  • Simple test failures from API changes
  • Build configuration issues

Cannot fix:

  • Complex logic errors
  • Breaking changes requiring refactoring
  • Issues requiring architectural decisions

Manual Testing

Trigger via CLI:

# Monitor all repositories
gh workflow run monitor-org-bot-prs.yml

# Fix a specific PR (test with aieng-template-mvp#17)
gh workflow run fix-remote-pr.yml \
  --field target_repo="VectorInstitute/aieng-template-mvp" \
  --field pr_number="17"

Trigger via GitHub UI: Actions → Select workflow → Run workflow → Enter parameters

Dashboard

View comprehensive analytics and agent execution traces:

  • 📊 Bot Dashboard - Interactive dashboard with:
    • Overview table of all bot PR fixes
    • Success rates and performance metrics
    • Detailed agent execution traces (like LangSmith/Langfuse)
    • Code diffs with syntax highlighting
    • Failure analysis and reasoning timeline

Features:

  • Real-time PR status tracking
  • Agent observability (tool calls, reasoning, actions)
  • Historical metrics and trends
  • Per-repo and per-failure-type analytics
  • Sortable/filterable PR table

Authentication:

  • Restricted to @vectorinstitute.ai email addresses
  • Google OAuth 2.0 sign-in

Monitoring

View bot activity:

  • Dashboard - Comprehensive analytics and traces
  • Actions tab - All workflow runs and success/failure rates
  • PR comments - Detailed status updates on each PR
  • Run summary - PR count and actions taken per run

Debug commands:

# View recent workflow runs
gh run list --workflow=monitor-org-bot-prs.yml --limit 5

# View logs for specific run
gh run view RUN_ID --log

# Collect metrics manually
gh workflow run aieng-bot metrics.yml

Documentation

Troubleshooting

Issue Solution
Workflow doesn't run Check Actions enabled and secrets are set
Can't find PRs Verify ORG_ACCESS_TOKEN has correct permissions
Can't merge PRs Ensure token has contents: write permission
Can't push fixes Check token has write access to target repos
Claude API errors Verify ANTHROPIC_API_KEY is valid
Rate limits Reduce monitoring frequency in workflow cron schedule

See Setup Guide for detailed troubleshooting.


🤖 AI Engineering Maintenance Bot - Maintaining Vector Institute Repositories built by AI Engineering

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aieng_bot-0.5.0.tar.gz (400.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aieng_bot-0.5.0-py3-none-any.whl (82.6 kB view details)

Uploaded Python 3

File details

Details for the file aieng_bot-0.5.0.tar.gz.

File metadata

  • Download URL: aieng_bot-0.5.0.tar.gz
  • Upload date:
  • Size: 400.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aieng_bot-0.5.0.tar.gz
Algorithm Hash digest
SHA256 5442fcf41f43d0e7615f69c46a86c09f9793427142c65313fea12c94742bb0ec
MD5 bb8b72c46e8f909e4e2ea7b1726a3469
BLAKE2b-256 ed4c1751f46ba81e1df546aa0f381062290a5348270bb168ee10c0bad8a85de6

See more details on using hashes here.

File details

Details for the file aieng_bot-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: aieng_bot-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 82.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aieng_bot-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8793f06f5d7401e9a799ed6cae0b357ad3480cdeb515c9a05dfa44c76405801a
MD5 0b0928dc505808e9f335e956457e5309
BLAKE2b-256 fe0d3c14a08d155632765cdc819f67b55c86dd9cbac81ce172ce6a87da5dcabc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page