How qingyun1022/smart_contract_reviewer works
This is a Streamlit-based smart contract review system. Its intended user journey is upload a contract, follow analysis progress, and view a review report; however, the sampled upload handler explicitly leaves submission processing as a TODO, so no runtime link from upload to analysis is established. The repository includes clause parsing, specialized analysis agents, model routing, Chroma storage, and RabbitMQ connection support. README-described pricing, budget, and RAG capabilities lack corresponding source paths in the supplied tree, so they are noted without invented implementation links.
Main entry points: main.py Page router · base_agent.py Agent base · contract_analyst_agent.py Contract analyst · upload_page.py Contract upload
Components 23
User interface
- Page router
app/main.py - Navigation
app/components/sidebar.py - Contract upload
app/main_pages/upload_page.py - Analysis and report pages
Contract analysis
- Clause parser
core_services/contract_processor/clause_parser.py - Agent base
agents/base/base_agent.py - Contract analyst
agents/pipeline_agents/contract_analyst_agent.py - Legal counsel
agents/pipeline_agents/legal_counsel_agent.py - Risk analyst
agents/pipeline_agents/risk_analyst_agent.py - Report generator
agents/pipeline_agents/report_generator_agent.py - Price analysis and library
- Legal knowledge RAG
Runtime services
- Model router
model_services/model_router.py - Vector store client
data_storage/chroma/chroma_client.py - Broker connection
message_broker/core/connection.py - Configuration
common/config.py - Logging
common/logger.py - Budget monitoring
Error handling
- Dead-letter handling
agents/error_handling/dead_letter_handler.py - Retry strategy
agents/error_handling/retry_strategy.py - Human intervention
agents/error_handling/human_intervention.py
Other components
- Legal professional
- RabbitMQ
Connections 13
- Legal professional → Page router: uses
README.md - Page router → Navigation: renders navigation
app/main.py - Page router → Contract upload: routes to
app/main.py - Page router → Analysis and report pages: routes to
app/main.py - Legal professional → Contract upload: selects contract
app/main_pages/upload_page.py - Contract analyst → Agent base: inherits
agents/pipeline_agents/contract_analyst_agent.py - Legal counsel → Agent base: inherits
agents/pipeline_agents/legal_counsel_agent.py - Risk analyst → Agent base: inherits
agents/pipeline_agents/risk_analyst_agent.py - Report generator → Agent base: inherits
agents/pipeline_agents/report_generator_agent.py - Broker connection → RabbitMQ: connects to
message_broker/core/connection.py - Dead-letter handling → Human intervention: notifies
agents/error_handling/dead_letter_handler.py - Model router → Legal knowledge RAG: supports analysis
- Clause parser → Contract analyst: provides clauses