Smalltalk lets businesses spin up AI-powered chat spaces that visitors access by scanning a QR code — no app download, no login required.
Problem
Businesses want to offer contextual AI chat (think restaurant menus, museum guides, venue info) but building a custom solution means dealing with auth flows, AI infrastructure, knowledge management, and billing. Most end up not doing it at all.
Solution
A SaaS platform where owners create "spaces" with a custom knowledge base, then share them via QR code or link. Visitors land in an anonymous chat session grounded in that space's content — powered by RAG so the AI stays on-topic and accurate.
Key Features
- QR-accessible anonymous chat — Visitors scan and start chatting instantly, no sign-up friction. Sessions are cookie-scoped per space with RLS-enforced message isolation.
- RAG-powered responses — Knowledge entries and real-time updates are embedded with Gemini text-embedding-004 (768-dim) and searched via pgvector cosine similarity. Top 5 results above a 0.7 threshold are injected into the system prompt.
- Optional geofencing — Spaces can require physical presence. Client-side Haversine check + server-side re-validation with a 5-minute TTL prevents GPS spoofing.
- Real-time presence — Supabase Realtime tracks concurrent viewers per space.
- Subscription billing — Stripe-powered Free/Pro tiers with usage limits on spaces, knowledge entries, and monthly messages.
Technical Highlights
The app runs on Next.js 16 (App Router, React 19) with Supabase handling auth, database, and realtime. The AI layer uses the Vercel AI SDK with Gemini Flash as the default model and Gemini 2.5 Pro for complex queries — a dual-model approach that cuts AI costs by roughly 90% on standard conversations.
The RAG pipeline is intentionally manual rather than framework-driven: embed the query → parallel vector search across knowledge and updates tables → build a grounded system prompt → stream the response. Each space's AI usage is tracked for cost attribution.
On the infrastructure side: 16 RLS policies across 8 tables, 15 PostgreSQL SECURITY DEFINER functions, Inngest for async jobs like PDF processing, and observability via Sentry + Langfuse + PostHog. The frontend is PWA-ready and built as a Turborepo monorepo with 210+ tests (Bun Test + Playwright).
You can try Smalltalk at smalltalk.yihan.app.