<?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: Tanmaya sree Chirra</title>
    <description>The latest articles on DEV Community by Tanmaya sree Chirra (@tanmaya_sreechirra_d568b).</description>
    <link>https://dev.to/tanmaya_sreechirra_d568b</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%2F4079374%2Fcd39d5b0-0bb1-446c-9663-3264e1c15b41.jpg</url>
      <title>DEV Community: Tanmaya sree Chirra</title>
      <link>https://dev.to/tanmaya_sreechirra_d568b</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tanmaya_sreechirra_d568b"/>
    <language>en</language>
    <item>
      <title>Why We Built Foresight: Stopping AI from Committing Commercial Suicide</title>
      <dc:creator>Tanmaya sree Chirra</dc:creator>
      <pubDate>Mon, 28 Sep 2026 17:32:24 +0000</pubDate>
      <link>https://dev.to/tanmaya_sreechirra_d568b/why-we-built-foresight-stopping-ai-from-committing-commercial-suicide-1632</link>
      <guid>https://dev.to/tanmaya_sreechirra_d568b/why-we-built-foresight-stopping-ai-from-committing-commercial-suicide-1632</guid>
      <description>&lt;p&gt;If you give an LLM access to a sales inbox, it will eventually agree to an impossible contract. &lt;/p&gt;

&lt;p&gt;Last week, we tested what happens when a prospect sends an aggressive negotiation email: &lt;em&gt;"Can you give us 40% off and get us live into production in two weeks?"&lt;/em&gt; A standard prompt-chained LLM happily replied that it could make that work if the customer signed by Friday. In the real world, sending that email would have triggered a contractual disaster: our engineering team requires at least 21 days for secure VPC peering, our finance team caps rep discounts at 15%, and our security lead had already barred all production data ingestion until an overdue compliance audit was reviewed.&lt;/p&gt;

&lt;p&gt;Stateless LLMs fail at enterprise sales because they suffer from acute context amnesia. They treat each incoming message as an isolated conversational turn, completely blind to the commitments, constraints, and politics established over months of prior calls. &lt;/p&gt;

&lt;p&gt;To fix this, we built &lt;strong&gt;Foresight&lt;/strong&gt;, an enterprise deal intelligence engine that uses &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight&lt;/a&gt; to maintain an active, self-updating memory bank of the entire customer relationship. Instead of simply generating agreeable text, Foresight intercepts incoming demands, checks them against historical commitments and company policies, detects multi-variable collisions, and dynamically updates its strategy when real-world facts change.&lt;/p&gt;

&lt;p&gt;Here is how we designed the system, the architectural trade-offs we encountered, and why agent memory must act as a computational governor rather than a simple passive search index.&lt;/p&gt;




&lt;h2&gt;
  
  
  The System Architecture: How Foresight Fits Together
&lt;/h2&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F56f6lh3a9fdkt7ltzxnu.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F56f6lh3a9fdkt7ltzxnu.png" alt=" " width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enterprise sales deals are not linear chats; they are multi-month distributed state machines. A single deal involves half a dozen stakeholders with competing agendas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Champion&lt;/strong&gt; wants roadmap features delivered yesterday.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Technical Evaluator&lt;/strong&gt; cares about latency, architecture, and deployment constraints.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Security Gatekeeper (CISO)&lt;/strong&gt; cares about compliance, data residency, and audit certifications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Economic Buyer (CFO)&lt;/strong&gt; enforces budget ceilings and hates multi-year lock-in.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Procurement&lt;/strong&gt; plays hardball on discounts and payment terms.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To model this reality without building a bloated microservice architecture, we designed Foresight around three distinct layers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌─────────────────────────────────────────────────────────────┐
│ 1. Historical Interaction Ingestion (Hindsight Memory Bank)  │
│    Ingests call transcripts, emails, and commitments into   │
│    a dedicated deal memory bank via retain().               │
└──────────────────────────────┬──────────────────────────────┘
                               │
                               ▼
┌─────────────────────────────────────────────────────────────┐
│ 2. The Collision Engine                                      │
│    Cross-checks incoming demands against:                   │
│    • Active commitments &amp;amp; fulfillment status in memory       │
│    • Static company baseline policies (SLAs, margins)       │
│    Categorizes conflicts into Security, Timeline, and Price.│
└──────────────────────────────┬──────────────────────────────┘
                               │
                               ▼
