{"slug": "prism-reviewer-multi-agent-ai-code-reviewer-built-with-langgraph-and-litellm", "title": "Prism Reviewer – Multi-agent AI code reviewer built with LangGraph and LiteLLM", "summary": "Vyoman Labs released Prism Reviewer, a multi-agent AI code review system built with LangGraph and LiteLLM that splits git diffs into parallel security, design, and code-quality analyses. The tool supports Python, Java, TypeScript, JavaScript, C, C++, Go, and Rust via Tree-Sitter, scans dependencies, and uses a map-reduce graph with a verifier to prevent hallucinations and duplicates. It is available as a GitHub Action and CLI, with a live demo on savourly-recipes PR #35.", "body_md": "# Prism Reviewer AI\n\nActions## About\n\n[vyoman-labs](/vyoman-labs)\n\n## Tags\n\n(2)Developed by\n\n[Vyoman Labs]\n\nPrism Reviewer is an agentic, AI-driven multi-agent code review system developed by **Vyoman Labs** and orchestrated via [LangGraph](https://github.com/langchain-ai/langgraph) and [LiteLLM](https://github.com/BerriAI/litellm). It acts as an autonomous gatekeeper for pull requests by performing targeted static analysis, dependency scanning, AST-based symbol inspection, and parallel LLM-guided code evaluation.\n\nAdd this minimal workflow snippet to `.github/workflows/prism-reviewer.yml`\n\n:\n\n```\n- uses: actions/checkout@v4\n  with:\n    fetch-depth: 0\n- uses: vyoman-labs/prism-reviewer@v1\n  with:\n    llm-api-key: ${{ secrets.LLM_API_KEY }}\n```\n\n🔍 **Live Demo PR**: See real Prism Reviewer comments in action on [savourly-recipes PR #35](https://github.com/aravinthan-n/savourly-recipes/pull/35).\n\n[🔍 System Description](#1-system-description)[📐 Architecture and Flow](#2-architecture-and-flow)[🧠 Key Intricacies and Design Decisions](#3-key-intricacies-and-design-decisions)[🔧 Installation](#4-installation)[📦 Packaging and Distribution](#5-packaging-and-distribution)[💻 CLI Usage](#6-cli-usage)[🔩 Configuration Guide](#7-configuration-guide)[🔌 Running Reviews Locally via GitHub PR ID](#8-running-reviews-locally-via-github-pr-id)[🔗 GitHub App and Integration Setup](#9-github-app-and-integration-setup)[📝 Notes Limitations and Roadmap](#10-notes-limitations-and-roadmap)[Why Prism Reviewer? 🌈](#11-why-prism-reviewer)\n\nPrism Reviewer splits a single code changes delta (git diff) into specialized analytical spectrums using an Agent Council. Instead of sending a monolithic prompt to a single LLM, it routes structural, security, and tactical code context in parallel to three distinct agent roles. Combined with the local AST syntax trees, dependency warnings, and usage reference searches, it compiles a rigorous, context-aware code review report categorized by severity.\n\n**Deterministic Evaluation**: Supports zero temperature, fixed seed routing, and structured JSON output to eliminate probabilistic drift across runs.**AST CodeLens Map**: Leverages Tree-Sitter grammars (supporting Python, Java, TypeScript, JavaScript, C, C++, Go, and Rust) to extract class, function, and method ranges before scanning.**Dependency Warnings**: Scans requirements files (`requirements.txt`\n\n,`package.json`\n\n,`pyproject.toml`\n\n) for dependency configuration anomalies.**Map-Reduce Parallelism**: Orchestrated through a LangGraph`StateGraph`\n\n, enabling concurrent LLM agent queries.**Dual-Safeguard Verification**: Fact-checks and filters findings against changed lines and previous review states to ensure zero hallucinations and zero duplication.\n\nThe review execution lifecycle is modeled as a LangGraph workspace map-reduce graph, organized as follows:\n\n``` php\nflowchart TD\n    START([START]) --> FetchComments[\"Fetch Prior PR Comments & Discussion<br/>(Filtered: MAJOR & CRITICAL)\"]\n    FetchComments --> BuildContext[Build Context Node]\n    BuildContext --> |Partition Diff into Regions & Fan Out| Router{_fan_out_router}\n    Router -->|Region 1..N| Warden[👮 Warden Node<br/>Security & Compliance]\n    Router -->|Region 1..N| Architect[📐 Architect Node<br/>Design & Performance]\n    Router -->|Region 1..N| Inspector[🔍 Inspector Node<br/>Clean Code & Logic]\n    Warden --> Join{Join}\n    Architect --> Join\n    Inspector --> Join\n    Join --> Verifier[🛡️ Verifier Node<br/>Hallucination Guard & Deduplication]\n    Verifier --> Aggregator[📊 Aggregator Node<br/>Severity Sorting & Report Render]\n    Aggregator --> END([END])\n```\n\n(implemented in`fetch_pull_request_comments`\n\n[github.py](/vyoman-labs/prism-reviewer/blob/main/src/prism_reviewer/services/github.py)): Queries previous inline review comment threads and general PR discussions via GitHub API, filtering for`MAJOR`\n\nand`CRITICAL`\n\nseverity feedback (ignoring low-priority`ADVISORY`\n\ncomments) to pass as conversation history.(implemented in`build_context_node`\n\n[nodes.py](/vyoman-labs/prism-reviewer/blob/main/src/prism_reviewer/agents/nodes.py)): Gathers directory profiles, runs AST scans on modified files, scans dependencies, parses usage references, and slices large diffs into logical regions.(implemented in`_fan_out_router`\n\n[graph.py](/vyoman-labs/prism-reviewer/blob/main/src/prism_reviewer/agents/graph.py)): Routes each region to all three agent nodes concurrently.**Agent Council**:- 👮\n**Warden Node**: Evaluates vulnerabilities, exposed credentials, loose dependencies, data leaks, and verifies if past security feedback was addressed. - 📐\n**Architect Node**: Audits architectural design, design pattern compliance, performance traps, and checks if past structural feedback was resolved. - 🔍\n**Inspector Node**: Targets clean code compliance, readability, minor logic bugs, and validates fixes for past logic findings.\n\n- 👮\n(implemented in`verifier_node`\n\n[verifier.py](/vyoman-labs/prism-reviewer/blob/main/src/prism_reviewer/agents/verifier.py)): Performs double-guard filtering (hallucination checks & duplicate suppression).(implemented in`aggregator_node`\n\n[aggregator.py](/vyoman-labs/prism-reviewer/blob/main/src/prism_reviewer/agents/aggregator.py)): Sorts findings by severity (CRITICAL → MAJOR → ADVISORY) and renders the report.\n\nLarge code deltas exceed single-turn LLM context limits or result in degraded review quality. Prism Reviewer slices large diffs into localized, file-level regions based on line count constraints (configured by `max_region_lines`\n\n). The router fans out separate state objects per region to the agent council. LangGraph automatically gathers and aggregates the findings once all region runs complete.\n\n**Hallucination Guard**: Generative agents may comment on files or line numbers that do not exist or were not modified. The verifier compiles a precise index of modified`(filename, line_number)`\n\npairs from the raw git diff. Any finding pointing to a line outside this set is dropped.**Idempotent Deduplication**: Running reviews continuously on every synchronization push can overwhelm developers with duplicate warnings on unchanged code blocks. The system computes a content-hash signature for each finding based on the file path, line number, agent type, and the surrounding diff content. These signatures are stored in[signatures.json](/vyoman-labs/prism-reviewer/blob/main/.prism_reviewer/signatures.json). Subsequent runs skip findings with matching signatures.\n\nStandard terminal log writers interleave messages when multiple threads execute in parallel. To preserve clean CLI logs, Prism Reviewer implements `NodeLogger`\n\n(defined in [nodes.py](/vyoman-labs/prism-reviewer/blob/main/src/prism_reviewer/agents/nodes.py)). This class buffers per-agent log entries in memory and flushes them as a single atomic log block on node completion.\n\nRunning full PR reviews on every push update can consume significant LLM API tokens. Prism Reviewer implements a **Smart Hybrid Review Strategy** to cut LLM token costs by up to 90% on PR updates while preserving PR-wide architectural context and avoiding review quality degradation:\n\n``` php\nflowchart TD\n    A[\"PR Event Triggered\"] --> B{\"Event Type / Diff Mode\"}\n    B -- \"Initial PR / Full Sync / Manual\" --> C[\"Full PR Review Mode\"]\n    B -- \"Push Update / Incremental\" --> D[\"Smart Incremental Review Mode\"]\n\n    C --> E[\"Diff: base_branch..HEAD\"]\n    C --> F[\"Full PR Context + Full LLM Scan\"]\n    \n    D --> G[\"Diff: previous_commit..HEAD\"]\n    D --> H[\"Pass Full PR Touched Files + CodeLens AST Map + Prior PR Comments (MAJOR/CRITICAL)\"]\n    D --> I[\"LLM Evaluates New Diff with PR Context & Prior Discussion\"]\n\n    E --> J[\"Verifier Node & Signatures\"]\n    G --> J\n    J --> K[\"Update PR Summary & Inline Comments\"]\n```\n\n**Full PR Review Mode (**: Used on initial PR creation (`full`\n\n)`pull_request.opened`\n\n), milestone reviews, or manual trigger (`/prism full-review`\n\n). Compares`base_branch..HEAD`\n\n.**Smart Incremental Mode (**: Used on push updates (`incremental`\n\n/`auto`\n\n)`pull_request.synchronize`\n\n). Evaluates only the newly modified commits (`previous_sha..HEAD`\n\n), while maintaining full PR awareness by injecting the complete PR touched file list, CodeLens AST dependency map, and prior`MAJOR`\n\n/`CRITICAL`\n\nPR comment threads into the prompt context.\n\nTo install Prism Reviewer in editable mode for local development:\n\n```\npip install -e .\n```\n\nTo install with development dependencies (e.g., for running the test suite):\n\n```\npip install -e \".[dev]\"\n```\n\nPrism Reviewer is packaged using standard Python packaging utilities and `setuptools`\n\n(configured in `pyproject.toml`\n\n).\n\nBefore building your distribution packages, ensure you have the python build modules `build`\n\nand `twine`\n\ninstalled:\n\n```\npip install --upgrade build twine\n```\n\nFrom the root directory of the repository (where `pyproject.toml`\n\nis located), execute the build wrapper to compile the source distribution tarball (`.tar.gz`\n\n) and Python wheel binary (`.whl`\n\n):\n\n```\npython -m build\n```\n\nThis command compiles and outputs the distribution assets into the `dist/`\n\ndirectory.\n\nTo verify that the package parses and installs correctly without affecting production indices, publish your packages to the TestPyPI repository:\n\n```\npython -m twine upload --repository testpypi dist/*\n```\n\nWhen prompted, log in using the username `__token__`\n\nand your corresponding TestPyPI API token as the password.\n\nOnce testing succeeds, release the verified distribution packages directly to the production Python Package Index (PyPI):\n\n```\npython -m twine upload dist/*\n```\n\nLog in using the username `__token__`\n\nand your production PyPI API token as the password.\n\nWhenever a new GitHub release is published, the repository automatically builds and publishes the package to TestPyPI via the [publish-testpypi.yml](/vyoman-labs/prism-reviewer/blob/main/.github/workflows/publish-testpypi.yml) workflow.\n\nTo enable publication, configure one of the following authentication methods on GitHub:\n\n**PyPI Trusted Publishing (OIDC - Recommended)**: Configure a Trusted Publisher on[test.pypi.org](https://test.pypi.org)matching your GitHub repository (`vyoman-labs/prism-reviewer`\n\n), workflow file`publish-testpypi.yml`\n\n, and environment name`testpypi`\n\n.**API Token Fallback**: Alternatively, add a GitHub repository secret named`TEST_PYPI_API_TOKEN`\n\ncontaining your TestPyPI API token.\n\nProduction releases to PyPI are managed via the dedicated [publish-pypi.yml](/vyoman-labs/prism-reviewer/blob/main/.github/workflows/publish-pypi.yml) workflow.\n\nYou can toggle PyPI publishing in **two convenient ways**:\n\n- Create a release as usual at\n`https://github.com/vyoman-labs/prism-reviewer/releases/new`\n\n. - By default, publishing goes to\n**TestPyPI**. - To\n**enable PyPI publishing**, simply include`[pypi]`\n\nor`[publish-pypi]`\n\nanywhere in the**Release description / notes** field.\n\n*(GitHub's native release page does not support custom HTML form checkboxes, so a visual UI form is available in GitHub Actions)*:\n\n- Navigate to\n**Actions**>** Publish Package to PyPI**in your GitHub repository. - Click\n**Run workflow** to open the visual checkbox modal:: Checkbox to publish to TestPyPI (`publish_testpypi`\n\n`test.pypi.org`\n\n) (Default:).`true`\n\n: Checkbox to publish to PyPI (`publish_pypi`\n\n`pypi.org`\n\n) (Default:).`false`\n\n:`tag_name`\n\n*(Optional)*Release version tag (e.g.,`v1.0.0`\n\n).:`create_release`\n\n*(Optional)*Checkbox toggle to automatically create/publish the GitHub Release for you.\n\nTo enable automated publication without managing API tokens:\n\n- Go to your PyPI account on\n[pypi.org](https://pypi.org)>**Account Settings**>** Publishing**. - Add a new GitHub publisher with the following details:\n**Owner**:`vyoman-labs`\n\n**Repository**:`prism-reviewer`\n\n**Workflow name**:`publish-pypi.yml`\n\n**Environment name**:`pypi`\n\nYou can invoke the review agent via the registered CLI executable:\n\n```\nprism-review --pr --repo /path/to/your/repo --base main\n```\n\nOr execute it as a Python module:\n\n```\npython -m prism_reviewer.cli --pr --repo /path/to/your/repo --base main\n```\n\n| Argument | Type | Description |\n|---|---|---|\n`--pr` |\nFlag | Runs the core Prism Reviewer agentic process. |\n`--repo` |\nPath | Path to the target repository (defaults to the current working directory). |\n`--base` |\nString | Base branch or commit for git comparison (defaults to `unstaged` ). |\n`--diff` |\nString | Optional. Prints local git diff. Values: `unstaged` (default), `staged` , or specific commit. |\n`--structure` |\nFlag | Displays the directory structure of tracked files in JSON format. |\n`--scan-deps` |\nFlag | Scans project manifests (`requirements.txt` , `package.json` , `pyproject.toml` ). |\n`--search` |\nString | Run regex search query across files. |\n`--methods` |\nPath | Extracts AST symbols (classes, functions, methods) from the target file. |\n`--context` |\nPath | Optional. Path to custom project context markdown file (defaults to `.prism_reviewer/context.md` ). |\n`--rules` |\nPath | Optional. Path to custom repository review rules markdown file (defaults to `.prism_reviewer/rules.md` ). |\n`--diff-mode` |\nString | Optional. Git diff strategy for review: `auto` (default), `full` , or `incremental` . |\n`--compare-range` |\nString | Optional. Explicit commit range or base for comparison (e.g. `SHA1..SHA2` or `origin/main` ). |\n\nPrism Reviewer uses a centralized config system driven by [ src/prism_reviewer/prism_reviewer.toml](/vyoman-labs/prism-reviewer/blob/main/src/prism_reviewer/prism_reviewer.toml). Placing a\n\n`prism_reviewer.toml`\n\nin your repository root is optional—if omitted, Prism Reviewer automatically loads built-in package defaults. Numeric parameters are dynamically cast, and environment variable overrides are supported using the `${VAR_NAME|-default_value}`\n\nformat. You can define environment variables in a `.env`\n\nfile (see `.env.example`\n\n) in your project root or pass them via shell environment variables.| Parameter | Default / Placeholder | Description |\n|---|---|---|\n`token` |\n`${GITHUB_TOKEN}` |\nGitHub Personal Access Token or Installation Token. |\n`summary_mode` |\n`${PRISM_SUMMARY_MODE|-update}` |\nControls how the PR summary comment is posted on each run. `\"update\"` (default) edits the existing Prism Reviewer summary comment in-place at the top of the PR, preserving prior review reports in collapsible HTML foldouts. `\"append\"` posts a new summary comment on every push (legacy behaviour). |\n`include_previous_comments` |\n`${PRISM_INCLUDE_PREVIOUS_COMMENTS|-true}` |\nEnables fetching prior PR review comments & discussions for LLM prompt context. |\n`max_previous_comments` |\n`${PRISM_MAX_PREVIOUS_COMMENTS|-30}` |\nMaximum number of prior `MAJOR` & `CRITICAL` severity comments to include. |\n\n| Parameter | Default / Placeholder | Description |\n|---|---|---|\n`api_key` |\n`${LLM_PROVIDER_API_KEY}` |\nAPI credential key for the LiteLLM backend. |\n`model` |\n`${LLM_MODEL}` |\nTarget model identifier used for all agents (e.g., `openai/gpt-4o` , `anthropic/claude-3-5-sonnet` ). |\n\n| Parameter | Default / Placeholder | Description |\n|---|---|---|\n`max_requests_per_minute` |\n`${MAX_REQUESTS_PER_MINUTE|-60}` |\nAPI rate throttle limit per minute. |\n`max_concurrent_requests` |\n`${MAX_CONCURRENT_REQUESTS|-10}` |\nMax parallel connections allowed. |\n`retries` |\n`${RETRIES|-4}` |\nNumber of backoff retries on connection failures (5 total attempts). |\n`backoff_seconds` |\n`${BACKOFF_SECONDS|-15}` |\nExponential retry multiplier factor. |\n`request_timeout` |\n`${LLM_REQUEST_TIMEOUT|-120}` |\nMaximum seconds to wait for an LLM completion request before timing out. |\n\n| Parameter | Default / Placeholder | Description |\n|---|---|---|\n`mode` |\n`${AGENTS_MODE|-parallel}` |\nExecutes agent council in `parallel` or `sequential` mode. |\n`max_region_lines` |\n`${MAX_REGION_LINES|-500}` |\nMaximum lines per git diff slice region. |\n`max_readme_chars` |\n`${MAX_README_CHARS|-10000}` |\nMaximum characters of root `README.md` included in review context. |\n\n| Agent | Default / Placeholder | Description |\n|---|---|---|\n`warden` |\n`${WARDEN_REASONING_EFFORT|-high}` |\nAppSec audits benefit from deep cognitive reasoning. |\n`architect` |\n`${ARCHITECT_REASONING_EFFORT|-medium}` |\nEvaluates structural coupling and performance traps. |\n`inspector` |\n`${INSPECTOR_REASONING_EFFORT|-medium}` |\nEvaluates local variable smells and code readabilities. |\n`verifier` |\n`${VERIFIER_REASONING_EFFORT|-low}` |\nMechanical validation requires minimal reasoning. |\n\n| Agent | Default / Placeholder | Description |\n|---|---|---|\n`warden` |\n`${WARDEN_MODEL_OVERRIDE}` |\nModel override for security agent. |\n`architect` |\n`${ARCHITECT_MODEL_OVERRIDE}` |\nModel override for architectural agent. |\n`inspector` |\n`${INSPECTOR_MODEL_OVERRIDE}` |\nModel override for inspector agent. |\n`verifier` |\n`${VERIFIER_MODEL_OVERRIDE}` |\nModel override for verifier agent. |\n\n| Parameter | Default / Placeholder | Description |\n|---|---|---|\n`max_search_files` |\n`${MAX_SEARCH_FILES|-25}` |\nMaximum number of touched files analyzed in cross-reference search. |\n\n| Parameter | Default / Placeholder | Description |\n|---|---|---|\n`dirs` |\n`${TEST_FILE_DIRS|-test,tests,__tests__,__specs__,spec,specs,testing}` |\nComma-separated directory markers used to identify test files. |\n`prefixes` |\n`${TEST_FILE_PREFIXES|-test_,spec_,test-,spec-}` |\nComma-separated filename prefixes used to identify test files. |\n`suffixes` |\n`${TEST_FILE_SUFFIXES|-_test,-test,.test,_tests,...}` |\nComma-separated filename suffixes used to identify test files. |\n`exact` |\n`${TEST_FILE_EXACT|-conftest.py,test.py,tests.py,spec.py,...}` |\nComma-separated exact filenames used to identify test files. |\n\n| Parameter | Default / Placeholder | Description |\n|---|---|---|\n`enabled` |\n`${PRISM_MONITORING_ENABLED|-true}` |\nEnables or disables LLM token usage tracking. |\n`observers` |\n`${PRISM_MONITORING_OBSERVERS|-console,jsonl}` |\nComma-separated list of enabled native in-app observers (`console` , `jsonl` ). |\n`jsonl_file_path` |\n`${PRISM_MONITORING_JSONL_PATH|-.prism_reviewer/token_usage.jsonl}` |\nDestination path for structured JSONL token usage audit logs. |\n`litellm_callbacks` |\n`${PRISM_MONITORING_LITELLM_CALLBACKS|-}` |\nComma-separated LiteLLM callback integrations. Supports for LLM tracing & cost analytics, `langfuse` for OpenTelemetry APM tracing, `otel` `prometheus` , etc. |\n\n**Langfuse (Recommended for LLM Tracing)**: Set`PRISM_MONITORING_LITELLM_CALLBACKS=\"langfuse\"`\n\nand configure standard Langfuse credentials (`LANGFUSE_PUBLIC_KEY`\n\n,`LANGFUSE_SECRET_KEY`\n\n,`LANGFUSE_HOST`\n\n). Automatically tracks generation traces, prompt/completion text, token breakdowns, and model costs.**OpenTelemetry (Enterprise APM)**: Set`PRISM_MONITORING_LITELLM_CALLBACKS=\"otel\"`\n\n(or`PRISM_MONITORING_LITELLM_CALLBACKS=\"langfuse,otel\"`\n\nto run both concurrently) to emit standard OpenTelemetry spans and metrics to your OTel Collector or APM backend (Datadog, Honeycomb, Grafana Tempo).\n\n| Parameter | Default / Placeholder | Description |\n|---|---|---|\n`diff_mode` |\n`${PRISM_DIFF_MODE|-auto}` |\nControls the PR git diff comparison strategy. `\"auto\"` (default) uses incremental diff (`previous_commit..HEAD` ) on push updates if previous state exists, and full diff otherwise. `\"full\"` forces complete diff review (`base..HEAD` ). `\"incremental\"` forces incremental diff review. |\n\nPrism Reviewer allows repository maintainers to significantly improve review quality, domain accuracy, and signal-to-noise ratio by supplying optional **Project Context** (`context.md`\n\n) and **Custom Review Rules** (`rules.md`\n\n).\n\nWhen reviewing pull requests, the multi-agent council (Warden, Architect, Inspector) loads these files into prompt memory to evaluate code changes against your team's exact architectural standards, domain concepts, and coding policies.\n\nPlace these markdown files inside a `.prism_reviewer/`\n\ndirectory at the root of your target repository:\n\n```\nmy-repository/\n├── .prism_reviewer/\n│   ├── context.md   # Project architecture, tech stack & domain background\n│   └── rules.md     # Custom coding rules, security requirements & constraints\n├── prism_reviewer.toml  # (Optional) Custom configuration overrides\n└── ...\n```\n\nTip\n\nBoth `.prism_reviewer/context.md`\n\nand `.prism_reviewer/rules.md`\n\nare **automatically auto-detected** by the CLI (`prism-review`\n\n) and local execution script (`run_local.py`\n\n). You can also specify custom file locations using the `--context`\n\nand `--rules`\n\nflags.\n\nProviding high-level background information helps agents understand design intentions, domain models, and system boundaries rather than flagging intentional design decisions.\n\n**Recommended Contents:**\n\n**System Overview & Architecture**: Core purpose, key subsystems, database layers, and external service dependencies.** Tech Stack & Libraries**: Framework versions, state management tools, ORMs, and async models.** Design Conventions**: Preferred design patterns (e.g., repository pattern, dependency injection), immutability rules, or concurrency patterns.\n\n*Example context.md:*\n\n```\n# Project Context: Payment Processing Service\n\n## Architecture\n- Microservice built with FastAPI, PostgreSQL, and Celery worker queues.\n- Uses SQLAlchemy 2.0 with async sessions.\n\n## Key Invariants\n- All monetary values must be represented using integer cents or Decimal to avoid floating-point errors.\n- Payment gateway API calls must be wrapped in idempotent retry blocks.\n```\n\nRepository-specific rules allow you to enforce team coding standards, security boundaries, and strict review constraints.\n\n**Recommended Contents:**\n\n**Security Constraints**: Forbidden functions (e.g.,`eval`\n\n, un-sanitized SQL formatting), credential leakage checks, CORS policies.**Performance & Scaling Rules**: N+1 query prevention, missing database index warnings, memory leak checks.** Code Style & Maintainability**: Maximum function length guidelines, docstring requirements, error handling requirements (e.g., no bare`except:`\n\nclauses).\n\n*Example rules.md:*\n\n```\n# Repository Review Rules\n\n## Security & Reliability\n- NEVER execute raw SQL queries constructed via string formatting or f-strings. Use parameterized queries.\n- Ensure all public API endpoints handle exceptions explicitly and return structured JSON error models.\n\n## Code Quality & Performance\n- Do not make database calls inside loops (N+1 query anti-pattern). Use batch loading or eager joins.\n- All newly added functions must include static type annotations for arguments and return values.\n```\n\nTo execute pull request reviews locally using a GitHub Pull Request ID, Prism Reviewer provides a pre-configured utility script: [run_local.py](/vyoman-labs/prism-reviewer/blob/main/scripts/run_local/run_local.py). This script fetches the diff, title, and description for a remote PR, executes the Agent Council review locally, and writes the output report.\n\n```\npython scripts/run_local/run_local.py --repo \"owner/repository\" --pr 42 --token \"YOUR_GITHUB_TOKEN\"\n```\n\n`--repo`\n\n: The full name of the repository on GitHub (e.g.,`octocat/Hello-World`\n\n).`--pr`\n\n: The numeric ID of the Pull Request.`--token`\n\n: Your GitHub Personal Access Token (PAT). If not provided, it falls back to the`GITHUB_TOKEN`\n\nenvironment variable.`--output`\n\n: Filepath to write the Markdown report (defaults to`prism_review_report.md`\n\n).\n\nPrism Reviewer can be integrated into any GitHub repository using our official GitHub Action or as a GitHub App integration.\n\nExternal repositories can run automated AI code reviews on Pull Requests in **3 simple steps** using our GitHub Action (`vyoman-labs/prism-reviewer@v1`\n\n).\n\nIn your repository, go to **Settings > Secrets and variables > Actions > New repository secret** and add:\n\n: Your API key for Gemini, OpenRouter, OpenAI, Anthropic, or any LiteLLM-supported provider.`LLM_PROVIDER_API_KEY`\n\nCreate a file named `.github/workflows/prism-reviewer.yml`\n\nin your repository (or copy [docs/examples/prism-reviewer-external.yml](/vyoman-labs/prism-reviewer/blob/main/docs/examples/prism-reviewer-external.yml)):\n\n```\nname: Prism Reviewer AI Code Review\n\non:\n  pull_request:\n    types: [opened, synchronize, reopened]\n\npermissions:\n  contents: read\n  pull-requests: write\n\njobs:\n  review:\n    name: Run AI Code Review\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Codebase\n        uses: actions/checkout@v4\n        with:\n          fetch-depth: 0 # Fetch all history for git diff comparison\n\n      - name: Run Prism Reviewer AI\n        uses: vyoman-labs/prism-reviewer@v1\n        with:\n          llm-api-key: ${{ secrets.LLM_PROVIDER_API_KEY }}\n```\n\nOpen or update any Pull Request. Prism Reviewer will automatically analyze your code changes and post a structured review report directly to the PR comments!\n\n| Input | Required | Default | Description |\n|---|---|---|---|\n`llm-api-key` |\nYes |\n— | API key for LiteLLM provider (Gemini, OpenRouter, OpenAI, etc.). |\n`llm-model-name` |\nNo | `gemini/gemini-3.1-flash-lite` |\nModel identifier to execute analysis. |\n`github-token` |\nNo | `${{ github.token }}` |\nToken used to post review comments. |\n`base-ref` |\nNo | `${{ github.base_ref }}` |\nBase branch for git diff comparison. |\n`agents-mode` |\nNo | `parallel` |\nAgent execution mode (`parallel` or `sequential` ). |\n`enable-monitoring` |\nNo | `auto` |\nControl telemetry dependency installation (`auto` , `true` , `false` ). |\n\nBy default, comments are posted under the standard ** github-actions[bot]** identity with a prominent\n\n**report header inside the comment body.**\n\n`🌌 Vyoman Labs | 🌈 Prism Reviewer AI`\n\nIf you prefer comments to be posted under a dedicated **GitHub App Bot Name** (e.g. `Prism Reviewer AI[bot]`\n\n):\n\n```\n      - name: Generate App Token\n        id: app-token\n        uses: actions/create-github-app-token@v1\n        with:\n          app-id: ${{ secrets.PRISM_REVIEWER_APP_ID }}\n          private-key: ${{ secrets.PRISM_REVIEWER_PRIVATE_KEY }}\n\n      - name: Run Prism Reviewer AI\n        uses: vyoman-labs/prism-reviewer@v1\n        with:\n          github-token: ${{ steps.app-token.outputs.token }}\n          llm-api-key: ${{ secrets.LLM_PROVIDER_API_KEY }}\n```\n\nTo configure a dedicated GitHub App registration, webhooks, or LLM observability monitoring for Prism Reviewer, see the detailed documentation:\n\n**Syntax Boundaries**: AST CodeLens mappings support Python (`.py`\n\n), Java (`.java`\n\n), TypeScript (`.ts`\n\n,`.tsx`\n\n), JavaScript (`.js`\n\n,`.jsx`\n\n), C (`.c`\n\n), C++ (`.cpp`\n\n,`.cc`\n\n,`.cxx`\n\n,`.h`\n\n,`.hpp`\n\n), Go (`.go`\n\n), and Rust (`.rs`\n\n) via tree-sitter. Other file types fall back to plain-text indexing.**Git Dependency**: The core analysis tool relies on local system execution of the`git`\n\nexecutable (specifically`git diff`\n\nand`git ls-files`\n\n).**LLM Rate Limits**: Parallel map-reduce execution can exceed rate limits on standard API tiers. Throttling is managed via LiteLLM configurations in[prism_reviewer.toml](/vyoman-labs/prism-reviewer/blob/main/prism_reviewer.toml).\n\n- Expand AST grammar coverage to additional languages as needed.\n- Integrate directly with GitHub\n**Check Runs API** to highlight warnings inline inside the GitHub \"Files changed\" diff viewer. - Create an interactive\n**CLI review wizard** allowing developer queries directly in the terminal. - Provide a Dockerized workspace image for zero-dependency CI installations.\n\nIn optics, a **prism** separates white light into a colorful spectrum of wavelengths.\n\nPrism Reviewer applies the same optical concept to code review:\n\n**Splitting the Spectrum**: It takes a single unified Pull Request delta and refracts it into three distinct analytical bands:** Warden**(Security),** Architect**(Structure & Performance), and** Inspector**(Clean Code & Logic).** Filtering the Wavelengths**: The verification layer filters these individual bands, blocking noise (hallucinations) and redundant repeats (deduplication).**Recomposing the Light**: The aggregator recombines these analyzed results back into a single clear, actionable markdown review report.\n\nBy decomposing and refocusing the code review process, Prism Reviewer ensures that every angle of your codebase receives the specialized focus it deserves.\n\n**Prism Reviewer AI** is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.", "url": "https://wpnews.pro/news/prism-reviewer-multi-agent-ai-code-reviewer-built-with-langgraph-and-litellm", "canonical_source": "https://github.com/marketplace/actions/prism-reviewer-ai", "published_at": "2026-08-23 12:22:24+00:00", "updated_at": "2026-08-23 12:44:06.624203+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-products", "machine-learning"], "entities": ["Vyoman Labs", "LangGraph", "LiteLLM", "Tree-Sitter", "GitHub", "savourly-recipes"], "alternates": {"html": "https://wpnews.pro/news/prism-reviewer-multi-agent-ai-code-reviewer-built-with-langgraph-and-litellm", "markdown": "https://wpnews.pro/news/prism-reviewer-multi-agent-ai-code-reviewer-built-with-langgraph-and-litellm.md", "text": "https://wpnews.pro/news/prism-reviewer-multi-agent-ai-code-reviewer-built-with-langgraph-and-litellm.txt", "jsonld": "https://wpnews.pro/news/prism-reviewer-multi-agent-ai-code-reviewer-built-with-langgraph-and-litellm.jsonld"}}