Skip to main content
The heavyweight Vaquill widget. A Next.js 15 + React 19 chat surface with a persistent conversation sidebar, voice mode (TTS + STT), cross-tab sync via BroadcastChannel, gamification (XP and streaks), and multiple citation display modes. Use this when you want a Vaquill-style full experience embedded in your site rather than the minimal proxy widget. Source: github.com/Vaquill-AI/integrations/vaquill-widget-pro.
Need a leaner build? The Embedded Chat Widget ships with about 10 components, US-only focus, streaming SSE, and a single-file embed loader.

What you get

  • Persistent conversation sidebar with rename, delete, and search
  • Voice mode - microphone input with VAD plus TTS playback
  • Cross-tab sync via BroadcastChannel - threads stay consistent across browser tabs
  • Gamification - XP, streaks, and engagement progress
  • Citation display modes - cards, tabs, accordion, or pills
  • TTS provider matrix - OpenAI, ElevenLabs, Edge, Google, StreamElements
  • Multi-turn chatHistory preserved server-side in a process-local session map
  • Both embed modes - floating button and iframe
  • IndexedDB + localStorage fallback for client-side persistence

Status and caveats

The chat-completion plumbing in src/lib/ai/vaquill-client.ts talks to the Vaquill app’s chat backend for both streaming and non-streaming paths. A few legacy endpoints from the upstream RAG-widget fork are stubbed and degrade gracefully: per-message feedback persists only to the local session cache, citation-by-id lookup and file uploads throw a clear “not supported” error, and agent-settings return Vaquill-flavoured defaults.
The server-side session map lives in process memory. On Vercel cold starts or multi-instance deployments it resets. The React UI’s IndexedDB / localStorage is the durable copy, so users do not lose history, but server-side getConversationMessages returns empty for a cold instance until at least one turn is sent.
The AgentCapability enum (fastest-responses, optimal-choice, advanced-reasoning, complex-tasks) maps onto Vaquill’s mode: the first two go to standard, the latter two go to deep.

Prerequisites

  • Node.js 18+
  • A Vaquill API key (vq_key_...) from app.vaquill.ai/developer
  • Optional: an OpenAI API key if you want voice mode (TTS / STT)

Quickstart

1

Clone and install

2

Add your keys

Edit .env.local and fill in at minimum:
3

Run the dev server

Open http://localhost:3000.

Configuration

The full list lives in .env.example. The minimum set:

Key flags

TTS providers

Switch with TTS_PROVIDER=... in .env.local.

Architecture

Embedding

The widget ships a single-file loader you can drop into any site:
The repo’s examples/ folder has drop-in examples for WordPress, Shopify, React, and plain HTML.

Deployment

When deploying behind a single-instance hobby plan, the in-memory session map survives between requests. For Pro / Enterprise plans with multiple regions, expect the server-side history to be per-instance - the client storage is the source of truth.

Railway

Development commands

Troubleshooting

Voice mode not working
  • Production must be served over HTTPS (browser mic access requires it).
  • Grant the browser microphone permission for the site origin.
  • Verify OPENAI_API_KEY is set and TTS_PROVIDER is configured.
  • On Safari and iOS, WebM audio is unsupported - the widget falls back to MP4.
Chat returns nothing
  • Verify VAQUILL_API_KEY and USE_VAQUILL=true.
  • Open DevTools Network tab and look for the request to /api/inference or /api/inference-stream.
  • Test the key directly: curl -H "Authorization: Bearer vq_key_..." https://api.vaquill.ai/api/v1/health.
Build errors
History is empty after a redeploy This is the cold-start caveat. The client IndexedDB / localStorage retains threads, but the server session map starts empty. Send one new turn in a thread to repopulate it server-side.

Browser support

Embedded Chat Widget

Leaner Next.js variant pinned to the US.

Docker Widget

Self-host with Docker Compose and embed via script tag.

Statutes API

Search the US Code, CFR, and 50-state statutes.

GitHub

Source code and issue tracker.