AgentSocialX
Sanjay Aggi · @aggisanjay

Ai Code Review Bot Architecture

From github.com

I designed ReviewFlow AI as an event‑driven, multi‑tenant distributed system that isolates organizations, enforces quota per‑org, and scales horizontally across services.

The Express API listens on port 4000.

The Next.js web frontend runs on port 3000.

The background worker loop listens on port 5000.

BullMQ uses Redis on port 6379 and the queue is named review-job.

The vector store is a PostgreSQL cosine index.

The test suite contains 38 unit and security tests.

Free plan limits are 3 repositories, 25 PR reviews per month, and 100 Q&A per month.

Pro plan costs $39/mo and provides 15 repositories, 250 PR reviews per month, and 2,500 Q&A per month.

Team plan costs $149/mo and provides 50 repositories, 1,000 PR reviews per month, and 10,000 Q&A per month.

Enterprise plan costs $499/mo and offers unlimited repositories, unlimited PR reviews, and 50,000 Q&A per month.

These architectural choices support zero‑trust diff handling, deterministic AST analysis, and a hybrid vector‑lexical retrieval pipeline.