Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 9 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Open-source AI code review for GitHub PRs. Works with **any LLM provider**.

## Architecture Overview
## How It Works

```mermaid
flowchart TD
Expand All @@ -27,6 +27,14 @@ flowchart TD
CHK -- Issues found --> A2 --> CM
```

1. Triggers on PR open/update
2. Fetches code diff from GitHub
3. Encodes all changed chunks into token-efficient TOON format
4. **Agent 1 (Reviewer)** — sends the full TOON diff to a cheap/fast model; detects `BUG`, `SECURITY`, `PERFORMANCE`, `BEST_PRACTICE` issues and returns a typed list
5. If no issues are found → pipeline stops; **Agent 2 is never called** (zero extra cost)
6. **Agent 2 (Explainer+Fixer)** — for each flagged chunk (not the full diff), generates an explanation and corrected code in a single LLM call; all issues are processed in parallel
7. Posts inline PR comments with: issue type label, concise explanation, and a GitHub suggestion block with the fixed code

## Features

- 🔓 **Open Source** - Self-hostable, no vendor lock-in
Expand Down Expand Up @@ -171,27 +179,6 @@ LLM_BASE_URL: "https://openrouter.ai/api/v1"

---

## How It Works

```mermaid
flowchart TD
A([PR Opened / Updated]) --> B[Fetch Diff from GitHub]
B --> C[TOON Encode all chunks]
C --> D[Agent 1: Reviewer\nfast / cheap model]
D --> E{Issues found?}
E -- No --> F([Done — zero fixer cost])
E -- Yes --> G[Agent 2: Explainer + Fixer\nsmarter model\nparallel per issue]
G --> H[Post inline PR comments\nwith explanation + fix suggestion]
```

1. Triggers on PR open/update
2. Fetches code diff from GitHub
3. Encodes all changed chunks into token-efficient TOON format
4. **Agent 1 (Reviewer)** — sends the full TOON diff to a cheap/fast model; detects `BUG`, `SECURITY`, `PERFORMANCE`, `BEST_PRACTICE` issues and returns a typed list
5. If no issues are found → pipeline stops; **Agent 2 is never called** (zero extra cost)
6. **Agent 2 (Explainer+Fixer)** — for each flagged chunk (not the full diff), generates an explanation and corrected code in a single LLM call; all issues are processed in parallel
7. Posts inline PR comments with: issue type label, concise explanation, and a GitHub suggestion block with the fixed code

---

## Cost Comparison
Expand Down
Loading