Claude Templates / A-tier · High leverage

Growth & SEO

The Pre-Sale Chatbot Playbook

A grounded pre-sale assistant that builds its own knowledge base on install.

PRE-SALE-CHATBOT-PLAYBOOK.md · 13 sections · 2,787 words · 20 KB · markdown

By Moe Ameen, founder of BILT · Published · Updated

The Pre-Sale Chatbot Playbook builds a floating chat widget that answers pricing and feature questions only from a corpus built from your own site and code. Claude Code crawls the marketing site, reads the codebase, flags any place where copy and code disagree, streams answers through admin-held API keys and adds a global rate limit so bots can't drain your quota. It has no lead capture.

Key takeaways

  • Answers come only from a corpus built from your site and code.
  • Where site copy and code disagree, the bot flags it rather than averaging.
  • Provider keys belong to the admin, never the visitor.
  • The corpus does not update itself; re-sync when the product changes.

A floating chat widget that answers pre-sale questions from your actual site and codebase, not hallucinated feature claims. The install step crawls your marketing site and reads your code to build the corpus, so it ships ready to answer. No lead capture, no gate.

What does the Pre-Sale Chatbot Playbook build?

It builds a widget, a streaming chat endpoint and a knowledge-base autobuild that runs as one install step.

The file includes a system prompt contract, a smoke test and a section on keeping the corpus fresh.

When is a pre-sale chatbot worth adding?

Add it when the app has a public marketing site and self-serve signup, and visitors ask questions the site already answers somewhere.

The file says to skip it for internal tools or invite-only, sales-led products with no signup to route to.

What do you need first?

You need a marketing site, ideally built with Topical Authority, and an LLM provider key held in the admin console.

Plan to rerun the corpus build after any pricing or feature change.

What's inside

What does the playbook give you?

When to use it

Once a marketing site exists and signup is self-serve.

Build these first

Topical Authority

Straight from the file

What does the writing look like?

Owned (copied + adapted per app): 1. src/lib/help/public-corpus.ts — the knowledge base (auto-generated, §3). This is the part that "understands the app." 2. src/app/api/public-chat/route.ts — streaming, corpus-grounded, provider-fallback endpoint. 3. src/components/landing/LandingChat.tsx — the floating widget (thread persistence, SSE render, link-rewriting). 4. src/components/landing/LandingChatLazy.tsx + LandingChatGate — dynamic-import wrapper + route gate that self-hides the widget on app routes.

Table of contents

Which sections does the file cover?

  1. 0. When to use this — and the tier rationale
  2. 1. What you get (the install surface)
  3. 2. Architecture
  4. 3. The knowledge-base autobuild ← the heart of "one action"
  5. 4. Provider + key config (OpenAI-primary, admin-console keys)
  6. 5. System prompt contract
  7. 6. The widget
  8. 7. Anonymous rate limiting (required)
  9. 8. The one-action install sequence
  10. 9. Verification / smoke test
  11. 10. Keeping the corpus fresh (it does NOT self-update)
  12. 11. Common pitfalls
  13. 12. Kickoff prompt

How do you run it?

Drop PRE-SALE-CHATBOT-PLAYBOOK.md into your repo, then tell Claude Code: “Read PRE-SALE-CHATBOT-PLAYBOOK.md and implement it in this codebase.” It's written for an agent to execute end to end. Search the file for angle-bracket placeholders and swap in your own project names, domains, and keys before the first run.

↓ Download the playbook

Who is this for, and who should skip it?

Best for

  • Self-serve SaaS with a public pricing page
  • Founders fielding the same pre-sale questions by email
  • Apps that already have accurate site copy

Not ideal for

  • Sales-led products with no self-serve signup
  • Teams that need lead capture in the chat
  • Sites whose copy is out of date with the product
  • Builders who won't adapt paths: the file points to a reference app you won't have

What else do people ask?

Which LLM providers does the Pre-Sale Chatbot Playbook use?

The Pre-Sale Chatbot Playbook uses OpenAI first and Anthropic as the fallback, defaulting to gpt-4o-mini or Haiku with max_tokens at 384. Keys come from the admin console's text slots, and apps without one fall back to OPENAI_API_KEY and ANTHROPIC_API_KEY in the same order.

Which files does it add or change?

The Pre-Sale Chatbot Playbook adds four files: public-corpus.ts (the knowledge base), the public-chat streaming route, the LandingChat widget and a lazy wrapper with a route gate. It edits four existing places: proxy.ts, the root layout.tsx, rate-limit.ts and the provider key setup.

Can the chatbot collect emails or leads?

No. The Pre-Sale Chatbot Playbook's system prompt forbids asking for an email, name or phone number, because signup is the conversion event. The bot sends ready visitors to /signup and pricing questions to /pricing.

What is in the Pre-Sale Chatbot Playbook download?

The Pre-Sale Chatbot Playbook is a markdown file of about 2,800 words. It has TypeScript for the PublicArticle corpus type, the provider fallback and the layout mount, a list of about 14 suggested corpus articles, a seven-step install sequence, a smoke test and a kickoff prompt, with no SQL.

How does it stop bots from draining the API keys?

The Pre-Sale Chatbot Playbook uses two rate-limit buckets: about 30 chat requests an hour per IP, and a global circuit breaker across all anonymous traffic. The file calls the global bucket non-negotiable, since a botnet rotating IPs gets past per-IP limits.

How do we know this?

This page is based on the playbook file itself, PRE-SALE-CHATBOT-PLAYBOOK.md, which Moe Ameen wrote from the Kompozy codebase (called BKE in the file). We read the file on November 4, 2026; the facts here come from it, not from independent testing in other codebases.

More growth & seo playbooks

← All 28 Claude templates