Skip to content

Repository files navigation

ComplianceCopilot

AI-Driven Compliance Analyzer for Financial Documents

Regulation-Grounded • LLM-Powered • Audit-Ready


CI Python Streamlit License Stars Forks


Overview

ComplianceCopilot is an AI-powered system that analyzes financial documents such as:

  • Loan Agreements
  • Terms & Conditions
  • Key Fact Statements (KFS)

It compares them against RBI/SEBI guidelines using:

  • Document parsing
  • Clause classification
  • Regulation retrieval
  • LLM-based reasoning
  • Risk scoring
  • Explainable reporting

The goal is to automate and streamline compliance reviews with accuracy, speed, and clarity.


Features

📝 Document Ingestion

  • Upload PDF, DOCX, or TXT files
  • Extracts clean text
  • Splits into meaningful clauses

🔎 Clause Classification

Automatically identifies:

  • Pricing / APR
  • Fees & Charges
  • Foreclosure
  • Grievance Redressal
  • KYC / Documentation
  • Security
  • Default & Recovery

📚 Regulation Retrieval

  • Fetches the most relevant regulatory snippets
  • Uses TF-IDF or embeddings (expandable)

🤖 LLM-Powered Gap Detection

  • Compares document clauses with regulatory expectations
  • Generates:
    • Compliance status
    • Issues
    • Severity
    • Suggested remediation
    • Citations
  • Automatic fallback to heuristic comparator if needed

🔥 Risk Scoring

  • Severity-based risk calculation
  • Document-level overall score

🖥 Streamlit UI

  • File upload
  • “Process File” button
  • Progress display
  • Comparator mode switch
  • Detailed issue breakdown
  • Report export

🧪 Test Suite

  • Comparator tests using pytest

Architecture

📂 ComplianceCopilot
│
├── ingestion/            # PDF/DOCX loaders, text cleaning
├── clause_analyzer/      # Clause splitting & classification
├── rag_engine/
│     ├── retriever.py    # Retrieval logic
│     ├── comparator.py   # LLM + heuristic comparator
│     └── prompts.py      # Prompt templates
├── risk_engine/          # Risk scoring
├── report/               # Report generator
├── tests/                # Pytest suite
└── app.py                # Streamlit frontend

Installation

1️⃣ Create virtual environment

python3 -m venv venv
source venv/bin/activate

2️⃣ Install dependencies

pip install -r requirements.txt

3️⃣ Optional: enable LLM mode

export OPENAI_API_KEY="your-key-here"

4️⃣ Run the application

streamlit run app.py

Running Tests

pytest -q

Example Issue Output

[HIGH] APR not clearly disclosed.
Regulation: RBI Fair Practices Code
Reason: Customers must be informed of total cost of credit.
Fix: Include APR + example calculation.

Roadmap

  • OCR for scanned PDFs
  • SEBI + IRDAI regulation expansion
  • Embedding-based retriever
  • Version comparison for documents
  • Export full PDF report
  • Deploy to cloud (Render/Railway)

Contributing

Pull requests are welcome. Open an issue before major changes.


License

Distributed under the MIT License.


Built with passion to simplify compliance workflows.

About

AI-powered compliance engine using RAG + LLMs to analyze financial documents against RBI/SEBI regulations. Performs clause extraction, retrieval-based grounding, risk scoring, and generates auditor-ready compliance reports with explainable findings.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages