# suchi-bits/code-review-agent-with-context-engineering architecture

> Architecture diagram of the GitHub repository suchi-bits/code-review-agent-with-context-engineering, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/suchi-bits/code-review-agent-with-context-engineering
- Repository: https://github.com/suchi-bits/code-review-agent-with-context-engineering

## Overview

This repository describes a code-review agent that accepts a diff, retrieves relevant standards and prior patterns, performs isolated security, performance, and style reviews, compresses findings, stores reusable patterns, and presents a review. The architecture is documented primarily in the README; the sampled source confirms the knowledge-base and memory components and parts of the review implementation. Since the workflow wiring is not shown in the excerpt, its documented stage relationships are cited to the README.

Main entry points: [`code.py`](https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py) (Retrieve Context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_review["Review Workflow"]
  node_parse["Parse Diff<br/>[code.py]"]
  node_security["Security Review<br/>[code.py]"]
  node_performance["Performance Review<br/>[code.py]"]
  node_style["Style Review<br/>[code.py]"]
  node_compress["Compress Findings<br/>[code.py]"]
  node_report["Review Report<br/>[code.py]"]
end

subgraph group_context["Context Systems"]
  node_retrieve["Retrieve Context<br/>[code.py]"]
  node_knowledge["Coding Standards RAG<br/>[code.py]"]
end

subgraph group_memory["Memory"]
  node_patterns[("Past Patterns<br/>[code.py]")]
  node_store["Store Patterns<br/>[code.py]"]
  node_short_memory[("Checkpoint State<br/>[code.py]")]
end

node_developer(("Code Author"))
node_consumer(("Review Consumer"))

node_developer -->|"submits diff"| node_parse
node_parse -->|"passes metadata"| node_retrieve
node_retrieve -->|"queries standards"| node_knowledge
node_retrieve -->|"selects patterns"| node_patterns
node_retrieve -->|"provides context"| node_security
node_security -->|"continues review"| node_performance
node_performance -->|"continues review"| node_style
node_style -->|"passes findings"| node_compress
node_compress -->|"extracts patterns"| node_store
node_store -->|"writes patterns"| node_patterns
node_compress -.->|"provides summary"| node_report
node_report -->|"presents review"| node_consumer

click node_parse "https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py"
click node_retrieve "https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py"
click node_knowledge "https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py"
click node_patterns "https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py"
click node_security "https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py"
click node_performance "https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py"
click node_style "https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py"
click node_compress "https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py"
click node_store "https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py"
click node_short_memory "https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py"
click node_report "https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_parse,node_security,node_performance,node_style,node_compress,node_report,node_consumer toneBlue
class node_retrieve,node_knowledge toneAmber
class node_patterns,node_store,node_short_memory toneMint
class node_developer toneIndigo
```

## Components

### Review Workflow

- [Parse Diff](https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py): `code.py`
- [Security Review](https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py): `code.py`
- [Performance Review](https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py): `code.py`
- [Style Review](https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py): `code.py`
- [Compress Findings](https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py): `code.py`
- [Review Report](https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py): `code.py`

### Context Systems

- [Retrieve Context](https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py): `code.py`
- [Coding Standards RAG](https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py): `code.py`

### Memory

- [Past Patterns](https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py): `code.py`
- [Store Patterns](https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py): `code.py`
- [Checkpoint State](https://github.com/suchi-bits/code-review-agent-with-context-engineering/blob/main/code.py): `code.py`

### Other components

- **Code Author**
- **Review Consumer**

## Connections

- Code Author → Parse Diff: submits diff (evidence: `README.md`)
- Parse Diff → Retrieve Context: passes metadata (evidence: `README.md`)
- Retrieve Context → Coding Standards RAG: queries standards (evidence: `README.md`)
- Retrieve Context → Past Patterns: selects patterns (evidence: `README.md`)
- Retrieve Context → Security Review: provides context (evidence: `README.md`)
- Security Review → Performance Review: continues review (evidence: `README.md`)
- Performance Review → Style Review: continues review (evidence: `README.md`)
- Style Review → Compress Findings: passes findings (evidence: `README.md`)
- Compress Findings → Store Patterns: extracts patterns (evidence: `README.md`)
- Store Patterns → Past Patterns: writes patterns (evidence: `README.md`)
- Compress Findings → Review Report: provides summary (evidence: `code.py`)
- Review Report → Review Consumer: presents review (evidence: `README.md`)
