💡 Inspiration

The financial world is drowning in regulations. Global compliance costs exceed $270 Billion annually, yet fines for non-compliance continue to skyrocket. Fintech startups and banks struggle to keep up with the ever-changing landscape of Federal and State laws (KYC, AML, BSA). We realized that traditional "keyword search" isn't enough when a single missed clause can cost millions. We needed an intelligent agent that doesn't just "find" documents but understands them, relates them to specific transactions, and makes autonomous risk decisions. Thus, JurisLens was born—an AI Compliance Officer that never sleeps.

⚖️ What it does

JurisLens is an autonomous AI Compliance Agent that helps compliance officers and fintechs navigate complex regulatory environments instanty. It has three core superpowers:

  1. Regulatory Intelligence: Ingests thousands of PDF regulations (like the Patriot Act or heavy banking statutes) and makes them searchable via Elasticsearch Hybrid Search (Vector + Keyword) for unmatched precision.
  2. Autonomous Risk Reasoning: It doesn't just quote laws; it calculates risk. The agent can check a live (mock) transaction ledger, aggregate daily limits, and determine if a specific transaction violates a specific clause.
  3. Sanctions Screening: It instantly verifies entities against global watchlists to prevent money laundering and fraud.

⚙️ How we built it

The architecture is a modern Hub-and-Spoke Agentic Workflow:

  • Brain: We used LangChain to orchestrate an OpenAI GPT-4 Turbo agent. This agent decides which tool to use based on the user's question.
  • Knowledge Store: The heart of the system is Elasticsearch. We use it as a highly scalable Vector Database.
    • Ingestion: Python scripts chunk PDF regulations and generate embeddings via OpenAI.
    • Retreival: We use Hybrid Search (combining dense vector similarity with sparse keyword matching) to ensure we find the exact section of the law, not just a vague match.
  • Tools:
    • RegulationSearch: Queries Elasticsearch RAG.
    • RiskCalculator: A Python tool that simulates a connection to a Core Banking Ledger (SQL) to fetch transaction history and calculate aggregate daily exposure.
    • SanctionsChecker: Simulates an API call to OFAC/Global watchlists.
  • Frontend: A sleek, responsive Streamlit dashboard that visualizes the agent's thought process (e.g., "Scanning Knowledge Base...", "Calculating Risk...") so the user trusts the AI.

🚧 Challenges we ran into

  • Citation Precision: LLMs love to hallucinate. To fix this, we forced the RAG pipeline to retrieve Top-3 specific chunks from Elasticsearch and mandated a strict citation format (e.g., [Source: US_CFR_Title31.pdf (Page 5)]).
  • Agent Loops: Initially, the agent would get stuck in a loop of "thinking." We implemented a FriendlyCallbackHandler to visualize these steps and tuned the system prompt to be more decisive.
  • Visualizing Complexity: Compliance is boring. We had to work hard to make the UI feel "slick" and "modern" with glassmorphism effects and dynamic status updates.

🏅 Accomplishments that we're proud of

  • Hybrid Search Implementation: Successfully implementing Elasticsearch's hybrid search (RRF/Boosting) to retrieve extremely specific legal clauses that pure vector search missed.
  • State-Awareness: The agent correctly "remembers" prior transactions for a client (e.g., "Client X already transferred $2500 today, so another $3000 is blocked"), simulating real-world banking logic.
  • The "Wow" Factor: The final UI, with the animated architecture diagram and real-time reasoning steps, looks like a production-ready SaaS product.

🧠 What we learned

  • Elasticsearch is fast. indexing thousands of vectors took seconds, and retrieval is sub-millisecond.
  • Agents need Tools, not just RAG. The power of JurisLens comes from the combination of reading laws (RAG) and doing math (Risk Calculator). Neither is sufficient alone.
  • Context is King. Providing the exact "State" context (e.g., Federal vs State law, Transaction History) drastically improves the AI's decision quality.

🚀 What's next for JurisLens

  • Multi-Modal Ingestion: Processing scanned images of contracts (OCR).
  • Real-time API Integration: Connecting to real banking cores (Plaid/Stripe) instead of mock ledgers.
  • Automated Filing: Having the agent automatically fill out Suspicious Activity Reports (SARs) and submit them to FinCEN.

Built With

Share this project:

Updates