DEV Community

Jansen003
Jansen003

Posted on

I Built a 10-Agent AI Code Review System with MiMo — Here's What I Learned

I Built a 10-Agent AI Code Review System with MiMo — Here's What I Learned

10 specialized AI agents review your code in parallel, 30 seconds to produce a risk report with inline comments on GitHub PRs. Here's the architecture and lessons
learned.

THE PROBLEM

Manual code review is slow. A typical PR takes 1-2 hours to review properly. Reviewers miss things when they're tired. "LGTM" becomes a rubber stamp.

I wanted to build something different: 10 domain experts reviewing simultaneously, each focused on their specialty, with a coordinator synthesizing the results.

THE ARCHITECTURE

The system uses LangGraph to orchestrate 9 parallel review agents, with a CoordinatorAgent that:

  • Semantic Deduplication (Jaccard similarity)
  • LLM Conflict Resolution
  • Risk Score Calculation (0-100)

Key Design Decisions:

  1. Parallel, not sequential — LangGraph schedules all 9 agents simultaneously
  2. Semantic deduplication — Different agents may report the same issue; Coordinator uses Jaccard similarity to merge
  3. Conflict resolution — When SecurityAgent says CRITICAL and StyleAgent says LOW, Coordinator uses LLM to determine the correct severity
  4. Risk scoring — Weighted sum (CRITICAL=25, HIGH=15, MEDIUM=5, LOW=1), capped at 100

THE 10 AGENTS

  • SecurityAgent — SQL injection, XSS, secrets, weak crypto, auth flaws
  • LogicAgent — Edge cases, error handling, race conditions, type safety
  • PerformanceAgent — N+1 queries, memory leaks, algorithmic complexity
  • StyleAgent — Naming conventions, formatting, documentation
  • TestAgent — Unit tests, edge case tests, security regression tests
  • DocAgent — API docs, architecture docs, usage examples
  • FixAgent — Generates complete corrected code with root cause analysis
  • RefactorAgent — Design patterns, code transformation, incremental migration
  • RepoAgent — Architecture review, cross-file dependencies, tech debt
  • CoordinatorAgent — Deduplication, conflict resolution, risk scoring, report generation

SUPPORTED LLM BACKENDS

RevHive supports 7 LLM backends:

  • MiMo (Xiaomi) — mimo-v2.5-pro — Default, optimized for token economics
  • DeepSeek — deepseek-chat — Best cost-performance ratio
  • Qwen (Alibaba) — qwen-plus — Alibaba Cloud
  • GLM (Zhipu) — glm-4 — First Chinese LLM support
  • Kimi (Moonshot) — kimi — Long context
  • OpenAI — gpt-4o — International standard
  • Anthropic — claude-sonnet-4 — Best code capability

Usage:
export LLM_API_KEY="sk-xxx" # Any of the 7 backends
revhive review ./my-project

REAL-WORLD USAGE

CLI (30 seconds to start):
# Install
pip install revhive-ai

# Demo mode (no API key needed)
revhive demo

# Real review
export LLM_API_KEY="sk-xxx"
revhive review --file src/main.py

# Review git diff
revhive review --diff HEAD~1

GitHub App (Automatic PR Reviews):
Install the GitHub App → every PR gets reviewed automatically.

Key features:

  • PR Inline Comments — 8 inline comments pinpointing exact lines
  • Quality Gate — commit status pass/fail for branch protection
  • Risk Score — 0-100 score for instant merge decision
  • Free Tier — 50 reviews/month free

Docker:
docker build -t revhive .
docker run --rm -e LLM_API_KEY=your-api-key -v $(pwd):/code revhive review --file /code/src/main.py

LESSONS LEARNED

  1. Parallel Agents Beat Sequential
    Running 9 agents in parallel (via LangGraph) is not just faster — it produces better results. Each agent can focus deeply on its domain without context pollution.

  2. Semantic Deduplication is Critical
    Different agents often report the same issue from different angles. Jaccard similarity on keywords is simple but effective for merging duplicates.

  3. Conflict Resolution Needs LLM
    When agents disagree on severity, simple rules don't work. Using an LLM to resolve conflicts produces more nuanced results than "take the highest severity."

  4. Chinese LLM Market is Underserved
    Most code review tools only support OpenAI/Anthropic. Chinese developers need tools that work with domestic LLMs for cost, latency, and compliance reasons.

  5. Demo Mode is Essential
    A demo mode that works without API keys dramatically lowers the barrier to trial. Users can evaluate the tool's output format and quality before committing.

PROJECT STATUS

TRY IT NOW

# 1. Install
pip install revhive-ai

# 2. Demo (no API key)
revhive demo

# 3. Real review
export LLM_API_KEY="sk-xxx"
revhive review --file src/main.py

# 4. GitHub App (auto PR review)
# https://github.com/apps/revhive-bot


If you find this interesting, give a star ⭐ — it's the biggest encouragement for an indie developer.

Questions, suggestions, or want to discuss multi-agent architecture? Comments below.

Tags: #ai #codereview #multiagent #langgraph #opensource #llm #github #python

Top comments (0)