Conversational AI / SaaS / Case study

SupBetter

A multi-tenant conversational platform: a company's knowledge becomes an agent that understands the intent before asking who you are.

Focus
Team project · Go migration, AI service & platform security
Status
Hackathon / Live
Year
2026
SupBetter's public landing page: “Um bom atendimento começa com um bom encontro” beside an illustrative chat with the agent.
The public landing page at supbetter.pages.dev, captured in September 2026.

01 / Idea

Understand the intent before asking for identity.

SupBetter started as a team project for the AI Tinkerers global hackathon: a conversational platform where a company connects its own knowledge to an agent that serves its customers.

The company picks from five capabilities — questions, qualification, catalog, scheduling and problem resolution — and that choice defines the plan and the context it has to provide. Questions and the catalog work anonymously; scheduling and resolution go through identification.

02 / Stack

Three services, one database.

The hackathon build was a single FastAPI application. It was then migrated to three independent services: a Go backend (chi, pgx, golang-migrate, Redis, OpenTelemetry), an isolated Python AI service built on LangGraph, and a React + Vite frontend.

PostgreSQL 17 with pgvector holds both the domain and the knowledge embeddings, and three least-privilege database roles separate the API, the worker and the AI service. The model is configurable: gpt-4.1-mini through the Responses API with strict JSON Schema by default, and gpt-4o-mini-transcribe for voice messages.

Backend

Go · chi · pgx · PostgreSQL 17 · Redis

The single owner of business rules: IAM, CRM, conversations and handoff, knowledge ingestion, email outbox and reports.

AI service

Python · FastAPI · LangGraph · OpenAI

Intent classification, grounded answers, document chunking and embeddings, and audio transcription — with no access to business tables.

Frontend

React · Vite · TypeScript

The public chat channel, the operator inbox and the management back office, built as static assets.

03 / Architecture

Go owns the rules. The agent only asks.

The Go backend is the only owner of business rules and of the database. The AI service classifies intent and drafts answers, but every booking, ticket and order is executed by deterministic Go endpoints with state validation.

Tenant isolation is enforced by row-level security, not only by query filters. Features that depend on an external provider — email, S3 storage, the model, WhatsApp — fail explicitly when no credential is configured: the product never simulates a delivery or a verification.

01 / Responsibility

Company workspace

Five selectable capabilities define the plan. A channel cannot be published while a selected capability lacks real context.

02 / Responsibility

Go API

Opaque revocable sessions, Argon2id, mandatory TOTP for managers and leaders, PBAC and row-level security per tenant.

03 / Responsibility

AI service

Reaches the domain only through Go's authenticated internal API; its database role sees nothing but its own checkpoint schema.

04 / Responsibility

Human operators

A real-time inbox over SSE and Redis pub/sub, handover briefings, SLA badges, dispositions and CSAT/NPS reports.

04 / Flow

From a message to a decision.

Each message passes the anonymous-session and rate-limit guards, then a check for human control. If an operator owns the conversation, the message is saved and the agent stays silent.

Otherwise the current intent is classified. A disabled capability or missing context falls back without registration; scheduling and resolution ask for identification, with an explicit purpose, before any action runs.

  1. 01

    Classify

    Every message is classified. Questions, qualification and the catalog need no sign-up.

  2. 02

    Identify

    Scheduling and problem resolution require identification, enforced by the Go backend rather than by the model's obedience.

  3. 03

    Act

    Bookings, tickets and orders run through deterministic endpoints with state validation and transactional conflict locks.

  4. 04

    Hand over

    A human takeover wins over a pending model reply: conversation state is re-read before any automatic answer is saved.

05 / Challenges

When a strict schema fails silently.

After the migration, the agent could clarify, hand off or refuse, but never actually answer. One optional field with a default value had been left out of the JSON Schema's required list, and OpenAI's strict structured-output mode rejected every real answer with HTTP 400 — while classification kept working.

The failing job retried silently for minutes and died without a visible error, so the bug was reproduced end to end against the real worker and a live key. The fix made the field required and logged the provider's actual error body before mapping it to a generic 5xx.

06 / Status

From hackathon build to SaaS foundation.

SupBetter is live at supbetter.pages.dev, with the Go API, the worker and the AI service deployed separately. The Go migration is complete: the Python application backend was removed after route-by-route parity was verified.

It is built by a team of three. The AI Tinkerers result is still pending, so no award is claimed, and a dedicated public documentation repository is planned.