┌─────────────────────────────────────────────────────────────┐
│ 3. The Dynamic Reflection &amp;amp; Strategy Loop                   │
│    When real-world state changes occur (e.g. SOC-2 sent),   │
│    memory mutates live, re-evaluating advice from           │
│    defensive blocker to offensive closing plan.             │
└─────────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rather than feeding an entire 8-week call history into a prompt window—which burns tokens, degrades reasoning attention, and costs a fortune—we use &lt;a href="https://vectorize.io/what-is-agent-memory" rel="noopener noreferrer"&gt;Vectorize agent memory&lt;/a&gt; to maintain persistent structured entities: stakeholders, explicit objections, competitor mentions, and an auditable commitment ledger.&lt;/p&gt;




&lt;h2&gt;
  
  
  Core Technical Story: Moving from Naive RAG to Collision Detection
&lt;/h2&gt;

&lt;p&gt;Most developers building sales tooling reach immediately for naive Retrieval-Augmented Generation (RAG): embed previous call summaries in a vector database, perform cosine similarity search on the incoming prompt, and feed the top-k chunks into the context window.&lt;/p&gt;

&lt;p&gt;During our early testing, naive RAG broke down completely. Consider this incoming request from the customer's procurement lead:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Can you give us 40% off and get us live into production in two weeks?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you run a standard vector search against the past 8 weeks of call notes, your embedding model will retrieve chunks containing words like "discount", "pricing", and "timeline". &lt;/p&gt;

&lt;p&gt;What does it miss? &lt;strong&gt;Call #2 from 31 days prior.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Call #2, the customer's CISO (Nadia Chen) stated:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"No production data can touch your platform without our security team reviewing your audited SOC-2 Type II report."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Semantically, "SOC-2 Type II audit" has almost zero cosine similarity to "40% discount". A traditional RAG pipeline ignores it. Yet operationally, that single security mandate is a hard fatal blocker: agreeing to a two-week deployment is contractually impossible because the security team hasn't even begun reviewing the compliance report.&lt;/p&gt;

&lt;p&gt;To solve this, we abandoned simple semantic retrieval and built a deterministic &lt;strong&gt;Multi-Constraint Collision Engine&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Instead of asking the LLM &lt;em&gt;"How should I answer this email?"&lt;/em&gt;, the system evaluates the request against three discrete constraint checks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;🔴 Security Gate:&lt;/strong&gt; Are there unfulfilled compliance commitments or unresolved access blockers?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🟠 Timeline Feasibility:&lt;/strong&gt; Does the requested go-live date violate engineering lead times (4–6 weeks standard) or crash into documented customer code freezes?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🟡 Commercial Alignment:&lt;/strong&gt; Does the requested discount violate delegation-of-authority limits, ignore established budget caps, or fail to account for competitor bids?&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Code-Backed Implementation: How We Integrated Hindsight
&lt;/h2&gt;

&lt;p&gt;Let's look at how this is implemented in our codebase.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Ingesting Deal History with &lt;code&gt;retain()&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;In &lt;code&gt;memory.py&lt;/code&gt;, we initialize the deal bank and index every conversation, stakeholder sensitivity, and commitment into &lt;a href="https://hindsight.vectorize.io/" rel="noopener noreferrer"&gt;Hindsight&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DealMemoryBank&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;deal_path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ACME_DEAL_PATH&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kb_path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;COMPANY_KB_PATH&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deal_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_load_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;deal_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;company_kb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_load_json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;kb_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;commitments&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deal_data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;commitments&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[])&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;interactions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deal_data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;interactions&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[])&lt;/span&gt;

        &lt;span class="c1"&gt;# Initialize Hindsight client
&lt;/span&gt;        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hindsight_client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_init_hindsight&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;retain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;category&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Retains an observation, commitment, or interaction into deal memory.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hindsight_client&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hindsight_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;retain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;bank_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;acme-deal&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;category&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each interaction is tagged with its chronological context. Crucially, promises made by sales reps are extracted into structured &lt;strong&gt;Commitments&lt;/strong&gt; with an explicit initial state: &lt;code&gt;"Overdue"&lt;/code&gt; or &lt;code&gt;"Pending"&lt;/code&gt;, accompanied by the audit note: &lt;em&gt;"No fulfilment recorded"&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Multi-Constraint Collision Evaluation
&lt;/h3&gt;

&lt;p&gt;In &lt;code&gt;collision_detector.py&lt;/code&gt;, the engine intercepts the customer's request and cross-references active commitments and baseline company rules:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;check_collisions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer_request&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;deal_context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="n"&gt;commitments&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;deal_context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;commitments&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[])&lt;/span&gt;
    &lt;span class="n"&gt;kb_deploy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;company_kb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deployment_rules&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt;
    &lt;span class="n"&gt;kb_pricing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;company_kb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pricing_and_discount_rules&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt;

    &lt;span class="c1"&gt;# Check 1: Security Gate (SOC-2 Type II Report)
