<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mansi Chaudhari </title>
    <description>The latest articles on DEV Community by Mansi Chaudhari  (@mansi711).</description>
    <link>https://dev.to/mansi711</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3056321%2Fcddd8db1-656e-45d1-b49b-1a33f44df775.png</url>
      <title>DEV Community: Mansi Chaudhari </title>
      <link>https://dev.to/mansi711</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mansi711"/>
    <language>en</language>
    <item>
      <title>AI for ESG Reporting Using Real-Time RAG and Live Data Streams</title>
      <dc:creator>Mansi Chaudhari </dc:creator>
      <pubDate>Wed, 16 Apr 2025 17:59:13 +0000</pubDate>
      <link>https://dev.to/mansi711/ai-for-esg-reporting-using-real-time-rag-and-live-data-streams-7nh</link>
      <guid>https://dev.to/mansi711/ai-for-esg-reporting-using-real-time-rag-and-live-data-streams-7nh</guid>
      <description>&lt;p&gt;&lt;strong&gt;Why Real-Time ESG Reporting Needs a Shake-Up&lt;/strong&gt;&lt;br&gt;
In the world of finance and sustainability, Environmental, Social, and Governance (ESG) data is gold. But traditional ESG reporting is slow, static, and backward-looking.&lt;br&gt;
That’s a problem.&lt;br&gt;
Modern asset managers, analysts, and compliance teams need real-time insights. They can’t wait for quarterly updates or laggy data refreshes.&lt;br&gt;
Enter AI + Real-Time Data Pipelines.&lt;br&gt;
Imagine an AI system that not only fetches the most relevant ESG info right now, but also explains it to you in natural language. That’s what our hackathon team set out to build.&lt;br&gt;
&lt;strong&gt;What We Built: A Real-Time ESG RAG Application&lt;/strong&gt;&lt;br&gt;
At the Generative AI Hackathon hosted by IIT Jammu and Pathway, our goal was clear:&lt;br&gt;
Build a real-time Retrieval-Augmented Generation (RAG) app powered by Pathway.&lt;br&gt;
💡 &lt;em&gt;Key Features:&lt;/em&gt;&lt;br&gt;
• Live ESG + news ingestion&lt;br&gt;
• On-the-fly indexing and vector search&lt;br&gt;
• Natural language answers using an LLM&lt;br&gt;
• REST API and clean UI to tie it together&lt;br&gt;
&lt;strong&gt;The Problem Statement We Solved&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;The challenge asked us to:&lt;/em&gt;&lt;br&gt;
• Ingest real-time ESG and news data&lt;br&gt;
• Build a vector store for document retrieval&lt;br&gt;
• Integrate an LLM into a RAG pipeline&lt;br&gt;
• Expose it via a REST API&lt;br&gt;
• Add a simple UI to show results in real time&lt;br&gt;
&lt;em&gt;Our twist?&lt;br&gt;
_We focused on ESG data in the financial domain, where timely insights are critical for compliance, investor updates, and risk assessment.&lt;br&gt;
&lt;strong&gt;System Architecture: How It All Comes Together&lt;/strong&gt;&lt;br&gt;
Here’s a quick view of our tech stack and data flow:&lt;br&gt;
scss&lt;br&gt;
_Data Sources (ESG + News) _&lt;br&gt;
→ Pathway Pipeline (Ingestion &amp;amp; Indexing) &lt;br&gt;
→ Vector Store (Custom Embeddings) &lt;br&gt;
→ RAG (LLM with retrieved context) &lt;br&gt;
→ FastAPI (REST Endpoint) &lt;br&gt;
→ Streamlit UI (Live Interface)&lt;br&gt;
&lt;strong&gt;Tools We Used&lt;/strong&gt;&lt;br&gt;
• Pathway: real-time data ingestion &amp;amp; indexing&lt;br&gt;
• FastAPI: RESTful backend&lt;br&gt;
• Ollama + Phi3: lightweight, local LLM&lt;br&gt;
• Streamlit: interactive frontend&lt;br&gt;
We designed everything to simulate a production-ready, low-latency ESG dashboard.&lt;br&gt;
Pathway in Action: Real-Time ESG Intelligence&lt;br&gt;
&lt;strong&gt;We used Pathway to:&lt;/strong&gt;&lt;br&gt;
• Ingest JSONLines files for ESG &amp;amp; news&lt;br&gt;
• Stream new entries with pw.io.jsonlines.read&lt;br&gt;
• Parse and normalize data using custom schemas&lt;br&gt;
• Generate basic embeddings (hash-based)&lt;br&gt;
• Build a vector index in real time&lt;br&gt;
&lt;strong&gt;Why it matters:&lt;/strong&gt;&lt;br&gt;
Unlike batch pipelines, Pathway reacts instantly to new data — exactly what ESG systems need.&lt;br&gt;
&lt;strong&gt;Retrieval-Augmented Generation (RAG) with LLMs&lt;/strong&gt;&lt;br&gt;
_Here’s how we made answers smart, fast, and grounded:&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Query received via REST API&lt;/li&gt;
&lt;li&gt; Query embedded → nearest neighbors retrieved from index&lt;/li&gt;
&lt;li&gt; Context + query → passed to Ollama Phi3 model&lt;/li&gt;
&lt;li&gt; Response returned with answer + context + metadata
We manually handled distance calculations due to type quirks in Pathway — a cool hack that paid off.
&lt;strong&gt;User Interface &amp;amp; API: Real-Time, User-Friendly&lt;/strong&gt;
&lt;em&gt;We kept the interface super simple:&lt;/em&gt;
• Streamlit dashboard with:
o   Query input
o   Styled results (Answer, Context, Metadata)
o   Real-time ESG data log
• REST API using FastAPI at /rag
o   Accepts POST queries
o   Returns full RAG output as JSON&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsgcifejefq4stm7vsvkh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsgcifejefq4stm7vsvkh.png" alt="Streamlit app for ESG RAG showing live answers" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg4yk2nf8gu3mefddus63.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg4yk2nf8gu3mefddus63.png" alt="JSON response from FastAPI RAG endpoint" width="800" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenges We Faced&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;em&gt;Embedding accuracy:&lt;/em&gt;
Our hash-based method worked — but lacked semantic depth. We’re eyeing Sentence Transformers next.&lt;/li&gt;
&lt;li&gt; &lt;em&gt;Real-time simulation:&lt;/em&gt;
We faked streaming via .jsonl updates. A real app would hook into financial APIs or Kafka.&lt;/li&gt;
&lt;li&gt; &lt;em&gt;Pathway quirks:&lt;/em&gt;
Type issues during embedding comparison meant writing custom logic to find nearest neighbors.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Lessons Learned&lt;/strong&gt;&lt;br&gt;
• Real-time pipelines demand reactive architecture&lt;br&gt;
• Pathway is killer for streaming use cases&lt;br&gt;
• RAG reduces LLM hallucination by grounding in facts&lt;br&gt;
• Simplicity in UI and architecture wins during hackathons&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s Next?&lt;/strong&gt;&lt;br&gt;
• Upgrade to semantic embedding models&lt;br&gt;
• Add ESG trend visualizations (e.g., emissions over time)&lt;br&gt;
• Experiment with multi-step reasoning agents&lt;br&gt;
• Try Pathway’s native serve_callable for deployment&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub &amp;amp; Resources&lt;/strong&gt;&lt;br&gt;
🔗_ Repo:_ &lt;a href="https://github.com/Code-with-pranav/esg-rag-app" rel="noopener noreferrer"&gt;GitHub – Real-Time ESG RAG App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📽️ &lt;em&gt;Demonstration Video of Our Project:&lt;/em&gt;&lt;br&gt;
&lt;a href="https://drive.google.com/file/d/11NgzCuEqbmTB3JqaFR7qMcpg-BNvErt9/view?usp=sharing" rel="noopener noreferrer"&gt;Intro to Retrieval-Augmented Generation&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;🔗 &lt;em&gt;Tooling:&lt;/em&gt;&lt;br&gt;
• &lt;a href="https://github.com/pathwaycom/llm-app" rel="noopener noreferrer"&gt;Pathway GitHub&lt;/a&gt;&lt;br&gt;
• &lt;a href="https://github.com/ollama/ollama" rel="noopener noreferrer"&gt;Ollama LLM Runner &lt;/a&gt;&lt;br&gt;
• &lt;a href="https://docs.streamlit.io/" rel="noopener noreferrer"&gt;Streamlit Docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Frequently Asked Questions (FAQs)&lt;/strong&gt;&lt;br&gt;
What is ESG reporting in finance?&lt;br&gt;
ESG reporting tracks how companies perform on Environmental, Social, and Governance criteria — key for sustainable investing.&lt;br&gt;
Why use AI for ESG analysis?&lt;br&gt;
AI enables faster insights, better data integration, and real-time alerting vs. traditional quarterly reports.&lt;br&gt;
How does a RAG pipeline work?&lt;br&gt;
RAG fetches relevant context for a user query and feeds it into an LLM to generate grounded answers.&lt;br&gt;
Can I deploy this app myself?&lt;br&gt;
Yes! Our GitHub has setup instructions for running locally with your own data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;br&gt;
We built this project to showcase what’s possible when AI meets live data. Real-time ESG insights aren’t just cool — they’re necessary in today’s fast-moving financial landscape.&lt;br&gt;
This hackathon win was just the start.&lt;br&gt;
Try the demo, fork the code, and help us take real-time AI for ESG to the next level.&lt;/p&gt;

</description>
      <category>pathway</category>
      <category>iitjammu</category>
      <category>esg</category>
      <category>rag</category>
    </item>
  </channel>
</rss>
