Commit graph

6 commits

Author SHA1 Message Date
Vadym Samoilenko
93288aa981 Fix CRM enrichment: correct API filters, note linking, add tasks & transcripts
- Fix Twenty CRM filter syntax (dot notation for composite fields)
- Fix noteTargets/taskTargets to use targetPerson instead of personId
- Handle duplicate person creation gracefully (find existing on 400)
- Add task creation for new leads (follow-up TODO)
- Save conversation transcript to CRM on escalation and rate limit
- Strengthen system prompt to make Claude call update_lead proactively
- Tell Claude that form-submitted leads are already in CRM

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:42:56 +00:00
Vadym Samoilenko
99e6c37827 Add sales escalation to chatbot + CRM integration for all forms
- Bot now acts as sales consultant: identifies needs, proposes services, pushes for booking
- escalate_to_human tool: triggers on user request, bot stuck, or hot lead
- Escalation notifies RC with reason + conversation summary
- Contact form and quote form now create leads in Twenty CRM
- Fix RC webhook to use correct payload format (visitor.token as session_id)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:22:11 +00:00
Vadym Samoilenko
8e73d77abc Fix chatbot: lead persistence, CRM creation, RC delivery, mobile UI
- Store lead info in Redis session meta so bot remembers name across messages
- Create Twenty CRM lead immediately from form data (bypass tool-call flow)
- Store room→session reverse mapping in Redis for RC webhook delivery
- Update system prompt: don't re-ask for form-provided info
- Fix "Most Popular" badge clipped on mobile (overflow: visible)
- Fix contact form inputs overflowing on small screens (box-sizing)
- Reduce chat tooltip size on mobile to avoid overlapping content

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:18:29 +00:00
Vadym Samoilenko
e78d6dc1c6 Add Twenty CRM integration + lead enrichment + pulsating chat bubble
- New twenty_crm.py: full CRUD for people, companies, notes via Twenty REST API
- Lead capture now creates person + company in Twenty CRM automatically
- New update_lead tool: enriches CRM profile as conversation progresses
  (job title, phone, city, budget, requirements)
- Session meta stored in Redis to track Twenty person ID across messages
- Docker-compose updated with TWENTY_CRM env vars
- Chat bubble: pulsating ring animation with gradient background

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:13:26 +00:00
Vadym Samoilenko
2dc1414caa Fix chatbot: always return follow-up after lead capture + add Cal.com booking link
When Claude returns text + tool_use together, the bot was not sending the tool_result
back, so no follow-up message reached the user. Now always sends tool_result to get
a proper response. Also added Cal.com booking link to system prompt so bot offers
consultation scheduling after capturing lead data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:37:56 +00:00
Vadym Samoilenko
73b1a0feda Add AI chatbot: FastAPI backend + React chat widget
- Python FastAPI backend (chatbot-api/) with Claude Sonnet 4.6, prompt injection
  protection, rate limiting (30 msg/session), off-topic filtering, Redis session storage
- Rocket.Chat integration for live monitoring and human takeover
- Lead capture via n8n webhook
- React chat widget: floating bubble, auto-greeting after 30s, glassmorphism chat
  window, mobile responsive, lazy loaded, Mixpanel analytics
- Nginx proxy /api/chat → chatbot-api:8000
- Docker: chatbot-api + Redis services added to docker-compose

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 17:14:07 +00:00