<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Akram - RAG</title>
    <subtitle>Mohammed Akram Khan Lodi — CS undergraduate researching recursive language models, self-improving agent harnesses, and the energy cost of efficient AI.</subtitle>
    <link rel="self" type="application/atom+xml" href="http://akramlodi.com/tags/rag/atom.xml"/>
    <link rel="alternate" type="text/html" href="http://akramlodi.com/"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-04-15T00:00:00+00:00</updated>
    <id>http://akramlodi.com/tags/rag/atom.xml</id>
    <entry xml:lang="en">
        <title>NDA Analyzer: a Multi-Agent RAG System</title>
        <published>2026-04-15T00:00:00+00:00</published>
        <updated>2026-04-15T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              Mohammed Akram Khan Lodi
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="http://akramlodi.com/projects/nda-analyzer/"/>
        <id>http://akramlodi.com/projects/nda-analyzer/</id>
        
        <content type="html" xml:base="http://akramlodi.com/projects/nda-analyzer/">&lt;ul class=&quot;link-row&quot;&gt;
&lt;li&gt;&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;akramlodi&#x2F;NDA-Analyzer---multi-agent-orchestration&quot;&gt;Code on GitHub&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;what-it-does&quot;&gt;What it does&lt;&#x2F;h2&gt;
&lt;p&gt;Employment NDAs are long, templated, and easy to sign without reading. NDA Analyzer reads one for you and returns a clause-by-clause review: what each clause says, where it’s loose or one-sided, whether it holds up against Indian law and common HR policy, and how to rewrite it.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;architecture&quot;&gt;Architecture&lt;&#x2F;h2&gt;
&lt;p&gt;The work is split across &lt;strong&gt;four agents that run in sequence&lt;&#x2F;strong&gt;, each with a narrow job and its own prompt:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Clause extraction.&lt;&#x2F;strong&gt; Segments the document into individual clauses and labels them.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Loophole detection.&lt;&#x2F;strong&gt; Flags ambiguous, overly broad, or one-sided language in each clause.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Legal-compliance verification.&lt;&#x2F;strong&gt; Checks flagged clauses against retrieved statutes and policies.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Fix generation.&lt;&#x2F;strong&gt; Proposes concrete rewrites for clauses that fail.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Splitting the task this way keeps each agent’s context small and its failures easy to localize. That same idea is what drew me to &lt;a href=&quot;http:&#x2F;&#x2F;akramlodi.com&#x2F;research&#x2F;self-harnessing-rlms&#x2F;&quot;&gt;harness engineering for recursive language models&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;grounding-with-retrieval&quot;&gt;Grounding with retrieval&lt;&#x2F;h2&gt;
&lt;p&gt;The compliance and fix agents are grounded with a &lt;strong&gt;retrieval-augmented generation&lt;&#x2F;strong&gt; pipeline: Indian legal statutes, NDA templates, and HR policy documents are embedded with sentence-transformers and stored in &lt;strong&gt;ChromaDB&lt;&#x2F;strong&gt;, and the relevant passages are retrieved for each clause before the model judges it.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;stack&quot;&gt;Stack&lt;&#x2F;h2&gt;
&lt;p&gt;Next.js and TypeScript on the front end, &lt;strong&gt;Gemini 2.5 Flash Lite&lt;&#x2F;strong&gt; for the agents, REST APIs between stages, and &lt;strong&gt;Server-Sent Events&lt;&#x2F;strong&gt; to stream each agent’s output as it’s produced.&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
