Skip to content

tmseidel/ai-git-bot

AI-Git-Bot

License: MIT Docker Pulls GitHub release GitHub stars GitHub issues

Your intelligent gateway between Git and AI β€” Half Bot, half Agent. πŸ€–πŸ§ 

AI-Git-Bot is a lightweight, self-hostable gateway application that connects your Git platforms with AI providers. As a central hub it receives webhooks from Gitea, GitHub, GitHub Enterprise, GitLab, and Bitbucket Cloud, routes them to configurable AI providers, and writes the results back as code reviews, comments, or even entire pull requests β€” fully automated.

AI-Git-Bot Architecture Schema

🎯 Who is AI-Git-Bot for?

Audience Benefit
πŸ§‘β€πŸ’» Developers who want a personalized code AI Configure your own AI with custom system prompts β€” for code reviews that match your tech stack and coding standards.
πŸ”„ Teams with multiple projects & Git systems Define an AI configuration once and reuse it across any number of repositories, projects, and Git platforms β€” through a single gateway.
πŸ‘₯ Multi-pass reviews with different personas Create multiple bots with different prompts: a security reviewer, a performance expert, a junior mentor β€” all on the same PR.
πŸ”’ Self-hosters with compliance requirements Run everything on-premise with local LLMs (Ollama, llama.cpp). No code leaves your infrastructure β€” ideal for regulatory and compliance needs.
⚑ Lightweight AI implementation A single Docker image, one PostgreSQL database β€” done. No complex infrastructure, no Kubernetes clusters required.

πŸ€–πŸ§  Half Bot, Half Agent

AI-Git-Bot unites two worlds:

  • As a Bot it automatically reacts to pull requests, answers questions in comments, and delivers context-aware inline reviews β€” like a reliable code-review partner that never sleeps.
  • As an Agent it autonomously takes on entire issues: it analyzes the task, reads the source code, generates an implementation, validates the code with build tools, and creates a finished pull request β€” all on its own.

More than a bot. More than an agent. The intelligent gateway for your entire code review and implementation workflow.

AI-Git-Bot Dashboard

πŸŒ‰ The Gateway Principle

AI-Git-Bot acts as a central gateway between your Git systems and AI providers:

graph LR
    subgraph Git Platforms
        Gitea
        GitHub
        GitLab
        Bitbucket
    end

    subgraph AI Providers
        Anthropic
        OpenAI
        Ollama
        llama.cpp
    end

    Gateway["πŸŒ‰ AI-Git-Bot\n(Gateway)"]
    DB["πŸ—„οΈ PostgreSQL\n(Config & Sessions)"]

    Gitea <--> Gateway
    GitHub <--> Gateway
    GitLab <--> Gateway
    Bitbucket <--> Gateway
    Gateway <--> Anthropic
    Gateway <--> OpenAI
    Gateway <--> Ollama
    Gateway <--> llama.cpp
    Gateway --> DB
Loading

Benefits of the gateway approach:

  • πŸ”— One configuration, many repositories β€” Set up once, use everywhere
  • πŸ”€ Mix & match β€” Combine different AI providers with different Git platforms
  • πŸ›‘οΈ Centralized control β€” Manage API keys, tokens, and prompts in one place
  • πŸ“Š Unified monitoring β€” Dashboard with statistics across all bots
  • πŸ” Encrypted secrets β€” API keys and tokens are stored with AES-256-GCM encryption

Features

πŸ” Automatic PR Code Reviews

When a pull request is opened or updated, the bot automatically reviews the diff and posts feedback as a review comment. Large diffs are intelligently split into chunks with automatic retry on token limits.

πŸ“Έ Screenshots: Code reviews across platforms

Gitea: Gitea Code Review

GitHub: GitHub Code Review

GitLab: GitLab Code Review

Bitbucket: Bitbucket Code Review

πŸ’¬ Interactive Bot Commands

Mention the bot (e.g. @ai_bot) in any PR comment to ask questions or request additional analysis. The bot acknowledges with πŸ‘€ and responds using the full conversation history.

Code Review with Comment

πŸ“ Inline Review Comment Responses

Mention the bot in an inline review comment on a specific code line. The bot includes the file context and diff hunk when generating its answer and replies directly inline.

Code Review with Inline Comment

πŸ€– Autonomous Issue Implementation Agent

Assign the bot to an issue β€” it analyzes the task, reads the source code, generates an implementation, validates with build tools, and creates a finished pull request. Fully autonomous.

πŸ“Έ Screenshots: Agent across platforms

GitHub: GitHub Agent

GitLab: GitLab Agent

See the Agent Documentation for details.

πŸ–₯️ Web-Based Management

All configuration is managed through a web-based UI β€” no environment variables needed for AI providers, Git connections, or bot settings:

  • Create multiple AI Integrations (Anthropic, OpenAI, Ollama, llama.cpp)
  • Create multiple Git Integrations (Gitea, GitHub, GitHub Enterprise, GitLab, Bitbucket Cloud)
  • Create multiple Bots, each with its own webhook URL, AI provider, and system prompt
  • Dashboard with statistics and monitoring

