How pruthvi-y/smart-pr-review-workflow works
This is a LangGraph learning POC that turns a mock or GitHub pull request into an evidence-grounded review and can optionally post a comment. Its main workflow loads the PR, classifies and routes it, retrieves policy context, fans out specialist checks, drafts and evaluates the review, revises when needed, then finalizes and optionally posts. The README documents both MCP and direct REST GitHub modes. The graph reflects documented workflow structure and shown module references; some load and routing implementation details were omitted from the excerpts.
Main entry points: model.py Model adapter · nodes.py Evaluate draft · rag.py RAG index and retrieval · github.py GitHub REST client
Components 24
Review workflow
- CLI runner
src/smart_pr_review_workflow/main.py - LangGraph workflow
src/smart_pr_review_workflow/workflow.py - Load PR
src/smart_pr_review_workflow/nodes.py - Post review
src/smart_pr_review_workflow/nodes.py - Review state
src/smart_pr_review_workflow/state.py
Review analysis
- Classify change
src/smart_pr_review_workflow/nodes.py - Select checks
src/smart_pr_review_workflow/nodes.py - Parallel dispatch
src/smart_pr_review_workflow/nodes.py - Specialist checks
src/smart_pr_review_workflow/nodes.py - Generate draft
src/smart_pr_review_workflow/nodes.py - Evaluate draft
src/smart_pr_review_workflow/nodes.py - Revise draft
src/smart_pr_review_workflow/nodes.py - Finalize review
src/smart_pr_review_workflow/nodes.py
Models and GitHub
- Amazon Bedrock
- Model adapter
src/smart_pr_review_workflow/model.py - GitHub REST API
- GitHub REST client
src/smart_pr_review_workflow/tools/github.py - MCP GitHub client
src/smart_pr_review_workflow/mcp/client.py - MCP server tools
src/smart_pr_review_workflow/mcp/server.py
Policy knowledge
- Retrieve policy
src/smart_pr_review_workflow/nodes.py - RAG index and retrieval
src/smart_pr_review_workflow/rag.py - Policy documents
knowledge - Local vector store
src/smart_pr_review_workflow/rag.py
Other components
- Review operator
Connections 31
- Review operator → CLI runner: runs
README.md - CLI runner → LangGraph workflow: builds and streams
src/smart_pr_review_workflow/main.py - CLI runner → RAG index and retrieval: builds index
src/smart_pr_review_workflow/main.py - LangGraph workflow → Load PR: starts at
src/smart_pr_review_workflow/workflow.py - Load PR → Classify change: routes to
src/smart_pr_review_workflow/workflow.py - Classify change → Select checks: routes to
src/smart_pr_review_workflow/workflow.py - Select checks → Retrieve policy: routes to
src/smart_pr_review_workflow/workflow.py - Retrieve policy → Parallel dispatch: dispatches checks
src/smart_pr_review_workflow/workflow.py - Parallel dispatch → Specialist checks: sends tasks
src/smart_pr_review_workflow/workflow.py - Specialist checks → Generate draft: routes results
src/smart_pr_review_workflow/workflow.py - Generate draft → Evaluate draft: routes draft
src/smart_pr_review_workflow/workflow.py - Evaluate draft → Revise draft: routes for revision
src/smart_pr_review_workflow/nodes.py - Revise draft → Evaluate draft: reevaluates
src/smart_pr_review_workflow/workflow.py - Evaluate draft → Finalize review: routes accepted draft
src/smart_pr_review_workflow/nodes.py - Finalize review → Post review: routes final review
src/smart_pr_review_workflow/workflow.py - Load PR → MCP GitHub client: loads PR via MCP
README.md - MCP GitHub client → MCP server tools: calls tools
README.md - MCP server tools → GitHub REST client: delegates GitHub calls
src/smart_pr_review_workflow/mcp/server.py - GitHub REST client → GitHub REST API: requests PR data
src/smart_pr_review_workflow/tools/github.py - Post review → MCP GitHub client: posts comment via MCP
README.md - Post review → GitHub REST client: posts comment via REST
README.md - Load PR → GitHub REST client: loads PR via REST
README.md - Retrieve policy → RAG index and retrieval: retrieves context
src/smart_pr_review_workflow/nodes.py - RAG index and retrieval → Policy documents: loads documents
src/smart_pr_review_workflow/rag.py - RAG index and retrieval → Local vector store: indexes and searches
src/smart_pr_review_workflow/rag.py - Classify change → Model adapter: requests classification
src/smart_pr_review_workflow/nodes.py - Specialist checks → Model adapter: requests analyses
src/smart_pr_review_workflow/nodes.py - Generate draft → Model adapter: requests draft
src/smart_pr_review_workflow/nodes.py - Evaluate draft → Model adapter: requests evaluation
src/smart_pr_review_workflow/nodes.py - Revise draft → Model adapter: requests revision
src/smart_pr_review_workflow/nodes.py - Model adapter → Amazon Bedrock: invokes model
src/smart_pr_review_workflow/model.py