&lt;/span&gt;    &lt;span class="n"&gt;soc2_comm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;commitments&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;COMM-02&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;is_soc2_completed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;soc2_comm&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;soc2_comm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Completed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="n"&gt;collisions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;is_soc2_completed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;collisions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;severity&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;RED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;badge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;🔴 Security Blocker&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;title&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Unfulfilled SOC-2 Mandate for Production Access&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;description&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Nadia Chen (CISO) explicitly mandated that NO production data can touch Veridian without reviewed SOC-2 Type II audit report.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;evidence&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Call #2 (31 days ago): Nadia stated &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;No production data can touch your platform without our security team reviewing your audited SOC-2 Type II report.&lt;/span&gt;&lt;span class="sh"&gt;'"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Commitment COMM-02: &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;SOC-2 Type II Audit Report Delivery&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; is currently OVERDUE (31 days elapsed).&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;impact&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;CRITICAL: Promising deployment before SOC-2 sign-off triggers an immediate security veto.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;collisions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;severity&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;GREEN&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;badge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;✅ Security Cleared&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;title&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SOC-2 Type II Report Delivered&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;description&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Security gate unlocked for staging and production onboarding.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;

    &lt;span class="c1"&gt;# Check 2: Timeline Feasibility
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;any&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;customer_request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;two weeks&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2 weeks&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;14 days&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]):&lt;/span&gt;
        &lt;span class="n"&gt;collisions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;severity&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ORANGE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;badge&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;🟠 Timeline Conflict&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;title&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Unrealistic 2-Week Deployment Request vs. 4-6 Week Baseline&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;description&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Veridian standard onboarding takes 4 to 6 weeks. No 2-week promise was ever recorded.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;evidence&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Call #3: SA confirmed standard deployment is 4 to 6 weeks due to VPC peering.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Call #9: Marcus confirmed ACME has an annual production freeze starting October 15.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;impact&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HIGH: Agreeing creates catastrophic delivery failure and SLA breach risk.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;collisions&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;collisions&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice the evidence array. Every single collision badge is tied directly to a specific historical call, speaker, and timestamp. In enterprise environments, human operators do not trust an AI that asserts &lt;em&gt;"This is risky"&lt;/em&gt;. They trust an AI that shows the exact receipt from Call #2.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Dynamic Memory Reflection
&lt;/h3&gt;

&lt;p&gt;The most important capability of &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight agent memory&lt;/a&gt; is that memory is mutable. It updates when real-world actions occur.&lt;/p&gt;

&lt;p&gt;When the sales rep finally emails the compliance package to the prospect's security team, they click &lt;strong&gt;"Mark SOC-2 Sent to Nadia"&lt;/strong&gt; in the UI. Here is what happens under the hood:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update_commitment_status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;deal_context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;commitment_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;new_status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;notes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;commitments&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;deal_context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;commitments&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[])&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;comm&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;commitments&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;comm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;commitment_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;comm&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;new_status&lt;/span&gt;
            &lt;span class="n"&gt;comm&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status_notes&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;notes&lt;/span&gt;
            &lt;span class="n"&gt;comm&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;last_updated&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;isoformat&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

            &lt;span class="c1"&gt;# Retain this critical state change into Hindsight memory
&lt;/span&gt;            &lt;span class="n"&gt;reflection_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;COMMITMENT STATE CHANGE: &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;comm&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;title&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; for recipient &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;comm&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;recipient&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
                &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;changed to [&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;new_status&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;]. Note: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;notes&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hindsight_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;retain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="n"&gt;bank_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;acme-deal&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;reflection_text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;commitment_update&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When this state mutation is saved, the Collision Engine immediately recalculates. The 🔴 Security Blocker dissolves into a &lt;code&gt;✅ Security Cleared&lt;/code&gt; notification, and the downstream response generation pivots automatically.&lt;/p&gt;




&lt;h2&gt;
  
  
  Results and Behavior: The Live Interaction
&lt;/h2&gt;

&lt;p&gt;To verify the system, we ran our benchmark enterprise deal: &lt;strong&gt;ACME Corp&lt;/strong&gt; (an 8-week history comprising 9 calls, 5 stakeholders, a \$72k quote, and an active competing bid from NimbusAI at \$48k).&lt;/p&gt;

&lt;h3&gt;
  
  
  Interaction 1: Before Memory Reflection (Defensive Triage)
