Getting started
By the end of this guide you have a Starlight docs site with Browse / Chat, deployed on your Cloudflare account, with answers grounded in your Markdown.
Prerequisites
Section titled “Prerequisites”- Node.js 22+
- A Cloudflare account
- Wrangler available via
npx wrangler
1. Scaffold
Section titled “1. Scaffold”npm create prompton@latest my-docscd my-docsnpm install2. Create Cloudflare resources
Section titled “2. Create Cloudflare resources”npx wrangler vectorize create prompton-docs --dimensions=1024 --metric=cosinenpx wrangler kv namespace create PROMPTON_DOCSnpx wrangler kv namespace create PROMPTON_SESSIONPaste the two KV id values into wrangler.jsonc (DOCS and SESSION). Keep the Vectorize index_name as prompton-docs (or rename the binding and the create command together).
For local semantic search, keep "remote": true on the Vectorize binding (Vectorize has no local emulator). Without it, chat still works via lexical search over KV after reindex.
3. Run locally
Section titled “3. Run locally”# optional: put PROMPTON_REINDEX_SECRET=dev-secret in .dev.varsnpm run devOpen the site → Chat in the header (or ?mode=chat). Ask a question after seeding:
curl -X POST -H "x-prompton-reindex-secret: dev-secret" \ http://127.0.0.1:4321/api/prompton/reindexAuto-seed also runs on first agent traffic when /.prompton/index/* is present from a prior npm run build.
4. Deploy
Section titled “4. Deploy”npx wrangler secret put PROMPTON_REINDEX_SECRETnpm run buildnpm run deploySeed production:
curl -X POST -H "x-prompton-reindex-secret: $PROMPTON_REINDEX_SECRET" \ https://<your-worker>.workers.dev/api/prompton/reindexAttach a custom domain in the Cloudflare dashboard (Workers → your worker → Domains & Routes) when you are ready.
Checklist
Section titled “Checklist”| Step | Done when |
|---|---|
| Scaffold | npm run dev serves Starlight |
| Bindings | KV IDs + Vectorize name in wrangler.jsonc |
| Chat | Browse/Chat toggle works; agent connects |
| Index | Reindex returns { ok: true, ... } |
| Deploy | Worker URL loads and Chat answers with Sources |
Next steps
Section titled “Next steps”- Browse and Chat — mode toggle, sessions, citations
- Cloudflare stack — bindings and Agents SDK
- Indexing docs — build-time chunks → Vectorize
Chat with the docs
Loading chat…