Pitchbar — Self-hosted SaaS Sales AI Widget for Any Website
Pitchbar Overview & Multi-Tenant SaaS Engine
Pitchbar is a self-hosted Laravel SaaS application, engineered for developers and agencies to operate an AI sales chat widget business on their own infrastructure. The codebase removes the bottleneck of assembling conversational AI, retrieval pipelines, lead capture, recurring billing, and operator tooling from separate vendors, because every layer ships inside one Laravel + React application. In production it functions as a turnkey platform that a single operator can install, brand, and hand to end customers through self-serve sign-up and plan selection.
Technical Specifications & Deployment Matrix
| Engineering Metric | Deployment Specification |
|---|---|
| Base Framework | Laravel application with a React (Inertia) front end; JavaScript, JSON, HTML, XML, CSS and PHP source files included |
| Runtime Requirements | PHP 8.x with MySQL 8.x; runs identically under Nginx + PHP-FPM or FrankenPHP/Octane workers |
| Widget Integration | Single script-tag embed on WordPress, Shopify, Next.js, React, Vue or plain HTML pages |
| Communication Protocols | Stripe API for billing and hosted customer portal; OAuth for Google Docs and Sheets sources; JSON-RPC handshake for MCP tool servers |
| Browser Compatibility | IE11, Chrome, Edge, Firefox, Safari and Opera, with layout and input mirroring for right-to-left locales such as Arabic, Hebrew, Persian and Urdu |
| Localization | 133 shipped locales with admin-side string overrides layered over translation files at runtime |
RAG Retrieval, Agent Tooling & Execution Pipeline
Every visitor turn traverses a staged pipeline: embed, vector search, rerank, tool loop, first token, and total duration. Questions answerable purely from the indexed knowledge base skip the tool-check round-trip, and the reranker is skipped adaptively when the vector search already returned a confident ordering. Follow-up messages that drop their subject retain the prior subject for search, while an optional LLM rewriting step condenses conversational input into a standalone query, guarded so a rewrite can never come out worse than the deterministic version it replaces.
Architectural & Functional Highlights
- Multi-tenant isolation from the database up: every workspace is fenced by a global query scope and regression-tested, so one tenant’s agents, conversations, leads and analytics can never leak into another.
- MCP tool servers: agents call external tools over the Model Context Protocol; credentials are encrypted at rest and never rendered back into the UI, arguments are sanitised before dispatch, output is truncated before reaching the prompt, and each server sits behind a circuit breaker with a per-call activity log recording arguments, result size, duration and outcome.
- Model routing with latency probing: roughly 95 models across Cloudflare Workers AI, OpenAI and OpenRouter, with the Cloudflare catalogue fetched live so it never goes stale; operators measure a model’s real round-trip latency from their own server, receive embedding-dimension warnings before a switch invalidates the vector index, and get automatic failover to the next provider when the primary errors or times out.
- Operator observability: Widget Monitor records widget-side failures such as streams that close without completing; hot-path latency breaks each turn into its stages with prompt size per turn, replicable from the CLI; a per-turn debugger traces which retrieval path answered, what was retrieved with what scores, and where time went.
- Metered billing on the hot path: each plan carries a monthly conversation quota enforced at widget initialization, so chats already in progress and human takeovers are never interrupted when a limit is reached.
For teams weighing alternative turnkey multi-tenant products on the same framework, FashionHub SaaS exists as an independent Laravel-based builder aimed at storefront deployment rather than conversational AI delivery.
Production Deployment & Implementation Considerations
Deployment requires a PHP 8.x host with MySQL 8.x and a cron-driven queue worker. A plain Nginx + PHP-FPM server behaves identically to an Octane deployment: the cron queue tick resolves the PHP binary rather than assuming the serving one, and streaming responses lift the execution-time limit PHP-FPM would otherwise apply mid-stream. An in-app Stripe health panel verifies webhook and tax configuration and can repair both, while automated site-health checks and retryable job queues cover routine failure modes. Indexing jobs retry on transient failure and a scheduled sweep re-runs sources that failed anyway, so a provider outage no longer leaves a source permanently unindexed. Customization happens without code edits in three places: the marketing site switches between the shipped Aurora and Prism themes from the admin, the Translation Manager overrides any user-facing string across all 133 locales including SEO metadata, and per-agent tool grants scope MCP access inside each workspace. The reranker’s fail-fast timeout and circuit-breaker behavior are additionally tunable through environment variables. Operators who also manage client records, tasks and invoicing in a dedicated Laravel stack can deploy Powerful Laravel CRM as a standalone sales management system, separate from the widget platform itself.
Frequently Asked Questions
Can widget and marketing-site text be reworded per language without editing source files?
Yes. The Translation Manager lets an operator override any user-facing string across all 133 shipped locales from the admin, layered over the shipped translation files at runtime, including marketing copy and SEO metadata on the public site.
Is human takeover of a live visitor conversation supported?
Yes. The assistant hands off to a human in real time, and because quota enforcement gates only at widget initialization, an in-progress chat or an active takeover session is never interrupted when a workspace reaches its plan limit.
Does a chat session survive after the widget session token expires?
Yes. The session token expires after 60 minutes, but the widget now re-authenticates silently and replays the pending message, so a tab left open past expiry resumes the conversation without losing anything the visitor typed.
Can page content locked inside images still be indexed for retrieval?
Yes. The crawler ships multiple extraction tiers, including Cloudflare’s page-to-markdown renderer and a vision OCR fallback, so pages whose text lives inside images still feed the knowledge base the assistant answers from.
-
v2.1.0 Latest