🌍 Inspiration

In today’s rapidly changing financial landscape, investors must navigate an overwhelming amount of new laws, directives, and sanctions. This constant regulatory inflation makes it difficult to anticipate how policies impact global markets.

We created LawLytics to turn this complexity into clarity — an AI-driven platform that transforms regulatory texts, market news, and social sentiment into actionable investment insights.

Our guiding question was simple:

How can generative AI help investors understand the financial implications of legal change — in real time?


💡 What it does

LawLytics uses generative AI on AWS to evaluate the economic impact of new regulations on S&P 500 companies by analyzing:

  • 📜 Regulatory texts and legal updates
  • 📰 Financial and social news (Reddit, X/Twitter API)
  • 💹 Market data (Yahoo Finance API)

It outputs a structured JSON report containing:

  • A summarized context
  • Extracted entities (companies, sectors, countries)
  • A regulatory risk score (R_r \in [0, 1])
  • Data-driven portfolio recommendations

Example:
If a new U.S. subsidy targets renewable energy, LawLytics detects beneficiary sectors and suggests increased exposure to domestic clean energy stocks.


⚙️ How we built it

Our architecture is fully automated and cloud-native, ensuring scalability and transparency:

Layer Technology Purpose
Frontend / Dashboard React + AWS Amplify Visualization of risk and sentiment analytics
Backend Flask Orchestrates data flow and API responses
Data Storage Amazon S3 Stores regulatory and user-uploaded data
NLP Preprocessing AWS Comprehend Extracts entities and keywords (e.g., “oil”, “renewable energy”, “defense budget”)
Semantic Indexing Amazon OpenSearch Serverless Creates embeddings for fast retrieval
Generative Reasoning Amazon Bedrock (Claude 4 + Titan) Generates summaries, risk scores, and investment advice
Security Layer AWS IAM Controls access and ensures auditability

When a text exceeds model limits, it is summarized and stored in S3 for future reuse — ensuring cost efficiency and memory persistence.


🚧 Challenges we ran into

  • Managing very long legal documents without losing context
  • Maintaining real-time performance while retrieving only relevant S3 data (Lazy RAG)
  • Avoiding hallucinations by grounding all outputs in verified S3 and OpenSearch context
  • Balancing latency vs. cost within the AWS Bedrock pipeline

🏆 Accomplishments that we’re proud of

  • Built a multilingual, context-aware AI that refuses to answer when evidence is insufficient — ensuring transparency and trust
  • Achieved a non-hallucinatory JSON reasoning pipeline powered by Bedrock and OpenSearch
  • Integrated a live financial dimension, correlating legislative changes with stock performance and sector sentiment
  • Delivered an end-to-end automated workflow within the hackathon timeframe
  • LazyRag which is an implementation of a RAG that retrieves only data from the context and not the whole database

📚 What we learned

  • How to integrate multiple AWS services (Comprehend, Bedrock, OpenSearch, S3, IAM, Sagemaker) into one cohesive pipeline
  • How context-grounded generative AI can help manual legal monitoring with explainable automation
  • That clear visualization and trust are as valuable as model accuracy in financial AI

🚀 What’s next for LawLytics

  • A what if model that predict a long scenrio of financial informations depending on the law that appeared
  • A user account system that saves past data and analyses, enabling personalized insights, progress tracking, and smarter AI interactions over time
  • Drill-down interactions: Clicking a pie slice zooms into that category’s details.
  • Sector comparison mode: Side-by-side analysis of two companies or industries.

In essence:
LawLytics, developed for the PolyFinance Datathon 2025, bridges the gap between law and finance — turning complex legislation into clear, evidence-backed investment decisions.

Share this project:

Updates