How guilherme-viana-ey/compliance-checker works
Compliance Checker automatically evaluates Brazilian financial investment recommendations against ANBIMA/CVM guidance, returning a decision with cited sources. Its main workflow is document intake, profile/text extraction, retrieval and reranking of regulatory passages, grounded LLM analysis, then approval or referral for human review. It supports both HTTP analysis and autonomous batch/watch processing, with file routing, alerts, execution logs, and automation metrics. The map combines README-described capabilities with shown source relationships; ingestion-to-retrieval storage wiring and some runtime details are documented but not fully sampled.
Main entry points: main.py FastAPI Entry · tools.py Document Tools · compliance_service.py Analysis Orchestrator · compliance_agent.py Decision Workflow
Components 20
API and Contracts
- FastAPI Entry
projects/compliance-checker/src/main.py - Analysis Schemas
projects/compliance-checker/src/api/schemas.py
Regulatory Knowledge
- Regulatory Documents
projects/compliance-checker/knowledge_base - Document Ingestion
projects/compliance-checker/src/rag/ingestion.py - ChromaDB Index
projects/compliance-checker/src/rag/retrieval.py - Retrieve and Rerank
projects/compliance-checker/src/rag/retrieval.py
Compliance Analysis
- Analysis Orchestrator
projects/compliance-checker/src/services/compliance_service.py - Azure OpenAI Client
projects/compliance-checker/src/core/llm_client.py
Autonomous Processing
- Incoming Recommendations
projects/compliance-checker/data/input - File Watcher
projects/compliance-checker/src/agents/watcher.py - Batch and Watch Runner
projects/compliance-checker/src/agents/runner.py - Decision Workflow
projects/compliance-checker/src/agents/compliance_agent.py - Document Tools
projects/compliance-checker/src/agents/tools.py - Approved Documents
projects/compliance-checker/data/output/approved - Review Queue
projects/compliance-checker/data/output/rejected_for_review
Audit and Metrics
- Execution and Alert Logs
projects/compliance-checker/data/logs - Tracing and Metrics
projects/compliance-checker/src/agents/observability.py
Other components
- API Client
- Compliance Operator
- Prometheus Scraper
Connections 23
- API Client → FastAPI Entry: submits analysis
README.md - FastAPI Entry → Analysis Schemas: validates payload
projects/compliance-checker/src/main.py - FastAPI Entry → Analysis Orchestrator: invokes analysis
projects/compliance-checker/src/main.py - Analysis Orchestrator → Retrieve and Rerank: retrieves passages
projects/compliance-checker/src/services/compliance_service.py - Retrieve and Rerank → ChromaDB Index: queries index
README.md - Document Ingestion → ChromaDB Index: writes chunks
projects/compliance-checker/src/rag/ingestion.py - Regulatory Documents → Document Ingestion: provides documents
projects/compliance-checker/src/rag/ingestion.py - Analysis Orchestrator → Azure OpenAI Client: requests analysis
projects/compliance-checker/src/services/compliance_service.py - Analysis Orchestrator → Analysis Schemas: returns result
projects/compliance-checker/src/services/compliance_service.py - Compliance Operator → Incoming Recommendations: places files
README.md - Incoming Recommendations → File Watcher: triggers on arrival
projects/compliance-checker/src/agents/watcher.py - Batch and Watch Runner → Decision Workflow: runs batch
projects/compliance-checker/src/agents/runner.py - Batch and Watch Runner → File Watcher: starts watch mode
projects/compliance-checker/src/agents/runner.py - File Watcher → Decision Workflow: runs workflow
projects/compliance-checker/src/agents/watcher.py - FastAPI Entry → Decision Workflow: processes uploaded file
projects/compliance-checker/src/main.py - Decision Workflow → Document Tools: uses tools
projects/compliance-checker/src/agents/compliance_agent.py - Document Tools → Analysis Orchestrator: analyzes recommendation
projects/compliance-checker/src/agents/tools.py - Document Tools → Approved Documents: moves approved file
README.md - Document Tools → Review Queue: moves rejected file
README.md - Document Tools → Execution and Alert Logs: records alerts
README.md - Decision Workflow → Execution and Alert Logs: writes execution logs
README.md - FastAPI Entry → Tracing and Metrics: records metrics
projects/compliance-checker/src/main.py - Prometheus Scraper → FastAPI Entry: scrapes metrics
projects/compliance-checker/src/main.py