Building and Deploying Production LLM Code Review Agents: Architecture and Best Practices

ellipsis · Tech · 2024 · source Agentic: yes · promotional bias: med · summary-only (no fetched source) · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Automated software code review

Ellipsis needed production code-review agents that could find useful pull-request issues without flooding developers with false positives, while integrating with GitHub repositories and adapting to customer feedback.

Constraints:

Architecture

Ellipsis routes GitHub events into asynchronous workflows, clones repositories, runs multiple specialized Comment Generator agents in parallel, filters their candidate comments through deduplication, confidence, hallucination, and editing stages, and reuses a Code Search subagent backed by keyword/vector retrieval, incremental indexing, language-server tools, and automated evaluation.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  github-app[GitHub App] --> workflow-queue[Workflow Queue]
  workflow-queue --> repository-clone[Repository Clone]
  workflow-queue --> review-agent[Review Agent]
  repository-clone --> incremental-indexer[Incremental Indexer]
  repository-clone --> review-agent[Review Agent]
  review-agent --> comment-generators[Comment Generators]
  review-agent --> code-search-subagent[Code Search Subagent]
  comment-generators --> filtering-pipeline[Filtering Pipeline]
  code-search-subagent --> incremental-indexer[Incremental Indexer]
  code-search-subagent --> language-server-tools[Language Server Tools]
  filtering-pipeline --> github-app[GitHub App]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
GitHub App Receives installation, pull-request, tag, and review-trigger events from customer repositories. Workflow Queue
Workflow Queue Asynchronously schedules review jobs so accuracy can take priority over immediate latency. Repository Clone, Review Agent
Repository Clone Provides the codebase snapshot to agents and indexing components. Review Agent, Incremental Indexer
Review Agent Coordinates comment generators and filtering for a pull request. Comment Generators, Filtering Pipeline, Code Search Subagent
Comment Generators Parallel specialized agents that identify candidate review comments. Code Search Subagent, Filtering Pipeline
Filtering Pipeline Deduplicates, confidence-filters, hallucination-checks, and edits candidate comments. Comment Generators, GitHub App
Code Search Subagent Reusable RAG agent for code review, code generation, and codebase chat. Incremental Indexer, Language Server Tools, Review Agent
Incremental Indexer Embeds changed code chunks and file summaries without reindexing entire repositories. Code Search Subagent, Repository Clone
Language Server Tools Provide IDE-like symbol navigation with fuzzy line/column handling. Code Search Subagent

Data flow

A GitHub PR event enters the workflow queue, the repository is cloned, specialized comment generators inspect the change in parallel, Code Search retrieves supporting context, filters remove duplicates and hallucinations, and only surviving comments are posted or surfaced with reasoning.

“Webhook events from GitHub are routed through Hookdeck for reliability guarantees, then forwarded to a FastAPI web application.”summary, stated
“multiple Comment Generators run in parallel to identify different types of issues. One generator might look for violations of customer-defined rules, another searches for duplicated code”summary, stated

Why this architecture

Ellipsis decomposed code review into smaller independently benchmarkable agents because one large prompt made the task too hard, while asynchronous review allowed deeper retrieval and filtering. Feedback search and modular evals favored operational iteration over slow per-customer fine-tuning.

“rather than building one large agent with a massive prompt, Ellipsis uses dozens of smaller agents that can be independently benchmarked and optimized.”summary, stated
“latency becomes less critical than accuracy. This is an important consideration for LLMOps practitioners, as it allows for more comprehensive processing”summary, stated

Models used: Claude 3.5 Sonnet · GPT-4o · o1 · LLM-based binary classifiers

Scale

Alternatives considered (roads not taken)

A single large review agent prompt.

Rejected because: The team found it better to split difficult review work into simpler subagents that could be benchmarked independently.

“rather than building one large agent with a massive prompt, Ellipsis uses dozens of smaller agents that can be independently benchmarked and optimized.”summary, stated

Per-customer fine-tuned models for feedback.

Rejected because: Embedding search over historical thumbs up/down feedback updated behavior faster and was easier to maintain.

“This approach has several advantages over fine-tuning: more consistent behavior, near-immediate reflection of feedback in agent behavior (no retraining delay), and easier maintenance.”summary, stated

Re-embedding the whole repository on every commit.