πŸ”Œ Supported AI Providers

Provider Default API URL Suggested Models
Anthropic https://api.anthropic.com claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-5-20251001
OpenAI https://api.openai.com gpt-5.4, gpt-5.3-codex, gpt-5.1-codex-max, gpt-5-codex
Ollama http://localhost:11434 User-configured local models
llama.cpp http://localhost:8081 User-configured GGUF models

🌐 Supported Git Platforms

Provider Description
Gitea Self-hosted Gitea instances
GitHub github.com
GitHub Enterprise Self-hosted GitHub Enterprise Server
GitLab gitlab.com and self-managed GitLab CE/EE
Bitbucket Cloud bitbucket.org

More Features

  • Session Management β€” Maintains conversation history per PR, persisted in the database, enabling context-aware follow-up reviews
  • Configurable System Prompts β€” Select from built-in prompt templates or define custom prompts per bot
  • AI-Driven Code Validation β€” The agent validates generated code with build tools (Maven, Gradle, npm, Go, Cargo, etc.)
  • Health Endpoint β€” /actuator/health for monitoring and orchestration

Docker

The bot is available as a Docker image on Docker Hub.

services:
  app:
    image: tmseidel/ai-git-bot:latest
    ports:
      - "8080:8080"
    environment:
      SPRING_PROFILES_ACTIVE: docker
      DATABASE_URL: jdbc:postgresql://db:5432/giteabot
      DATABASE_USERNAME: ${DATABASE_USERNAME:-giteabot}
      DATABASE_PASSWORD: ${DATABASE_PASSWORD:-giteabot}
      APP_ENCRYPTION_KEY: ${APP_ENCRYPTION_KEY:-change-me}
    depends_on:
      db:
        condition: service_healthy
    restart: unless-stopped

  db:
    image: postgres:17-alpine
    environment:
      POSTGRES_DB: giteabot
      POSTGRES_USER: ${DATABASE_USERNAME:-giteabot}
      POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-giteabot}
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USERNAME:-giteabot}"]
      interval: 5s
      timeout: 5s
      retries: 5
    restart: unless-stopped

volumes:
  pgdata:

Quick Start

1. Start the Application

docker compose up --build -d

This starts:

  • The bot application on port 8080
  • A PostgreSQL 17 database for persistence

2. Initial Setup

  1. Navigate to http://localhost:8080
  2. Create your administrator account
  3. Log in to access the management dashboard

3. Configure Integrations

  1. Create an AI Integration:

    • Go to AI Integrations β†’ New Integration
    • Select a provider (e.g. "anthropic")
    • The API URL is auto-filled with the provider's default
    • Select a model from the dropdown or enter a custom model name
    • Enter your API key
  2. Create a Git Integration:

  3. Create a Bot:

    • Go to Bots β†’ New Bot
    • Select your AI and Git integrations
    • Optionally select a system prompt template
    • Copy the generated Webhook URL

4. Configure Webhooks

Configure webhooks in your Git provider to notify the bot about PR events.

See the User Guide for detailed instructions.

Architecture Overview

graph LR
    Git["Git Platform<br/>(Gitea / GitHub / GitLab / Bitbucket)"]
    Bot["AI-Git-Bot<br/>(Gateway)"]
    AI["AI Provider<br/>(Anthropic / OpenAI / Ollama / llama.cpp)"]
    DB["PostgreSQL"]

    Git -- "Webhooks" --> Bot
    Bot -- "Fetch diff, post reviews" --> Git
    Bot -- "AI review requests" --> AI
    Bot -- "Configuration & Sessions" --> DB
Loading

The bot receives webhooks from your Git provider, fetches PR diffs, sends them to the configured AI provider for review, and posts the results back. All configuration (AI integrations, Git integrations, bots) and conversation sessions are persisted in the database.

➑️ See the Architecture Documentation for detailed component diagrams and request flows.

Documentation

Document Description
User Guide Web UI usage, creating bots and integrations
Architecture Component diagrams, request flows, webhook routing
Agent Autonomous issue implementation agent β€” setup and usage
Git Provider Setup
Gitea Setup Bot user creation, permissions, API tokens for Gitea
GitHub Setup Bot user creation, permissions, PAT tokens for GitHub
GitLab Setup Bot user creation, permissions, PAT tokens for GitLab
Bitbucket Setup API tokens and webhook configuration for Bitbucket Cloud
AI Provider Setup
Using Ollama Running with local LLMs via Ollama
Using llama.cpp Running with llama.cpp and GBNF grammar support
Deployment
Deployment Docker Compose deployment, environment variables
Local Development Building, testing, project structure
Community
Contributing Contribution guidelines, coding conventions
Code of Conduct Community standards

License

MIT