Skip to content

codeasarjun/FinSecure-Audit-Brain

Repository files navigation

FinSecure-Audit-Brain

An enterprise-grade, 100% air-gapped, and privacy-compliant Retrieval-Augmented Generation (RAG) system engineered for financial compliance auditing under EU regulatory frameworks (such as GDPR and the EU AI Act).

By utilizing entirely local open-source models, this system cuts out external third-party API dependencies—guaranteeing total data sovereignty and zero-data-leakage pipeline operations.

Technical & Business Impact

  • Zero Cloud Data Leakage: Sensitive financial logs and audit trail vectors are maintained entirely on local disk files, ensuring full compliance with strict data protection laws.
  • Hallucination Mitigation: Uses deterministic context-bounding filters and a forced 0.0 model temperature matrix, cutting false facts and creative hallucinations down to zero.
  • Modular Software Design: Built using enterprise separation of concerns, isolating data ingestion workflows, custom vector searches, and LLM inference blocks.

Architecture Workflow

graph TD
    A[Raw Audit Documents .txt] -->|Token-Based Splitter| B(Data Embeddings)
    B -->|nomic-embed-text:latest| C[(Local ChromaDB Filesystem)]
    D[Incoming Audit Query Request] -->|Vector Semantic Mapping| C
    C -->|Top-K Grounded Context Payload| E[Local Llama 3.2 Instance]
    E -->|Strict Deterministic Prompt Constraint| F[Context-Grounded API Response]
Loading

Technology & Framework Stack

  • LLM Engine & Embeddings Layer: Ollama (llama3.2:latest, nomic-embed-text:latest)
  • Orchestration Matrix: LangChain Core / Pydantic V2 Settings
  • Persistent Vector Storage: ChromaDB (Localized SQLite backend engine)
  • API Delivery Web Framework: FastAPI / Uvicorn Server
  • CI/CD & Virtualization: GitHub Actions / Multi-stage production Dockerfile

Quick Start Installation & Execution

1. Prerequisites

Ensure you have Ollama installed locally on your host device and pull the required open-source models:

ollama pull nomic-embed-text:latest
ollama pull llama3.2:latest

2. Workspace Setup

Clone this repository and install the production-grade dependency tree:

git clone 
cd FinSecure-Audit-Brain
pip install -r requirements.txt

3. Ingest Local Compliance Documents

Drop your raw audit notes or financial regulatory summaries into the data/raw/ directory as .txt files, then trigger the token-chunking ingestion pipeline:

python -m src.ingestion

4. Run the Production Microservice Server

Spin up your high-performance FastAPI orchestration backend instance:

uvicorn src.app:app --reload --port 8000

Open your browser and navigate to http://127.0.0 to view and interact with the automatically generated API documentation interface.

5. Query the Isolated Audit Endpoint

curl -X POST "http://127.0.0" \
     -H "Content-Type: application/json" \
     -d '{"question": "What policies help prevent financial fraud?"}'

Automated Testing Validation

This codebase implements test-driven engineering concepts. Run the automated testing suite locally using pytest:

pytest tests/ -v

About

FinSecure Audit Brain is a privacy-first, local Retrieval-Augmented Generation (RAG) system for financial and compliance document analysis. It enables secure, context-grounded question answering using vector search and locally hosted LLMs for audit-grade accuracy.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors