How harsh-gogri/compliance-copilot works
Compliance Copilot audits call-center script lines against RBI material, returning a compliance status, citation, explanation, and—when needed—a rewrite. The main request flow is API routing → sentence-level checking → retrieval and grounded model evaluation; a second API operation compares current and draft results. A separate corpus-preparation flow extracts, chunks, and embeds regulatory text. The README also describes a browser interface and MFI/general plus v1/v2 filtering. The interface-to-API connection is not shown in the sampled source, so it is not asserted here.
Main entry points: index.py HTTP API · check_line.py Line Evaluator · build_index.py Embedding Indexer · check_script.py Script Checker
Components 15
User Interface
- Browser App
public/index.html - HTTP API
api/index.py
Script Auditing
- Script Checker
api/check_script.py - Version Diff
api/diff_script.py - Line Evaluator
api/check_line.py - Rule Retrieval
api/check_line.py
Regulatory Knowledge
- RBI Documents
source-docs/v1 - Text Extraction
extract_text.py - Extracted Text
raw_text.txt - Paragraph Chunking
chunk_paragraphs.py - Rule Chunks
chunks.json - Embedding Indexer
build_index.py - Vector Index
vector_index.json
External Services
- Gemini Models
Other components
- Auditor
Connections 17
- Auditor → Browser App: uses
README.md - Auditor → HTTP API: submits scripts
api/index.py - HTTP API → Script Checker: routes checks
api/index.py - HTTP API → Version Diff: routes comparisons
api/index.py - Script Checker → Line Evaluator: checks each sentence
api/check_script.py - Version Diff → Script Checker: checks both versions
api/diff_script.py - Line Evaluator → Rule Retrieval: retrieves context
api/check_line.py - Rule Retrieval → Vector Index: reads rules
api/check_line.py - Rule Retrieval → Gemini Models: embeds query
api/check_line.py - Line Evaluator → Gemini Models: requests evaluation
api/check_line.py - RBI Documents → Text Extraction: provides source text
extract_text.py - Text Extraction → Extracted Text: writes
extract_text.py - Extracted Text → Paragraph Chunking: provides text
chunk_paragraphs.py - Paragraph Chunking → Rule Chunks: writes chunks
chunk_paragraphs.py - Rule Chunks → Embedding Indexer: provides chunks
build_index.py - Embedding Indexer → Gemini Models: creates embeddings
build_index.py - Embedding Indexer → Vector Index: writes
build_index.py