&lt;/h3&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7qituzq60suh3zcx5wgu.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7qituzq60suh3zcx5wgu.png" alt=" " width="800" height="428"&gt;&lt;/a&gt;&lt;br&gt;
When the aggressive request (&lt;em&gt;"40% off + 2-week deploy"&lt;/em&gt;) arrives:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Foresight output:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;🔴 &lt;strong&gt;Security Blocker:&lt;/strong&gt; Missing SOC-2 Report (Overdue by 31 days).&lt;/li&gt;
&lt;li&gt;🟠 &lt;strong&gt;Timeline Conflict:&lt;/strong&gt; 2 weeks requested vs. 4–6 week standard.&lt;/li&gt;
&lt;li&gt;🟡 &lt;strong&gt;Commercial Alignment:&lt;/strong&gt; 40% discount (\$43,200) violates margin policy and is unnecessarily low given Linda's \$50k budget ceiling.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strategic Advice Generated:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;"⛔ DO NOT agree to deployment dates or price concessions yet. Your immediate priority is delivering the SOC-2 report to Nadia Chen."&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Interaction 2: After Memory Reflection (Offensive Negotiation)
&lt;/h3&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbjj1agqk927n4x1lja1d.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbjj1agqk927n4x1lja1d.png" alt=" " width="800" height="428"&gt;&lt;/a&gt;&lt;br&gt;
The rep clicks &lt;strong&gt;"Mark SOC-2 Sent to Nadia"&lt;/strong&gt;. Hindsight records the reflection. The collision check re-runs automatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Foresight output:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;✅ Security Cleared&lt;/code&gt;: SOC-2 delivered; security gate unlocked.&lt;/li&gt;
&lt;li&gt;🟠 &lt;strong&gt;Timeline Conflict:&lt;/strong&gt; Adjusted to offer a phased 3-week express onboarding with dedicated solution architects.&lt;/li&gt;
&lt;li&gt;🟡 &lt;strong&gt;Commercial Alignment:&lt;/strong&gt; Counter-offers at &lt;strong&gt;\$49,000 ARR&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strategic Advice Generated:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;"🎯 PROCEED WITH COMMERCIAL NEGOTIATION. Target price: \$49,000 (respects Linda's \$50k budget ceiling and beats NimbusAI's \$48k offer) with an agreement to sign before the October 15 code freeze."&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The draft customer reply updates instantly, switching from a defensive delay to a confident commercial closing pitch.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F89wraj2bn9e7cu4wr5bd.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F89wraj2bn9e7cu4wr5bd.png" alt=" " width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;p&gt;Building Foresight surfaced several non-obvious engineering realities about memory-augmented agents:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Negative Grounding Prevents Hallucinated Certainty
&lt;/h3&gt;

&lt;p&gt;When tracking commitments, never let your agent declare: &lt;em&gt;"The report was never sent."&lt;/em&gt; If an interaction happened outside the recorded system, that absolute claim destroys user trust. Instead, our ledger outputs: &lt;strong&gt;&lt;code&gt;"No fulfilment recorded"&lt;/code&gt;&lt;/strong&gt;. That subtle wording change reflects epistemic humility: the agent only claims knowledge of recorded events.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Decouple Static Policy from Dynamic Memory
&lt;/h3&gt;

&lt;p&gt;Early on, we tried storing company policies (like minimum deployment timelines and discount delegation matrices) inside the same memory bank as call transcripts. The LLM regularly confused company rules with customer statements. Separating static company ground truth (&lt;code&gt;company_kb.json&lt;/code&gt;) from dynamic deal memories (&lt;code&gt;acme_deal.json&lt;/code&gt;) eliminated cross-contamination completely.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Multi-Variable Constraints Beat Pure Probabilistic Generation
&lt;/h3&gt;

&lt;p&gt;You should not rely on an LLM's next-token prediction to decide whether a discount is legally permissible. Use deterministic code or structured Pydantic schemas to validate hard boundaries (budgets, compliance rules, timeline baselines), and let the LLM handle the natural language synthesis within those validated bounds.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Stateless chatbots treat conversations as ephemeral noise. But in high-stakes enterprise workflows, conversation history is a web of promises, liabilities, and leverage.&lt;/p&gt;

&lt;p&gt;By integrating &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight&lt;/a&gt; into our deal intelligence architecture, we gave our agent the ability to remember what was promised, flag dangerous collisions, and dynamically adapt its strategy when real-world milestones are reached. That is the difference between an AI that makes reckless promises and one you can actually trust with your business.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Explore the full implementation on &lt;a href="https://github.com/Rupikagouri/CtrlAltDeploy" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>llm</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Finding Exoplanets in Noisy Data with Machine Learning</title>
      <dc:creator>Tanmaya sree Chirra</dc:creator>
      <pubDate>Mon, 14 Sep 2026 18:00:31 +0000</pubDate>
      <link>https://dev.to/tanmaya_sreechirra_d568b/finding-exoplanets-in-noisy-data-with-machine-learning-25d0</link>
      <guid>https://dev.to/tanmaya_sreechirra_d568b/finding-exoplanets-in-noisy-data-with-machine-learning-25d0</guid>
      <description>&lt;p&gt;We Built an AI to Hunt Earth-Like Planets — Here's How&lt;/p&gt;

