Spaces:
Sleeping
Sleeping
Commit History
-
feat(voice): KI-028 β clickable Live on/off toggle (green β red)β
Per user request: the Live indicator is now a clickable toggle, not a static status pill. Default green (Live on). Click β red (Live off, but PTT still works). Click again β back to green. PTT's suspend-and-resume now respects the user's persistent intent β if the user explicitly turned Live off, PTT does its one turn and leaves Live off; if Live was on, PTT resumes Live after the turn. β’ userPrefersLive β new state, defaults to true, persisted to localStorage("insurance_live_pref"). Survives reloads. β’ A useEffect syncs userPrefersLive β live.setLive() and to localStorage on every change. β’ startRecording (PTT) still calls live.setLive(false) to release the mic during recording, but the onstop handler only calls live.setLive(true) IF userPrefersLive is still true. β’ Status pill became a <button>. Green-tinted bg + emerald dot when on; rose-tinted bg + rose dot when off. Hover indicates clickability. β’ Copy: "Voice on β just speak" / "Voice off β click toβ¦4ae5278 -
feat(voice): KI-027 β Live is the only voice mode; one-shot PTT pauses itβ
Voice UX simplification per the 2026-05-14 user request. The previous three-mode setup (push-to-talk button, Hands-free checkbox, Live toggle) caused the duplicate-mic / duplicate-/api/chat dispatch bug visible in the user's screenshot, and there was no clear default mode. Single-mode design: β’ Live = ALWAYS ON. The mic is open from the moment the page loads (auto-enable in a mount effect). There is no longer a "Go Live" toggle β it's just on. Status pill in the toolbar reads "Just speak β I'm listening" with a pulsing green dot. β’ π€ push-to-talk button = momentary suspend. Clicking it calls live.setLive(false) (which tears down the always-on stream), waits 120ms for the AudioContext to release the mic, opens a fresh one-shot recorder, captures with VAD auto-cutoff after 2s of silence, transcribes + sends, then immediately calls live.setLive(true) to resume Live. One physical button = one turn. β’ Hands-free checkbox: REMOVED. Its "VAD cutoff" β¦e01547c -
fix: KI-026 β voice mode mutual exclusion (Live blocks legacy mic paths)β
User report 2026-05-14: Live β mode produced duplicate user messages, duplicate bot replies, and two TTS audios played simultaneously for one spoken utterance. Root cause: three voice paths share no exclusion guard. Path 1 β Live mode (useLiveConversation): persistent mic stream + VAD + its OWN MediaRecorder β onUtterance β transcribe β postChat. Path 2 β Push-to-talk (π€ button β startRecording): independent mic stream + ITS OWN MediaRecorder β on stop, transcribe β send β postChat. Path 3 β Hands-free useEffect: auto-calls startRecording (path 2). When Live β was on and the user also clicked the π€ button (or had Hands-free ticked), both Path 1 and Path 2 captured the same speech in slightly different audio buffers, produced slightly different transcripts ("Yeah, no, no parent plans..." vs "No, no parent plans..."), and both posted to /api/chat. The orchestrator advanced fact-find state on each, producing different replies to what the user perceived as one utterance. Fix: three inβ¦effcfeb -
perf: KI-025 β load-balance brain calls across NIM Qwen β Groq Llamaβ
The NIM 40 req/min rate cap is the upstream bottleneck on every audit and eval. Groq has independent rate quota and a Llama-3.3-70B LPU primary already in BRAIN_CHAIN/FAST_BRAIN_CHAIN as a cross-provider fallback. New _balanced_brain_chain() hoists the Groq entry to position 0 on 50% of calls (per-call random.random(), no shared state, no GIL races, fair in aggregate) so half the brain traffic goes to each provider β effectively 2Γ sustained brain throughput. The full fallback chain is preserved when Groq is primary (Groq β NIM Qwen β other NIM models β ...), so reliability is unchanged. Groq LPU typically has sub-1s TTFT, often faster than NIM Qwen β so for fact-find / QA this rotation is also a strict latency win. Tests pin: (a) probability=0 keeps NIM primary, (b) probability=1 hoists Groq, (c) rotation preserves the full chain (no candidates lost), (d) in aggregate over 1000 calls with seeded random, ~50% land on Groq primary. Co-Authored-By: Claude Opus 4.7 (1M context) <noreplβ¦a04c17a -
perf(eval): KI-024 β parallelize 96-Q gold eval with --workers semaphoreβ
Was fully serial: 96 questions Γ ~25s = 38 min total. Now defaults to 6 concurrent under a semaphore. Cap is upstream NIM (40 req/min, ~2 calls per question), so 6 workers gives ~5Γ speedup before saturating. Output order preserved via indexed result slots + a log lock for printing. Use --workers 1 to reproduce historical serial timing if needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1304e7c -
fix: KI-023 β word-boundary intent triggers + KI-018 regression testβ
Two locked-in hardenings around the routing fix. KI-023 β FACT_FIND_TRIGGERS / COMPARISON_KEYWORDS / RECOMMEND_KEYWORDS now match on word boundaries via re.search(\b<phrase>\b), not naive substring. The "hi" greeting trigger was matching as a substring of "which", "this", "high", "thigh" β so questions like "Which is better between A and B?" were misclassified as fact_find. This explains a portion of the 263 refusals in today's 100-persona audit: comparison/qa questions that start with "Which..." were being routed to needs_finder. Refactor β extracted the fact-find routing predicate from handle_turn into a pure function `should_route_to_fact_find(intent, *, profile_is_empty, in_fact_find_continuation, free_form_session)` and the context-dependent-intents set into module-level CONTEXT_DEPENDENT_INTENTS frozenset. Decision logic is now testable without mocking handle_turn's network calls. Tests β tests/test_routing_regression.py (11 cases, all passing, stdlib unittest only) locks in: β¦3fb3586 -
fix: KI-018..022 β routing, profile telemetry, NIM timeouts, judge JSON, chat clearβ
Five interlocking enterprise-readiness fixes plus a master audit report. KI-018 β orchestrator.py: stop force-routing QA intent to fact-find when the session profile is empty. The KI-013 guard was over-correcting: every QA question ("What's the waiting period for PED in Activ Assure?") was being answered with "Happy to help. First, your age?". Restrict the empty-profile guard to {recommendation, comparison} intents only. 5-Q post-fix smoke: factual accuracy 0% β 60%; nim-chain serving 100% of QA (was 0%). Full re-eval owed. KI-019 β orchestrator.py: populate TurnResult.profile_updates from the fact-find branch (previously only the free-form branch populated it). The 100-persona audit appeared to show age captured for only 12/100 personas when the slot-filler was actually working β confirmed by the fact_find_complete readback "42 years old; covering self+spouse+kids+ parents; income 25L+". This was a telemetry bug, not a slot-filler bug. KI-020 β main.py / session_state.py / frontendβ¦bcb7079 -
feat(rag): tools/ingest_kb_summaries.py β embed kb/policies/*.md (KI-019)β
224 hand-written policy summaries in kb/policies/<id>.md were never embedded. Retrieval matched against raw PDF prose instead of clean natural-language section text. Bad for "what does X cover?" queries. New ingester: - Parses YAML frontmatter for canonical policy_id, insurer_slug, policy_name, uin_code. - Splits body at H2 boundaries (Identity, Eligibility, Waiting periods, Coverage, Sub-limits, Exclusions, etc.) β one section per schema-field family. - SKIPS sections where every H3 field is "_not specified_" (no information content). - Embeds each surviving section via BGE-small. - Inserts to same Chroma `policies` collection with doc_type="summary" and kb_section=<H2 title> for facet filtering. Expected impact: retrieve.py now has summary chunks alongside raw wordings β better recall for natural-language Q&A, cleaner citations (one summary section vs 3-4 raw chunks per topic). Ingestion currently running locally; once complete, will re-upload Chroma β¦244fa54 -
docs: ADR-025 (single-Chroma-collection rationale) + KI-018/019 backlogβ
ADR-025 documents the architectural decision to keep one Chroma collection partitioned by doc_type metadata rather than splitting into 4 collections (policies, regulatory, reviews, profiles). Records the trade-off: joint retrieval simplicity wins over per-type independence, with explicit revisit triggers for when to split later. KI-018 β rag/policies.duckdb is a 132-byte empty stub from ADR-004's hybrid design that was never populated. Marketplace reads JSON directly instead. Options: (A) populate from data/policy_facts/*.json for SQL filtering, (B) remove dead code. Backlog. KI-019 β kb/policies/*.md (224 hand-written policy summaries) are NOT embedded. Retrieval would benefit from natural-language summary chunks for "what does X cover?" style questions. Backlog. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>a2ce565 -
feat(reviews): KI-017 β enriched per-facet review chunks (10 β 60)β
Was: 1 generic paragraph per insurer (β500 chars) β bad recall for review queries because the LLM had to disambiguate metrics from sentiment from news from inside one blob. Now: 4-6 semantically distinct chunks per insurer: - claim_metrics (IRDAI numbers) - aggregator_ratings (Policybazaar / InsuranceDekho / MouthShut / Trustpilot) - reddit_sentiment (themes + sample URLs) - youtube_coverage (creator + video links) - recent_news (one line per item) - overall_score (aggregate trust + letter grade) Each carries a `review_facet` metadata field so retrieve.py can filter or boost when intent is clear. Live counts (verified against rag/_hf_dataset_backup/rag/vectors): - 10 insurers Γ 6 facets = 60 review chunks total - was 10 chunks β 6Γ richer recall surface Also: backwards-compat shim β old `review_to_paragraph()` still works (returns concat of all facets) so any external caller doesn't break. After this commit, push to HF Dataset (`rohitsar567/insurance-bot-data`) viaβ¦85a34b0 -
docs: 2026-05-14 quality sprint scoreboardβ
Single-day sprint that closed 11 of 16 documented issues across three discovery channels: code review (6), 100-persona audit (2), real user testing (3). The remaining 3 P2 + 2 P3 items are tracked in known-issues.md backlog. Net before/after: - P0 open: 5 β 0 - P1 open: 5 β 0 - Audit framework: none β 100Γ30-turn simulation in production - Live deploy: 9 quality commits between dae8de8 β ffefacf Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>08a5304 -
fix(persona): KI-013 reinforcement β demographic-aware recommendation rulesβ
Add explicit system-prompt rules so the brain LLM avoids demographic-mismatched recommendations even if the orchestrator's profile-completeness gate somehow allows a free-form recommendation with partial info: Rule 8 β RECOMMENDATIONS MUST MATCH USER DEMOGRAPHICS - Never recommend senior-only policies unless age β₯60 or asking about parents - Never recommend critical-illness-only policies unless that condition was raised - Never recommend a senior-citizen rider unless parents_to_insure is true - If profile incomplete, ASK the missing field β don't pitch - If forced to pitch with partial info, explicitly call out which fact is driving the recommendation Rule 9 β VERIFY PROFILE BEFORE PERSONALIZED RECOMMENDATIONS - On recommendation requests, briefly read back the key facts the bot is relying on ("Quick check: you're 32, covering self+spouse, βΉ15-30k budget, right?") and proceed only if user confirms. This is the persona-level defence in depth for KIβ¦ffefacf -
fix(fact-find): KI-015 β invite corrections in readback before recommendingβ
Real user testing surfaced: bot captured age=30 when user said 31. Readback only said "Want me to suggestβ¦" β no explicit invitation to correct anything. User didn't know they could say "actually I'm 31" to fix the captured value before recommendations flowed. Fix: extend the fact_find_complete readback message to explicitly invite corrections with concrete examples: "If anything's wrong, just tell me (e.g., 'actually I'm 31', or 'I want to cover my parents too')." The orchestrator's existing conversational profile-update extractor (in the free-form branch) already absorbs "actually I'm 31" as age=31 and re-upserts the Chroma profile chunk. The fix here is purely surfacing that capability to the user at the right moment in the flow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>82a40d3 -
fix(fact-find): KI-012/013/014 β flow corrections from user testingβ
KI-012 (P0) β Bot stuck in fact_find_complete readback loop After fact-find completed, the bot kept emitting the same readback summary instead of answering user's policy questions. Audit transcript showed P002 wasted 19 of 30 turns echoing the profile back. Fix: set session.free_form_session=True on completion + flush. KI-013 (P0) β Bot recommends senior-citizen policy to non-seniors Real user testing: vague opener β bot retrieved + pitched "Care Senior" (senior-only policy) without ANY fact-find. Intent classifier routed to recommendation, bypassing fact-find. Fix: orchestrator forces fact-find when profile is empty (no age, dependents, or income captured yet), regardless of intent. KI-014 (P1) β "family" auto-mapped to self+spouse+kids Real user testing: user said "family" β bot assumed self+spouse+kids. User actually meant parents + siblings (joint family). Fix: VAGUE_TERMS list in keyword normalizer returns None for unclear terms ("family", "everyone", "β¦f93292f -
fix(orchestrator): KI-012 critical β transition to free-form after fact-findβ
P002 transcript revealed: after fact-find completed at turn 11, the bot returned the SAME readback summary ("Got it β here's what I've understood: β¦") to all 19 subsequent free-form policy questions. User asked about claim settlement, room rent caps, comparisons β bot just echoed the profile readback every time. Root cause: on fact-find completion, the code only cleared `session.awaiting_question_id` but did NOT set `session.free_form_session = True`. Next turn classifier still routed through the fact-find branch, `next_question()` returned None, code hit the "complete" path again, emitted readback summary again. Loop. Fix is one line: set `session.free_form_session = True` + flush. Now subsequent turns skip the fact-find branch entirely and go through retrieval + brain as intended. Effect on the audit data: every persona's post-fact-find ~20 turns will now go through real RAG + brain instead of silently looping the readback. The 100-persona audit data will finally surface real poliβ¦75b229d -
fix(observability): KI-001..006 β log silent failures + fail-CLOSED judgeβ
KI-001 (P0) β Gate 4 LLM judge now fails CLOSED by default Previously when the judge LLM call raised (rate limit, parse, network), Gate 4 returned supported=True ("fail-open") β an unsupported claim that should have been blocked leaked through. In BFSI this is the wrong default. New behaviour: log the failure + return supported=False with reason "judge_unavailable_failclosed". Override with FAITHFULNESS_FAIL_CLOSED=0 in dev/smoke if you need the old behaviour. KI-002 (P1) β session_state._flush() now logs disk-write failures Was swallowing the exception silently β user's profile disappeared on Space restart with no signal. Now logs warning with session_id + error type so HF Space logs show flush failure rate. KI-003 (P1) β session_state._load_from_disk() logs schema-drift failures Was returning None silently when the on-disk JSON didn't match the current Profile dataclass. Now logs so we can detect when schema evolves in a way that breaks existing sessions. Kβ¦2412797 -
fix(fact-find): keyword fast-path + re-ask cap (KI-011 critical)β
CRITICAL bug discovered via the 100-persona audit on the first persona: under audit concurrency, NIM rate-limit causes the Llama-3.3-70B normalizer LLM call to fail. Normalizer returns None. Orchestrator KEEPS awaiting_question_id set. Bot re-asks the SAME question. User answers something β but it's an answer to the NEXT question we never moved on to. Normalizer fails again. Bot re-asks again. Infinite loop. Concretely on persona P002 (verbose style): turn 7 user said "so basically, bangalore, let me know what you think" β location normalizer LLM call hit NIM rate limit β returned None β reask_clarify. Then turns 8-20+ all received reask_clarify response to "Which city?" while the persona moved on with answers to dependents/income/etc. Bot stayed stuck asking about city forever. Fix layered in two places: [A] backend/fact_find_normalizer.py β KEYWORD FAST PATH New `_keyword_normalize()` function tries deterministic substring matches BEFORE the LLM. Hand-curated patterns coveβ¦171f2a4 -
feat(audit): 100-persona multi-scenario simulation frameworkβ
Three-stage audit harness for the non-speech parts of the bot: tools/audit/personas.py 100 personas (10 archetypes Γ 10 demographics). Cross-product engineered so each persona is a unique (archetype, demo, style) triple. tools/audit/flows.py 30-turn flow per persona: opening + 9 fact-find answers + 10 free-form policy Qs (anchored on persona concerns) + 5 edge cases (retries, view-shift, mid-profile-update, view-aware) + 5 adversarial (OOC, multi-policy, regulatory, closing-resistance, summary). tools/audit/run_audit.py Concurrent async runner with NIM rate-limit guard (1.8s/dispatch Γ 4 workers = 35 req/min, under NIM's 40/min cap). Resumable: completed persona transcripts land in β¦3dab53c -
fix(ux): cold-start retries + retry-intent handling + insurer-prefixed citationsβ
Three bugs visible in the 2026-05-14 mobile screenshot: Bug A β "Sorry β backend error: Load failed" HF Space cold-starts after ~15min idle take ~50s; Safari's fetch surfaces this as a generic TypeError. Fix: api.ts adds _fetchWithRetry with exponential backoff (1.5s, 3.5s, 7s). 502/503 and network errors retry up to 3x; AbortError (Live-mode barge-in) is NOT retried. onRetry callback surfaces "Connection slow β retryingβ¦" status. Final chat message on failure now suggests "say 'try again'" instead of "Load failed". Bug B β "Sarvah Param" rendered as unattributed citation ManipalCigna Sarvah-Param is a real policy; chip showed only policy_name. Fix: PolicyChipsFromCitations renders insurer_slug as kicker above the name. "MANIPALCIGNA / Sarvah Param" β clear provenance, mobile-friendly. Bug C β "Try again" got refused by Gate 1 "Try again" has no policy context so retrieval found nothing β Gate 1 refused. Fix: page.tsx tracks lastSubmittedTextRef and _isRetryIntβ¦f81328f -
chore: print absolute output path (PDF is outside the repo now)
6f3c920 -
chore: build_readme_pdf.py outputs to ~/Desktop, not the repoβ
The PDF is a sharable artifact (email / Slack / AirDrop), not a repo asset. Repo holds README.md (the source of truth, present on HF Space + GitHub); the PDF gets regenerated to the Desktop where it's easy to grab and share. Output path: ~/Desktop/Insurance-Sales-Bot-README.pdf Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>db1ecc9 -
docs: add tools/build_readme_pdf.py (PDF gitignored β HF rejects binaries)β
The HF Space pre-receive hook rejects binary files in the Space repo (use Xet/LFS or releases instead). Putting README.pdf in the gitignore keeps both remotes in sync at the same tree. To regenerate the PDF locally for sharing: uv pip install --python ~/.cache/uv-venvs/insurance-sales-bot/bin/python markdown-pdf python tools/build_readme_pdf.py # β README.pdf (~730 KB, ready to email / Slack) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>a2a4ece -
feat(voice): full-duplex Live conversation mode with VAD barge-in (D-025)β
User can now speak ANY time β including while the bot is mid-sentence β and the bot stops speaking immediately and listens. No button press. New file: frontend/src/lib/useLiveConversation.ts - Continuous getUserMedia stream (echo cancellation, noise suppression, auto gain control all enabled). - AudioContext + AnalyserNode RMS-based VAD on a requestAnimationFrame loop. Thresholds: 28/255 byte FFT magnitude floor, 5 frames (~80ms) of loudness to confirm speech, 40 frames (~640ms) of silence to end. - On speech-start: pause every <audio> element (kills bot TTS mid- sentence), abort the in-flight /api/chat fetch via AbortController, start a MediaRecorder. - On utterance-end: stop recorder, call onUtterance(blob, abort). - Caller-managed inflightAbortRef so the page can register fetches that VAD should cancel on barge-in. api.ts: postChat() and postTranscribe() now accept an optional AbortSignal so the live-mode handler can plumb the VAD abort signal endβ¦d31e132 -
fix(fact-find): LLM-normalize answers + reject non-answers + safe readbackβ
Three live-product bugs (D-021/22/23 follow-up): 1. dependents/income_band/primary_goal/location_tier/budget_band/ health_conditions had NO parsers in needs_finder.py β raw text was stored verbatim. Frontend's enum-button comparison never matched, so the Profile sidebar showed nothing selected even when chat had captured the answer. 2. STT-failure templates ("Sorry, I couldn't hear that clearly. Please try again.") were recorded as the user's answer to the in-flight question, then the bot silently moved on with garbage. 3. health_conditions stored as a string (not list) caused readback_summary to character-split via ", ".join(str) β output "conditions: d, i, f, f, e, r, e, n, c, e, , i, n, t, o, ..." Fix in three layers: [A] backend/fact_find_normalizer.py β new module. is_valid_answer(text) Rejects empty, < 2-char, or known failure-template strings. normalize_answer(question_id, raw_text) -> async Fast-path regex for age/parents_age/exiβ¦9a1b321 -
fix(stt): transcode browser webm/opus β wav before Sarvam (D-024)β
Root cause: Browser MediaRecorder emits audio/webm;codecs=opus by default. Sarvam STT only accepts WAV/MP3/FLAC/OGG/M4A. The /api/transcribe endpoint silently coerced webmβwav in the Content-Type but uploaded the raw webm bytes, so Sarvam returned HTTP 400 Bad Request: STT failed: HTTPStatusError: Client error '400 Bad Request' for url 'https://api.sarvam.ai/speech-to-text' Fix in three layers: 1) sarvam_stt.py β _transcode_to_wav() helper using pydub (ffmpeg-backed) converts any non-native container to 16 kHz mono WAV before upload. Also short-audio guard: <1 KB bytes return empty STTResult instead of 500ing on Sarvam's silence rejection. 2) main.py β extend the format whitelist to include webm/opus/mp4 so the real extension is passed through to the provider (provider then decides to transcode). 3) Dockerfile β add ffmpeg apt package (pydub's runtime dependency). requirements.txt β add pydub==0.25.1. This is the first of three live-product issues surfaced tβ¦a777198 -
fix(readme): trim short_description to <=60 chars (HF YAML constraint)
f2aff19 -
docs: reorganize into 8 buckets + 24 ADRs + master README (D-023)β
Replaces the legacy flat docs/ layout with a numbered bucket structure modeled on technical-repo conventions (e.g. Kubernetes docs/, IETF RFCs). Old monolithic decisions.md (32 KB) split into 24 individual ADRs using the Nygard template (Status / Context / Decision / Alternatives / Consequences / Revisit-at-scale). Structure: docs/00-overview/ β problem statement, roadmap docs/10-architecture/ β system, stack rationale, safety, scoring docs/20-data-pipeline/ β ingestion policy, information source map docs/30-engineering/ β needs-analysis flow, discovery script docs/40-evaluation/ β eval methodology docs/50-operations/ β (placeholder; runbooks land here) docs/60-decisions/ β 24 ADRs + index README + legacy archive docs/70-reference/ β (placeholder; glossary + indexes land here) All 14 existing docs moved via git mv (history preserved): 01-requirements.md β 00-overview/problem-statement.md 02-architecture.md β β¦dbacff2 -
feat: live time-since / time-until-next-probe counter in admin panelβ
The "Updated 13:11:51" label was a static wall-clock string set once at fetch time. Hard to tell at a glance how stale the snapshot is. Now the label updates every second and shows three things: Updated <wall-clock> Β· <Xm Ys ago> Β· next auto-probe in <Ym Ss> - "since" uses STATE.health.updated_at (the actual backend probe time via /api/admin/health), falling back to local fetch time if missing. - "next auto-probe in" = last-probe-time + 5min cadence (the value defined by PROBE_INTERVAL_MS, which mirrors backend/llm_health.py's background_probe_loop interval). - setInterval(renderUpdatedLabel, 1000) keeps both counters live. - Brace balance verified (281/281). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>dae8de8 -
feat: admin LLM control panel as in-app tab (D-022)β
Previously the LLM control surface lived at /admin/llm-control.html β a separate URL that had to be remembered + opened in a fresh tab. This surfaces it as a header tab matching the existing UI pattern, with the panel iframe-embedded inside the right-side aside drawer. - New showAdmin state + slate-gradient button ("Admin Β· Access panel") positioned next to the language toggle. - Toggling Admin closes any other panel (marketplace/premium/profile). - Toggling any other panel closes Admin (mutual exclusion via existing pattern). - iframe sandbox: allow-scripts + allow-same-origin + allow-forms so the control HTML can call /api/admin/* on the same origin. - Backend admin API stays IP-gated (ADMIN_IP_ALLOWLIST), so non-allowlisted visitors see the control HTML but its API calls return 404 β the panel silently shows "not authorized" state. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>57babb2 -
feat: conversational profile updates in free-form chat (D-021)β
After fact-find onboarding completes, users often share new profile facts in ordinary conversation β "I just turned 40", "we had a baby", "I was diagnosed with diabetes". Vanilla retrieval didn't know to update the session profile from these utterances. Implementation: - backend/profile_extractor.py β lightweight NIM extractor (Llama 3.3 70B) runs on each free-form user message. Returns validated dict of {field_name: new_value} for high-confidence updates only. Conservative validation: bad types / enums / bounds get dropped silently. - handle_turn() in orchestrator.py β after fact-find branch exits and free_form_session is set, extract β apply to session.profile β re-upsert the profile chunk in Chroma so THIS turn's retrieval reflects new state. - Health conditions are MERGED (additive, deduped) β existing conditions are preserved; only new ones get appended. - TurnResult.profile_updates / ChatResponse.profile_updates surface the field changes to the frontend so it can rβ¦769576f -
chore: drop legacy kb/policies/ MDs + gitignore backup folderβ
- Remove 31 kb/policies/*.md files superseded by the chroma-vector retrieval path. The bot's RAG reads from rag/vectors/ (built from rag/extracted/ JSONs at ingest time), not these markdown summaries. - Remove kb/premiums/INDEX.md β empty stub from the premiums-tabulation pipeline iteration; data lives in data/premiums/illustrative_premiums.json. - Gitignore rag/_hf_dataset_backup/ β the local mirror of the HF Dataset. Keeps the 493 MB backup out of the code repo (also mirrored to the companion repo rohitsar567/insurance-sales-bot-data via Git LFS). No runtime / behavior change. Cleanup only. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>06bab12 -
feat: view-aware copilot + persistent chat (D-020)β
Rohit Sar +1: Claude Opus 4.7 (1M context)Frontend was already wired to send view_context but backend silently dropped it (Pydantic ignores unknown keys). End-to-end plumbing now reaches the LLM: ChatRequest.view_context (backend/main.py) β handle_turn(view_context=...) (orchestrator.py) β build_messages(view_context=...) (persona.py) β system prompt injection ("USER IS CURRENTLY LOOKING AT: ...") Bot can now resolve "this policy", "these filters", "this insurer" against the active view (chat / marketplace / profile / premium / policy_detail) + active_policy_id + filters β without asking the user to re-state context. Also persists chat history + sessionId to localStorage so the conversation survives view changes, page reloads, and tab switches. Unit-tested all 4 layers: ChatRequest accepts the field, handle_turn signature includes view_context, build_messages backwards-compat when None, and system prompt contains the expected 'USER IS CURRENTLY LOOKING AT' block when set. Co-Authored-By: Claude Opusβ¦271442b -
hotfix: budget parser + defensive readback (TypeError str>int)
Verified signature257107f -
Deploy: Stack A (NIM brain + Maverick judge + Sarvam voice). D-019.
Verified signaturee53cea7 -
Deploy: Stack A (NIM brain + Maverick judge + Sarvam voice). D-019.
Verified signatured7ac696 -
Deploy: Stack A (NIM brain + Maverick judge + Sarvam voice). D-019.
Verified signaturecd72f85 -
Deploy: Stack A (NIM brain + Maverick judge + Sarvam voice). D-019.
Verified signature5de86d2 -
Deploy: Stack A (NIM brain + Maverick judge + Sarvam voice). D-019.
Verified signature629dfe2 -
Deploy: Stack A (NIM brain + Maverick judge + Sarvam voice). D-019.
Verified signature00a1aed -
Deploy: Stack A (NIM brain + Maverick judge + Sarvam voice). D-019.
Verified signature13779e8
-
Clean Space: delete 263 legacy files (4 retired providers + corpus/vectors/extracted moved to dataset). D-019 Stack A.
Verified signature35cff13 -
Stack A: NIM brain + Maverick judge + Sarvam voice/Indic (D-019). Data moved to insurance-bot-data dataset; Space is now code-only.
Verified signaturec32bddc -
Deploy v1 β single-Docker FastAPI + Next.js + RAG + voice + faithfulness
Verified signature881b2f5 -
Deploy v1 β single-Docker FastAPI + Next.js + RAG + voice + faithfulness
Verified signature54e6ba9 -
Deploy v1 β single-Docker FastAPI + Next.js + RAG + voice + faithfulness
Verified signature54ae55a -
Deploy v1 β single-Docker FastAPI + Next.js + RAG + voice + faithfulness
Verified signature64d5deb -
Deploy v1 β single-Docker FastAPI + Next.js + RAG + voice + faithfulness
Verified signature0c505c1 -
Deploy v1 β single-Docker FastAPI + Next.js + RAG + voice + faithfulness
Verified signature9559143 -
Deploy v1 β single-Docker FastAPI + Next.js + RAG + voice + faithfulness
Verified signature83532c8 -
Deploy v1 β single-Docker FastAPI + Next.js + RAG + voice + faithfulness
Verified signatured1c5011