How wiljav/pr-agent works
PR-Agent is an AI-powered pull-request review and automation service. Users invoke it through the CLI, GitHub Actions, or platform webhooks; the agent resolves the requested command, obtains PR data through a Git-provider adapter, prepares diffs and prompts, calls an AI backend, and publishes results through the provider. The graph also preserves README-listed tools and platform integrations. Several tool and server implementations were not excerpted, so their capabilities are documented but only evidenced relationships are connected.
Main entry points: pr_agent.py Command agent · pr_processing.py Diff preparation · pr_reviewer.py PR review · git_provider.py Provider interface
Components 22
Entry points
- CLI
pr_agent/cli.py - Webhook servers
pr_agent/servers - Command agent
pr_agent/agent/pr_agent.py - Settings
pr_agent/config_loader.py
Git platforms
- Provider factory
pr_agent/git_providers/__init__.py - Provider interface
pr_agent/git_providers/git_provider.py - Provider adapters
pr_agent/git_providers
Review preparation
- Diff preparation
pr_agent/algo/pr_processing.py - Patch processing
pr_agent/algo/git_patch_processing.py - File filtering
pr_agent/algo/file_filter.py - Language detection
pr_agent/algo/language_handler.py - Token handling
pr_agent/algo/token_handler.py - AI handler interface
pr_agent/algo/ai_handlers/base_ai_handler.py - LiteLLM backend
pr_agent/algo/ai_handlers/litellm_ai_handler.py
PR tools
- PR review
pr_agent/tools/pr_reviewer.py - PR description
pr_agent/tools/pr_description.py - Code suggestions
pr_agent/tools/pr_code_suggestions.py - Ticket compliance
pr_agent/tools/ticket_pr_compliance_check.py - Other PR tools
pr_agent/tools
Other components
- User or event
- Git hosting service
- AI model service
Connections 28
- User or event → CLI: runs command
- CLI → Command agent: dispatches request
pr_agent/cli.py - User or event → Webhook servers: sends PR event
- Webhook servers → Command agent: handles request
pr_agent/servers/gitlab_webhook.py - Command agent → Settings: loads settings
pr_agent/agent/pr_agent.py - Command agent → PR review: dispatches tool
pr_agent/agent/pr_agent.py - Command agent → PR description: dispatches tool
pr_agent/agent/pr_agent.py - Command agent → Code suggestions: dispatches tool
pr_agent/agent/pr_agent.py - Command agent → Other PR tools: dispatches tools
pr_agent/agent/pr_agent.py - Provider factory → Provider adapters: selects adapter
pr_agent/git_providers/__init__.py - Provider adapters → Provider interface: implements interface
pr_agent/git_providers/__init__.py - Provider adapters → Git hosting service: reads and writes PRs
- PR review → Provider factory: gets PR provider
pr_agent/tools/pr_reviewer.py - PR review → Diff preparation: prepares diff
pr_agent/tools/pr_reviewer.py - Diff preparation → File filtering: filters files
pr_agent/algo/pr_processing.py - Diff preparation → Patch processing: processes patches
pr_agent/algo/pr_processing.py - Diff preparation → Language detection: detects languages
pr_agent/algo/pr_processing.py - Diff preparation → Token handling: counts tokens
pr_agent/algo/pr_processing.py - PR review → AI handler interface: requests completion
pr_agent/tools/pr_reviewer.py - LiteLLM backend → AI handler interface: implements interface
pr_agent/algo/ai_handlers/litellm_ai_handler.py - LiteLLM backend → AI model service: requests completion
- PR review → Provider interface: publishes review
pr_agent/tools/pr_reviewer.py - PR description → Diff preparation: prepares PR context
pr_agent/tools/pr_description.py - PR description → Ticket compliance: checks compliance
pr_agent/tools/pr_description.py - Code suggestions → Diff preparation: prepares code context
pr_agent/tools/pr_code_suggestions.py - Code suggestions → Provider interface: publishes suggestions
pr_agent/tools/pr_code_suggestions.py - Ticket compliance → Provider factory: gets PR provider
pr_agent/tools/ticket_pr_compliance_check.py - Other PR tools → Provider interface: uses PR data
pr_agent/tools/pr_reviewer.py