&lt;p&gt;Finding planets around other stars is hard. Kepler gives us raw light curves — brightness measurements over time — and buried inside that noisy data are tiny dips caused by planets &lt;br&gt;
crossing their star. We built Astrobit 1.0 to find them automatically.&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;p&gt;The Problem&lt;/p&gt;

&lt;p&gt;Kepler's Simple Aperture Photometry (SAP) flux is messy. Instrumental systematics, cosmic rays, and quarter-boundary artifacts all look like signals. A naive threshold approach &lt;br&gt;
misses real planets and flags false positives constantly.&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;p&gt;Architecture&lt;/p&gt;

&lt;p&gt;Raw SAP Flux&lt;br&gt;
     ↓&lt;br&gt;
[Cleaner] — mask bad cadences + sigma-clip outliers&lt;br&gt;
     ↓&lt;br&gt;
[Detrender] — per-quarter Savitzky-Golay filter&lt;br&gt;
     ↓&lt;br&gt;
[BLS Search] — 50k coarse grid → fine refinement → alias check&lt;br&gt;
     ↓&lt;br&gt;
[Feature Extractor] — SDE, depth, SNR, odd/even, secondary eclipse&lt;br&gt;
     ↓&lt;br&gt;
[Random Forest Classifier] — trained on 269 labelled stars&lt;br&gt;
     ↓&lt;br&gt;
[Platt Scaler] — calibrates scores to probabilities&lt;br&gt;
     ↓&lt;br&gt;
[Vetter] — secondary eclipse, odd/even, recurrence, systematics&lt;br&gt;
     ↓&lt;br&gt;
Ranked Candidates → submission.csv&lt;/p&gt;

&lt;p&gt;Each stage is independent and cacheable — BLS results are cached to CSV so you can interrupt and resume without recomputing.&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;p&gt;What We Built&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cleaning — mask bad cadences, sigma-clip outliers from raw SAP flux&lt;/li&gt;
&lt;li&gt;Detrending — per-quarter Savitzky-Golay filter. Recovers ~90% of true transit depth vs ~33% with a running median, and avoids edge artifacts at Kepler's quarterly roll boundaries&lt;/li&gt;
&lt;li&gt;BLS Period Search — 50k log-spaced coarse grid + 600-point fine refinement around each peak. Alias checking at 0.5x, 1x, 2x, 3x catches period harmonics. ~100x cheaper than full-
resolution search&lt;/li&gt;
&lt;li&gt;Feature Extraction — SDE, transit depth, SNR, odd/even depth ratio, secondary eclipse depth&lt;/li&gt;
&lt;li&gt;Random Forest Classifier — trained on 269 labelled stars, replaces brittle single-SDE-threshold with a multi-feature decision boundary&lt;/li&gt;
&lt;li&gt;Platt Scaling — calibrates raw model scores to actual probabilities on the dev set&lt;/li&gt;
&lt;li&gt;Vetting — secondary eclipse check, odd/even depth consistency, per-quarter recurrence, known systematic period filtering&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;p&gt;Results&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stage&lt;/th&gt;
&lt;th&gt;Impact&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SG detrending vs running median&lt;/td&gt;
&lt;td&gt;~90% vs ~33% transit depth recovery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Coarse-to-fine BLS&lt;/td&gt;
&lt;td&gt;~100x faster than full-resolution search&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Alias checking&lt;/td&gt;
&lt;td&gt;Catches period harmonics at 0.5x–3x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RF classifier vs SDE threshold&lt;/td&gt;
&lt;td&gt;Multi-feature boundary, fewer false positives&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Platt scaling&lt;/td&gt;
&lt;td&gt;Calibrated confidence scores on dev set&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Vetting layer&lt;/td&gt;
&lt;td&gt;Filters secondary eclipses, systematics, odd/even inconsistencies&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;p&gt;Lessons Learned&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Detrending matters more than the classifier.&lt;/strong&gt; A bad detrend corrupts every downstream feature. We spent more time on the SG filter than the ML model — worth it.&lt;br&gt;
• &lt;strong&gt;Cache everything.&lt;/strong&gt; BLS on a full Kepler star takes time. Caching to CSV saved us hours during iteration.&lt;br&gt;
• &lt;strong&gt;Single thresholds break.&lt;/strong&gt; SDE alone is a terrible classifier. The moment we switched to a multi-feature Random Forest, false positive rate dropped significantly.&lt;br&gt;
• &lt;strong&gt;Calibration is underrated.&lt;/strong&gt; Raw model scores are not probabilities. Platt scaling on the dev set made our confidence scores actually trustworthy for ranking candidates.&lt;br&gt;
• &lt;strong&gt;Vetting is not optional.&lt;/strong&gt; The classifier catches most false positives, but secondary eclipse checks and odd/even consistency are cheap and eliminate a whole class of eclipsing &lt;br&gt;
binary contamination.&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;p&gt;Stack&lt;/p&gt;

