Inspiration
What it is Polaria is AI sales infrastructure for small businesses in Latin America.
A business connects its WhatsApp, Instagram and Facebook accounts. A Polaria agent then runs the entire pre-sale conversation in Spanish — it answers questions, sends photos and prices, handles objections, qualifies the lead, and books the appointment straight into the business calendar. No human writes the first reply, the follow-up, or the confirmation.
Today it runs the front line for five businesses in Colombia: a motorcycle dealership group, two aesthetic clinics, an e-bike retailer and a spa.
Since May 19, 2026:
AI conversation turns 201,627 Unique end customers 47,721 Tool executions against live systems ~149,000 Appointments booked by the AI 12,721 Appointments rescheduled by the AI 1,590 Cost per AI turn ~$0.0017 Inspiration A motorcycle dealership in Bogotá was losing the customer who writes at 9pm on a Sunday.
Not losing them to a competitor with a better price — losing them to silence. By Monday morning the lead had gone cold, and nobody could tell you how many had been lost, because an unanswered WhatsApp message leaves no trace anywhere.
I had been patching this with N8N workflows, and I kept hitting the same wall: a workflow can send a message, but it cannot remember. The customer who wrote on Instagram last week and on WhatsApp today was two different strangers. And it could not be trusted with the one action that actually matters — writing to the calendar.
So the goal was never "build a chatbot". It was: make sure no conversation goes unanswered, and make the appointment safe enough to happen without a human watching.
How we built it One engine, every channel. A single runAIAgent call serves WhatsApp, Instagram DM, Facebook Messenger and inbound phone calls. Conversation history lives in one table, so a customer recognised on one channel is the same person on all of them. That unification is the product.
Direct to Meta, not through a reseller. Polaria is an approved Meta Tech Provider and talks to the WhatsApp Cloud API directly — including managing message templates. No BSP in the middle.
Gemini for the analysis layer. gemini-2.5-pro reads real conversation history with a strict responseSchema and returns structured findings: lost-lead reasons, recurring objections, requests the agent could not handle, and conversion blockers. It is the only thing in the system that looks at all conversations at once and tells the operator what is going wrong. Gemini also powers inbound image understanding and a conversational interface over that analysis.
Stack: Next.js on Vercel, Supabase/Postgres, Redis for burst buffering and durable queues, QStash, LiveKit + SIP for voice.
What the AI does, and what humans do The AI owns: every inbound message, qualification, objection handling, media selection, price quoting, appointment booking, rescheduling, cancellation, and the follow-up sequence when a lead goes quiet.
Humans own: the in-person sale. The advisor meets a customer who arrives with an appointment the agent booked. A specialist performs the clinical assessment. A takeover flag pauses the AI instantly for any conversation a human wants to handle.
I own the guardrails — and that is where most of the engineering went.
Challenges we ran into The agent that booked appointments that never existed. The model would write "perfect, you're confirmed for Monday at 10am" without ever calling the booking tool. The customer showed up to nothing. We built a detector that compares what the model said against what it actually did, and a day-anchored guard that injects fourteen resolved calendar days into every turn — because we measured the model inventing weekday/date pairs, and 89% of phantom bookings landing on the same hour: its own default.
A regex that could not close. The ghost-reschedule detector silently failed on Spanish accented vowels — in JavaScript, \b never closes after reagendé. Weeks of ghosts went uncaught because of one word boundary.
Two Postgres outages in a single day. 639 MB of duplicated model payloads had been accumulating in a log table. The database fell over twice, and inbound messages vanished with no trace — the webhook had already returned 200, so Meta never retried. The fix was a durable Redis queue written before the acknowledgement, plus retention policies. Customer messages now survive the database being down.
Conversations going unanswered, cause unknown. The root cause was transient OpenAI 5xx responses with no retry, plus a queue retry collecting an already-emptied buffer — the same bug, independently, in all three pipelines.
What we learned A fix applied to one path survives happily in the other two. Nearly every serious bug this quarter was the same mistake repeated across the WhatsApp, Instagram and CRM pipelines. Shared logic is not a refactor — it is a correctness requirement.
Build the instrument before the feature. Every number on this page comes from per-turn logging added early. When we finally measured cost per conversation turn, we found a single 18-minute window that had burned 42% of a day's model spend — invisible until it was instrumented. Cost per turn then fell by half.
Constraints beat capability. An agent that books a plausible appointment the customer never agreed to is worse than an agent that books nothing. The work that made this sellable was almost entirely about narrowing what the model is allowed to do.
Job creation Polaria does not replace sales staff — it changes what they spend the day on. Advisors used to answer the same twelve questions on WhatsApp all day and lose leads overnight. Now they meet people who already have an appointment.
At the dealership group this coincided with a restructure that added two new sales points rather than cutting headcount, because the constraint had been response capacity, not floor space.
The honest version: the jobs created so far are indirect and modest. The clearest one is my own.
What's next Inbound voice is provisioned on the same brain — a customer who wrote on WhatsApp last week and calls today reaches an agent that already knows them. Then outbound calling, and packaging the hardened vertical agents so the third aesthetic clinic launches in a day instead of a month.
What it does
How I built it
Challenges I ran into
Accomplishments that I'm proud of
What I learned
What's next for Polaria
Built With
- deepgram
- elevenlabs
- gemini-api
- gohighlevel
- google-gemini
- instagram-api
- livekit
- messenger-platform
- meta
- next.js
- node.js
- openai
- postgresql
- python
- qstash
- react
- redis
- sip
- supabase
- tailwindcss
- typescript
- upstash
- vercel
- webrtc
- whatsapp-cloud-api
Log in or sign up for Devpost to join the conversation.