Rejected because: Chunk hashes let the system delete obsolete vectors and embed only new chunks.

“Despite latency not being the primary concern, blocking PR review on slow repository indexing was unacceptable. Ellipsis uses Turbopuffer as their vector store and implements an efficient incremental indexing approach. The key insight is avoiding re-embedding the entire repository on every commit.”summary, stated

Patterns

multi-agent-orchestration (agent architecture)

Specialized comment generators run in parallel and are filtered into final code-review comments.

“First, multiple Comment Generators run in parallel to identify different types of issues.”summary, stated

rag-retrieval (retrieval)

The Code Search subagent combines keyword and vector retrieval over chunked code and file summaries.

“The Code Search agent implements a multi-step RAG+ approach combining keyword and vector search.”summary, stated

confidence-thresholding (quality control)

Candidate comments are thresholded by confidence before reaching developers.

“Confidence Filter: Applies threshold-based filtering on comment confidence scores”summary, stated

eval-driven-development (evaluation)

New agents are developed through benchmarks, LLM auditors, failure-class diagnosis, and repeated prompt/tool updates.

“Their developer workflow for adding new agents follows an iterative pattern: writing initial prompts and tools, sanity checking examples, finding correctness measures”summary, stated

fallback-degradation (reliability)

Failures are isolated at model, tool, and agent levels so the review can degrade instead of collapsing.

“Error handling operates at multiple levels: • Simple retries and timeouts on LLM calls • Model fallbacks”summary, stated

Tradeoffs

Review decomposition

Chose Dozens of small specialized agents over One large review prompt.

Rationale: Smaller agents are easier for the LLM to solve, benchmark, and optimize independently.

“This follows the prompt engineering principle that "to increase performance, make the problem easier for the LLM to solve."”summary, stated

Feedback adaptation

Chose Embedding search over historical reactions over Per-customer fine-tuning.

Rationale: The approach reflects feedback immediately and avoids slower retraining loops.

“Thumbs up/down reactions are used through embedding search over similar past comments, allowing the system to learn from historical reactions.”summary, stated

Production robustness

Chose Layered graceful degradation over Assuming test performance predicts runtime behavior.

Rationale: Probabilistic LLM behavior requires retries, fallback models, tool isolation, and transparent user messaging.

“LLMs' probabilistic nature requires building in graceful error handling from the beginning, regardless of how well tasks perform in testing.”summary, stated

Gotchas (what bit them)

False positives are the central trust failure in AI code review.

Root cause: Parallel generators can overlap, hallucinate, or produce weak comments without downstream filtering.

Resolution: Add deduplication, confidence, hallucination, and editing filters before posting comments.

“a multistage Filtering Pipeline processes the raw comments to significantly reduce false positive rates - identified as developers' most common complaint”summary, stated

Large code-search contexts can degrade LLM performance.

Root cause: Traditional retrieval can include code that ranks well but is not useful for the current agent trajectory.

Resolution: Use an LLM binary classifier after vector search to keep only useful retrieved pieces.

“they run an LLM-based binary classifier after vector search, using additional context from the agent trajectory to select truly relevant pieces.”summary, stated

LLMs are bad at exact code coordinates.

Root cause: They often miss column numbers and line numbers for language-server calls.

Resolution: Let the agent specify symbol names and fuzzy-match to the closest symbol.

“LLMs are notoriously bad at correctly identifying column numbers and often off-by-one on line numbers”summary, stated

Evaluation

Ellipsis combines deterministic edit checks, LLM-as-judge comparisons to ground truth, mini-benchmarks, LLM-augmented fuzzing, trajectory auditing, and production edge-case sampling.

Metrics: Mini-benchmark accuracy · False positive reduction · Code Search judgment quality · Agent failure classes · Production edge cases

“For evaluation, deterministic assessment is preferred where possible (e.g., comparing file edits to expected outputs with fuzzy whitespace handling).”summary, stated
“An Auditor agent runs on failed test cases to diagnose where in the trajectory things went wrong.”summary, stated

Outcomes

The source provides operational design detail, mini-benchmark size, and seconds-level incremental indexing claims, but not customer-level volume or false-positive reduction metrics.

“No quantitative results are provided - claims about "significantly reduced false positive rates" and accuracy improvements are not backed by specific numbers.”summary, stated