Commit Graph

9 Commits

Author SHA1 Message Date
f231f6fd73 feat: supervisor AI — 4 tools + dedicated system prompt
- get_agent_performance: call counts, conversion, NPS, threshold breaches
- get_campaign_stats: lead counts, conversion per campaign
- get_call_summary: aggregate stats by period with disposition breakdown
- get_sla_breaches: missed calls past SLA threshold
- Supervisor system prompt: unbiased, data-grounded, threshold-based
- Context routing: supervisor/rules-engine/agent tool sets

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 13:05:32 +05:30
5e3ccbd040 feat: transcription fix + SLA write-back + real-time supervisor events
- Deepgram: multichannel=true + language=multi (captures both speakers, multilingual)
- LLM speaker identification (agent vs customer from conversational cues)
- Removed summarize=v2 (incompatible with multilingual)
- SLA computation on call creation (lead.createdAt → call.startedAt elapsed %)
- WebSocket: supervisor room + call:created broadcast for real-time updates
- Maint: clear-analysis-cache endpoint + scanKeys/deleteCache on SessionService
- AI chat: rules-engine context routing with dedicated system prompt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 16:59:23 +05:30
7b59543d36 feat: streaming AI chat endpoint with tool calling
- POST /api/ai/stream: streamText with tools, streams response via toTextStreamResponse
- Tools: lookup_patient, lookup_appointments, lookup_doctor (same as existing chat endpoint)
- Uses stopWhen(stepCountIs(5)) for multi-step tool execution
- Streams response body to Express response manually (NestJS + AI SDK v6 compatibility)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 10:27:24 +05:30
4b5edc4e55 fix: appointmentStatus→status, missed call visibility, webhook callbackstatus, KB logging
- Renamed appointmentStatus to status in search + call-assist queries
- Missed calls worklist: removed agentName filter (shared FIFO queue)
- Webhook sets callbackstatus: PENDING_CALLBACK on missed calls
- AI chat: added KB content logging for debugging

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 14:42:38 +05:30
9688d5144e feat: migrate AI to Vercel AI SDK, add OpenAI provider, fix worklist
- Replace raw @anthropic-ai/sdk with Vercel AI SDK (generateText, tool, generateObject)
- Add provider abstraction (ai-provider.ts) — swap OpenAI/Anthropic via env var
- AI chat controller: dynamic KB from platform (clinics, packages, insurance), zero hardcoding
- AI enrichment service: use generateObject with Zod schema instead of manual JSON parsing
- Worklist: resolve agent name from platform currentUser API instead of JWT decode
- Worklist: fix GraphQL field names to match platform remapping (source, status, direction, etc.)
- Config: add AI_PROVIDER, AI_MODEL, OPENAI_API_KEY env vars

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 16:45:05 +05:30
6f7d408724 feat: add worklist engine with prioritized missed calls, follow-ups, and leads 2026-03-18 11:26:04 +05:30
702afabfa7 feat: add AI enrichment service with Claude Haiku and rule-based fallback
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 09:04:45 +05:30
30df1d0158 feat: add Exotel webhook controller and service for call event parsing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 09:04:15 +05:30
a3172140b0 chore: scaffold NestJS sidecar with config, CORS, and dependency setup 2026-03-17 09:02:15 +05:30