Compliance DNA: The "Gap" Between Law and Code
Financial regulations change daily. Our codebases change hourly. Who keeps them in sync? Introducing Compliance DNA—a graph-based engine that traces the lineage from legal text down to individual function calls.

The "Audit Panic" Scenario
In fintech, an audit isn't just a meeting—it's a crisis mode. Why? Because regulations, internal policies, and actual system code exist in three different universes.
- Regulations live in 500-page PDFs on government websites.
- Policies live in forgotten Word docs on SharePoint.
- Code lives in Git.
Proving that function validate_transfer() (Code) correctly implements "Section 3.2 of the AML Act" (Regulation) usually involves weeks of manual cross-referencing.
Bridging the Gap with AI
We built the Compliance DNA Engine for the RuleZ x AI Hackathon to solve this "traceability gap" automatically. It's not just a document search; it's a semantic lineage system.
How It Works
The engine creates a Knowledge Graph that links these disparate worlds:
- Extraction: We use LLMs (GPT-4o) to "read" regulations and extract atomic rules (Obligations, Prohibitions, Thresholds).
- Vectorization: These rules are embedded into a vector space.
- Graph Construction: Use Neo4j to build relationships:
(Policy)-[:IMPLEMENTS]->(Regulation)and(SystemRule)-[:ENFORCES]->(Policy).
The Result: Real-Time Gap Detection
Instead of waiting for an audit to find out we're non-compliant, the system runs continuous "Gap Analysis":
- Missing Implementation: "Hey, this new Fed regulation has no matching internal policy."
- Threshold Mismatch: "Regulation says LTV limit is 75%, but your code config is set to 80%."
- Drift Detection: "The underlying law changed yesterday. Your code is now stale."
The Tech Stack
We prioritized speed and explainability:
- FastAPI: For the REST interface.
- Neo4j: To model the complex web of many-to-many relationships between laws and code.
- Streamlit: For a rapid, interactive dashboard that auditors can actually use.
- OpenAI: For the messy task of unstructured text extraction.
This moves compliance from "archaeology" (digging through the past) to "monitoring" (watching the present).