&lt;p&gt;Python · scikit-learn · lightkurve · scipy · numpy&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;p&gt;Repo&lt;/p&gt;

&lt;p&gt;🔗 &lt;a href="https://github.com/25wh1a6678-art/Astrobit_1.0" rel="noopener noreferrer"&gt;github.com/25wh1a6678-art/Astrobit_1.0&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>machinelearning</category>
      <category>datascience</category>
    </item>
    <item>
      <title>From Zero to Hindi Voice Agent in 10 Days: Schemes, Memory, and Outbound Calls"</title>
      <dc:creator>Tanmaya sree Chirra</dc:creator>
      <pubDate>Sat, 15 Aug 2026 18:37:54 +0000</pubDate>
      <link>https://dev.to/tanmaya_sreechirra_d568b/from-zero-to-hindi-voice-agent-in-10-days-schemes-memory-and-outbound-calls-24cf</link>
      <guid>https://dev.to/tanmaya_sreechirra_d568b/from-zero-to-hindi-voice-agent-in-10-days-schemes-memory-and-outbound-calls-24cf</guid>
      <description>&lt;h1&gt;
  
  
  Building Ashley: A Hindi Voice Agent for Rural Financial Access
&lt;/h1&gt;

&lt;h2&gt;
  
  
  The Problem and the Users
&lt;/h2&gt;

&lt;p&gt;India has over 500 million Jan Dhan account holders — yet millions of first-time banking users in rural areas don't know what schemes they qualify for, how UPI works, or even how to &lt;br&gt;
open a zero-balance account. They can't navigate government portals. They don't read English. And they're often afraid of being cheated.&lt;/p&gt;

&lt;p&gt;A chatbot doesn't help them. A voice agent does.&lt;/p&gt;

&lt;p&gt;Ashley is a Hindi/Hinglish voice agent built for exactly these users — someone who speaks to them like a helpful neighbour, in their own language, for free, 24/7. Built for the #&lt;br&gt;
VoiceForBharat challenge under the Financial Services track.&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;h2&gt;
  
  
  What Ashley Does
&lt;/h2&gt;

&lt;p&gt;• Speaks and understands Hindi and Hinglish&lt;br&gt;
• Checks eligibility for 5 government schemes: Jan Dhan, PM Kisan, Mudra Yojana, PMJJBY, PMSBY&lt;br&gt;
• Remembers returning users (with their consent)&lt;br&gt;
• Escalates fraud cases to human agents with a reference ID&lt;br&gt;
• Places outbound Twilio reminder calls for scheme deadlines&lt;br&gt;
• Hands off to Priya, a specialist agent, for deep scheme queries&lt;br&gt;
• Shows a live call analytics dashboard and escalations dashboard&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;h2&gt;
  
  
  How the System Works
&lt;/h2&gt;

&lt;p&gt;Browser mic → Web Speech API (STT)&lt;br&gt;
           → Flask /chat → LLM (OpenRouter) → Tool calls&lt;br&gt;
           → Murf Falcon API (TTS) → Audio URL → Browser plays&lt;/p&gt;

&lt;p&gt;The frontend handles speech recognition via the Web Speech API. The text goes to a Flask backend, which runs it through an LLM with tool-calling enabled. The LLM can call tools like &lt;br&gt;
check_eligibility, save_user, create_escalation, or handoff_to_scheme_specialist. The response text is sent to Murf Falcon for TTS, and the audio URL is played back in the browser.&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;h2&gt;
  
  
  The Most Important Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Indian Voice with Personality — Murf Falcon (hi-IN-shweta)
&lt;/h3&gt;

&lt;p&gt;Ashley uses Murf Falcon GEN2 with the hi-IN-shweta voice — warm, natural, and unmistakably Indian. The system prompt enforces a strict personality: warm, unhurried, under 2 sentences&lt;br&gt;
per response, mirrors the user's language exactly.&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
MURF_VOICE_ID = "hi-IN-shweta"&lt;/p&gt;

