---
title: "Designing Diffwise as a multi-agent AI code review system"
canonical: "https://amartripathi.com/case-studies/diffwise-ai-code-review"
---

# Designing Diffwise as a multi-agent AI code review system

Diffwise is my personal project for incremental AI code review across 40+ specialist agents and nine review categories.

Updated: September 2026

Canonical page: https://amartripathi.com/case-studies/diffwise-ai-code-review

## Quick answer

I designed Diffwise to review changed code with specialist agents instead of sending every file to one prompt. Incremental analysis reduces repeated work, while finding deduplication limits overlapping reports.

## Evidence and decision points

### 40+ agents

Specialist agents inspect changed code through focused review responsibilities.

### Nine categories

The review model separates concerns such as security, correctness, performance, and maintainability.

### 60% token savings

Incremental review avoids repeating unchanged context and reduced token use in project measurements.

## Why one broad prompt was not enough

A broad review prompt can miss specialized concerns and repeat generic advice. It can also create duplicate findings when several checks identify the same underlying issue.

Diffwise separates review responsibilities and combines the results through a controlled finding pipeline.

## Incremental review architecture

The system focuses analysis on changed code and necessary context. Trigger.dev coordinates long-running review work, Redis supports transient state, and PostgreSQL stores durable review data.

OpenRouter provides model access behind the review workflow. Finding similarity uses Jaccard comparison above 0.4 to identify likely duplicates.

- Route relevant changes to focused specialist agents.

- Keep durable review and finding state in PostgreSQL.

- Coordinate background tasks with explicit review status.

- Deduplicate overlapping findings before final presentation.

## What the project demonstrates

Diffwise demonstrates agent workflow design, background execution, structured findings, model integration, and cost-aware incremental analysis.

It is a personal project. The figures describe project measurements and architecture, not a client result.

## Common questions

### Is Diffwise client work?

No. Diffwise is my personal project and demonstrates my system design and implementation work.

### Why use specialist agents?

Focused responsibilities make review criteria clearer and let the system route work by change type.

### Does AI review replace human review?

No. It can find issues and organize evidence. A person still owns acceptance and engineering decisions.

## Sources and further reading

- [OWASP Top 10 for LLM applications](https://genai.owasp.org/llm-top-10/): OWASP documents risks that apply when models process code and use external tools.

- [NIST AI Risk Management Framework](https://www.nist.gov/itl/ai-risk-management-framework): NIST provides a general structure for AI risk, measurement, and governance decisions.

## Related resources

- [AI SaaS development](https://amartripathi.com/services/ai-saas-development)

- [LLM integration](https://amartripathi.com/services/llm-integration)

- [How to hire an AI developer](https://amartripathi.com/guides/how-to-hire-ai-developer)

## Contact

Email Amar Tripathi at [theamartripathi@gmail.com](mailto:theamartripathi@gmail.com) with the product context, current stack, expected outcome, constraints, and target timeline.