<?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: Avi Sharma</title>
    <description>The latest articles on DEV Community by Avi Sharma (@avish712).</description>
    <link>https://dev.to/avish712</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4027441%2Fc1721214-ea65-4a80-af42-84cf2ce9c171.jpg</url>
      <title>DEV Community: Avi Sharma</title>
      <link>https://dev.to/avish712</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/avish712"/>
    <language>en</language>
    <item>
      <title>Building TFCRM: Guarded LangGraph Swarms, Postgres MCP, and Durable Churn Analysis for the OpenAI Hackathon</title>
      <dc:creator>Avi Sharma</dc:creator>
      <pubDate>Fri, 17 Jul 2026 12:26:15 +0000</pubDate>
      <link>https://dev.to/avish712/building-tfcrm-guarded-langgraph-swarms-postgres-mcp-and-durable-churn-analysis-for-the-openai-52no</link>
      <guid>https://dev.to/avish712/building-tfcrm-guarded-langgraph-swarms-postgres-mcp-and-durable-churn-analysis-for-the-openai-52no</guid>
      <description>&lt;h2&gt;
  
  
  The Problem: Traditional CRMs Are Data Cemeteries
&lt;/h2&gt;

&lt;p&gt;Most B2B SaaS companies, subscription startups, and agencies suffer from the same operational bottleneck: &lt;strong&gt;stale CRM data&lt;/strong&gt;. Traditional CRMs record historical transactions and basic communication logs perfectly, but they fail to act on live application health metrics before a customer decides to churn. &lt;/p&gt;

&lt;p&gt;Worse yet, spinning up AI agents to solve this problem introduces massive security anxieties. Granting a Large Language Model direct write access to a production database or an automated email dispatcher is an invitation for operational chaos. &lt;/p&gt;

&lt;p&gt;For the OpenAI Hackathon, I built &lt;strong&gt;TFCRM&lt;/strong&gt;—a stateful, customer-success CRM engineered to turn scattered telemetry events and bulk data imports into guarded, evidence-based retention workflows. It bridges the gap between automated AI insights and strict operational discipline.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Technical Architecture
&lt;/h2&gt;

&lt;p&gt;TFCRM is split into a high-performance web ledger, a real-time event ingestion engine, and a database-backed background execution queue.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Technology Stack&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Frontend&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;React 19 + Vite&lt;/td&gt;
&lt;td&gt;Multi-tenant dashboards, role-aware action mapping, and real-time agent token streams over WebSockets.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Backend&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;FastAPI + Python 3.12&lt;/td&gt;
&lt;td&gt;Asynchronous token verification, workspace-scoped RBAC, and background execution polling loops.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Database&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Neon PostgreSQL + &lt;code&gt;pgvector&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Relational business ledger and durable checkpoint storage for long-running LangGraph state machines.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AI Swarm&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;LangGraph + OpenAI&lt;/td&gt;
&lt;td&gt;Guarded routing, semantic resolution caching, and autonomous evidence collection.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Outreach&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Resend API&lt;/td&gt;
&lt;td&gt;Human-in-the-loop delivery engine restricted to verified domain identities.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
mermaid
flowchart TD
    User[CSM / Workspace Owner] --&amp;gt;|Interactive UI| UI[React + Vite Frontend]
    UI --&amp;gt;|JWT Authenticated Requests| API[FastAPI Application]
    API --&amp;gt;|Async State Management| Queue[Durable Background Dispatcher]
    Queue --&amp;gt;|State Machine Isolation| Agents[LangGraph AI Swarm]
    Agents --&amp;gt;|Restricted Handshake| MCP[Postgres MCP Server]
    MCP --&amp;gt;|Read-Only Queries| DB[(Neon PostgreSQL + pgvector)]
    API --&amp;gt;|Transactional Actions| DB
    API --&amp;gt;|Human-Approved Outreach| Resend[Resend Email API]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>python</category>
      <category>webdev</category>
      <category>ai</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