&lt;p&gt;def murf_tts(text: str) -&amp;gt; str:&lt;br&gt;
    r = requests.post(&lt;br&gt;
        "&lt;a href="https://api.murf.ai/v1/speech/generate" rel="noopener noreferrer"&gt;https://api.murf.ai/v1/speech/generate&lt;/a&gt;",&lt;br&gt;
        headers={"api-key": MURF_API_KEY, "Content-Type": "application/json"},&lt;br&gt;
        json={"voiceId": MURF_VOICE_ID, "text": text, "format": "MP3", "modelVersion": "GEN2"},&lt;br&gt;
    )&lt;br&gt;
    r.raise_for_status()&lt;br&gt;
    return r.json()["audioFile"]&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Safety Guardrails
&lt;/h3&gt;

&lt;p&gt;Ashley will never ask for OTPs, PINs, or account numbers. If someone tries, she says exactly:&lt;br&gt;
│ &lt;em&gt;"Main aapka OTP ya PIN kabhi nahi maangunga. Koi bhi yeh maange toh fraud ho sakta hai — turant call kaatein."&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Scheme Eligibility Tool
&lt;/h3&gt;

&lt;p&gt;A local dataset of 5 schemes with eligibility rules. The LLM calls check_eligibility as soon as it has one relevant data point — age, farmer status, business ownership — without &lt;br&gt;
waiting to collect everything first.&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
def check_eligibility(answers: dict) -&amp;gt; dict:&lt;br&gt;
    eligible = []&lt;br&gt;
    for name, scheme in SCHEMES.items():&lt;br&gt;
        try:&lt;br&gt;
            if scheme&lt;a href="https://dev.toanswers"&gt;"rules"&lt;/a&gt;:&lt;br&gt;
                eligible.append({&lt;br&gt;
                    "scheme": name,&lt;br&gt;
                    "description": scheme["description"],&lt;br&gt;
                    "documents": scheme["documents"],&lt;br&gt;
                    "apply_at": scheme["apply_at"],&lt;br&gt;
                })&lt;br&gt;
        except (TypeError, ValueError):&lt;br&gt;
            continue&lt;br&gt;
    return {"eligible_schemes": eligible, "data_as_of": "August 2025 (local dataset)"}&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Consent-Gated Memory
&lt;/h3&gt;

&lt;p&gt;Ashley asks before saving anything:&lt;br&gt;
│ &lt;em&gt;"Kya main yeh yaad rakh sakta hoon aapke liye?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Only name, language preference, and scheme facts are stored — never account numbers or Aadhaar.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Human Escalation + Outbound Calls
&lt;/h3&gt;

&lt;p&gt;Fraud reports and blocked account cases get escalated with a reference ID. Users can also request a Twilio outbound reminder call to their phone for scheme deadlines.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Specialist Handoff
&lt;/h3&gt;

&lt;p&gt;When a user needs detailed scheme guidance, Ashley hands off to Priya — a specialist agent with a different system prompt — without making the user repeat themselves.&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges and How I Overcame Them
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Overlapping Audio Problem
&lt;/h3&gt;

&lt;p&gt;The biggest bug: when a user typed a message before clicking "Start Call", two audio responses would play simultaneously — the greeting and the reply — completely overlapping.&lt;/p&gt;

&lt;p&gt;Root cause: speakAgent() was creating a new Audio() object every time without stopping the previous one. Also, the chat input depended on an active voice session — if /start hadn't &lt;br&gt;
been called, /chat had no session history and silently failed.&lt;/p&gt;

&lt;p&gt;Fix: Made speakAgent() return a Promise and always call stopAudio() first. Created a single handleUserMessage(text, source) function that both voice and chat feed into. If no session&lt;br&gt;
exists when a chat message arrives, it auto-starts one, awaits the greeting, then sends the message — in sequence, never in parallel.&lt;/p&gt;

