How sribuddha/aml works
This is an AML transaction-monitoring product: users upload CSVs, accepted transactions enter persistent storage, and an asynchronous workflow applies rules, enrichment, LLM triage/deep-dive, and SAR review before status is reflected in the dashboard. The map preserves the documented evaluation and rule-management capabilities. Workflow internals beyond the sampled rule engine and job service are based on README descriptions; their individual call wiring was not inspected.
Main entry points: app.py FastAPI application · graph.py Workflow graph · llm.py LLM client and providers · rule_engine.py Rule engine
Components 25
Officer UI
- React application
ui/src/App.tsx - SAR review
ui/src/hooks/useSarReview.ts - API client
ui/src/api/client.ts
REST API
- FastAPI application
src/bff/app.py - Upload and read routes
src/file_processor/rest/upload.py - SAR endpoints
src/aml_workflow/rest/sar.py - Rule management
src/aml_workflow/rest/rules.py - Evaluation API
src/bff/routes/eval.py
File ingestion
- CSV validation and insert
src/file_processor/service/__init__.py - Workflow job service
src/aml_workflow/services.py
AML analysis
- Workflow graph
src/aml_workflow/graph.py - Rule engine
src/aml_workflow/nodes/rule_engine.py - Transaction enrichment
src/aml_workflow/enrichment.py - LLM triage
src/aml_workflow/nodes/triage.py - LLM deep-dive
src/aml_workflow/nodes/triage.py - SAR generation
src/aml_workflow/nodes/sar.py - LLM client and providers
src/aml_workflow/llm.py - Prompt builders
src/aml_workflow/prompts/builders.py - LLM fallbacks
src/aml_workflow/fallbacks.py
State and evaluation
- SQLite database
src/bff/database.py - Transaction records
src/core/models/transaction.py - Upload records
src/core/models/uploaded_files.py - Validation results
src/core/models/validation_result.py - Detection quality metrics
src/aml_workflow/eval/__init__.py
Other components
- Compliance officer
Connections 29
- Compliance officer → React application: uses
README.md - React application → API client: requests data
README.md - API client → FastAPI application: HTTP requests
README.md - React application → SAR review: presents review
ui/src/App.tsx - SAR review → API client: submits decisions
ui/src/hooks/useSarReview.ts - FastAPI application → Upload and read routes: registers routes
src/bff/app.py - FastAPI application → SAR endpoints: registers routes
src/bff/app.py - FastAPI application → Rule management: registers routes
src/bff/app.py - FastAPI application → Evaluation API: registers routes
src/bff/app.py - Upload and read routes → CSV validation and insert: processes upload
src/file_processor/rest/upload.py - CSV validation and insert → SQLite database: inserts accepted rows
src/file_processor/service/__init__.py - CSV validation and insert → Workflow job service: triggers workflow
src/file_processor/service/__init__.py - Workflow job service → Workflow graph: runs validation
src/aml_workflow/services.py - Workflow graph → Rule engine: dispatches stage
README.md - Workflow graph → LLM triage: dispatches stage
README.md - Workflow graph → LLM deep-dive: dispatches stage
README.md - Workflow graph → SAR generation: dispatches stage
README.md - Rule engine → SQLite database: reads and writes
src/aml_workflow/nodes/rule_engine.py - Rule engine → Validation results: persists results
src/aml_workflow/nodes/rule_engine.py - Rule engine → Transaction records: reads transactions
src/aml_workflow/nodes/rule_engine.py - Transaction enrichment → LLM triage: supplies context
README.md - LLM triage → LLM client and providers: requests decisions
src/aml_workflow/llm.py - LLM deep-dive → LLM client and providers: requests investigation
src/aml_workflow/llm.py - SAR generation → LLM client and providers: requests narratives
src/aml_workflow/llm.py - LLM client and providers → Prompt builders: builds prompts
src/aml_workflow/llm.py - LLM client and providers → LLM fallbacks: uses fallback
src/aml_workflow/llm.py - Evaluation API → Detection quality metrics: runs evaluation
src/bff/routes/eval.py - SQLite database → Transaction records: stores
src/bff/database.py - SQLite database → Upload records: stores
src/bff/database.py