&lt;p&gt;javascript&lt;br&gt;
function stopAudio() {&lt;br&gt;
    if (agentAudio) {&lt;br&gt;
        agentAudio.onended = null;&lt;br&gt;
        agentAudio.onerror = null;&lt;br&gt;
        agentAudio.pause();&lt;br&gt;
        agentAudio = null;&lt;br&gt;
    }&lt;br&gt;
    isSpeaking = false;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;function speakAgent(reply, audioUrl) {&lt;br&gt;
    return new Promise((resolve) =&amp;gt; {&lt;br&gt;
        stopAudio(); // always kill previous before starting new&lt;br&gt;
        // ...&lt;br&gt;
    });&lt;br&gt;
}&lt;/p&gt;

&lt;h3&gt;
  
  
  Free LLM Rate Limits
&lt;/h3&gt;

&lt;p&gt;OpenRouter's free tier has a 50 requests/day cap. Hit it mid-demo. Solution: keep a fallback model ready (nvidia/nemotron-3-super-120b-a12b:free) and consider adding $5 credits for &lt;br&gt;
recording days.&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Build and Run It
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Components You Need
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;th&gt;Tool used&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;STT&lt;/td&gt;
&lt;td&gt;Converts speech to text&lt;/td&gt;
&lt;td&gt;Web Speech API (browser)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LLM&lt;/td&gt;
&lt;td&gt;Understands and responds&lt;/td&gt;
&lt;td&gt;OpenRouter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TTS&lt;/td&gt;
&lt;td&gt;Converts text to speech&lt;/td&gt;
&lt;td&gt;Murf Falcon API&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Transport&lt;/td&gt;
&lt;td&gt;Connects everything&lt;/td&gt;
&lt;td&gt;Flask + fetch&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Setup
&lt;/h3&gt;

&lt;p&gt;bash&lt;br&gt;
git clone &lt;a href="https://github.com/your-username/ashley" rel="noopener noreferrer"&gt;https://github.com/your-username/ashley&lt;/a&gt;&lt;br&gt;
cd ashley&lt;br&gt;
python3 -m venv venv&lt;br&gt;
source venv/bin/activate&lt;br&gt;
pip install -r requirements.txt&lt;/p&gt;

&lt;h3&gt;
  
  
  API Keys
&lt;/h3&gt;

&lt;p&gt;Create a .env file — never commit this:&lt;/p&gt;

&lt;p&gt;MURF_API_KEY=your_key&lt;br&gt;
OPENROUTER_API_KEY=your_key&lt;br&gt;
TWILIO_ACCOUNT_SID=your_sid&lt;br&gt;
TWILIO_AUTH_TOKEN=your_token&lt;br&gt;
TWILIO_FROM_NUMBER=+1xxxxxxxxxx&lt;br&gt;
PUBLIC_BASE_URL=&lt;a href="https://your-ngrok-url.ngrok.io" rel="noopener noreferrer"&gt;https://your-ngrok-url.ngrok.io&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Run
&lt;/h3&gt;

&lt;p&gt;bash&lt;br&gt;
python server.py&lt;/p&gt;

&lt;h1&gt;
  
  
  open &lt;a href="http://localhost:5000" rel="noopener noreferrer"&gt;http://localhost:5000&lt;/a&gt;
&lt;/h1&gt;

&lt;p&gt;For outbound calls, run ngrok in a separate terminal:&lt;br&gt;
bash&lt;br&gt;
ngrok http 5000&lt;/p&gt;

&lt;p&gt;Then update PUBLIC_BASE_URL in .env with the ngrok URL.&lt;/p&gt;

&lt;h3&gt;
  
  
  Test a Conversation
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;a href="http://localhost:5000" rel="noopener noreferrer"&gt;http://localhost:5000&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Enter your name or phone number&lt;/li&gt;
&lt;li&gt;Click "Baat Shuru Karein" or just type in the chat box&lt;/li&gt;
&lt;li&gt;Ask: "Main kisan hoon, mujhe kya mil sakta hai?"&lt;/li&gt;
&lt;li&gt;Ashley will ask your age and land size, then show eligible schemes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd Improve Next
&lt;/h2&gt;

&lt;p&gt;• Replace Web Speech API with Deepgram or AssemblyAI for better Hindi accuracy&lt;br&gt;
• Add support for regional languages: Tamil, Bengali, Marathi&lt;br&gt;
• Move from SQLite to PostgreSQL for production&lt;br&gt;
• Add a proper job queue so outbound calls don't block the server&lt;br&gt;
• Stream TTS audio instead of waiting for the full clip&lt;/p&gt;

&lt;p&gt;━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;• 🔗 GitHub: &lt;a href="https://github.com/25wh1a6678-art/voice_agent" rel="noopener noreferrer"&gt;https://github.com/25wh1a6678-art/voice_agent&lt;/a&gt;&lt;br&gt;
• 📊 Analytics: &lt;a href="http://localhost:5000/dashboard" rel="noopener noreferrer"&gt;http://localhost:5000/dashboard&lt;/a&gt;&lt;br&gt;
• 🆘 Escalations: &lt;a href="http://localhost:5000/escalations" rel="noopener noreferrer"&gt;http://localhost:5000/escalations&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1176upeiaus3j6lt42ko.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1176upeiaus3j6lt42ko.png" alt=" " width="800" height="622"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>voiceagent</category>
      <category>python</category>
      <category>opensource</category>
      <category>fintech</category>
    </item>
  </channel>
</rss>
