A chatbot that answers from your own pages is a small retrieval pipeline: crawl, chunk, embed, fetch the closest passages and let a model answer from them, plus a widget on the page. An agent builds that in one sitting on SQLite and any OpenAI-compatible endpoint. What you give up is the hosted upkeep: scheduled re-crawls, abuse limits on a public endpoint and the ready-made embeds for Shopify or WordPress.
Before you buildMagicChat Free covers one bot with 50 pages and 100 messages a month. For a small site with little traffic that may be enough.
Build me a website chatbot to replace MagicChat. Requirements: - Node.js 22 + TypeScript: a Fastify server. `npm start` serves http://localhost:4870: admin at /admin, the chat API at POST /api/ask and the widget script at /widget.js. - Sources: a sitemap URL or a list of URLs (fetched with `undici`, text pulled out with `@mozilla/readability` and `jsdom`), PDFs (`pdf-parse`) and pasted text. Respect robots.txt and skip pages whose content hash has not changed on a re-crawl. - Storage: better-sqlite3 with the `sqlite-vec` extension in ./data/bot.db: sources, chunks (about 500 tokens with 50 overlap), embeddings, and every question and answer with its sources. - Answering: embed the question, take the 6 closest chunks and call an OpenAI-compatible endpoint (BASE_URL, API_KEY, CHAT_MODEL, EMBED_MODEL in .env). The system prompt allows answers only from the chunks, cites source URLs, and says "I don't know, email <SUPPORT_EMAIL>" when nothing relevant comes back. - Widget: a vanilla JS chat bubble (<script src=".../widget.js" data-bot="...">) with streamed answers (server-sent events) and source links under each answer. - Abuse limits, all in .env: per-IP rate limit, a daily message cap, a maximum question length, and CORS restricted to ALLOWED_ORIGINS. - Admin: one password in .env. Add sources, re-crawl now or every N days (`node-cron`), browse conversations, export them as CSV and list the questions that got "I don't know". - Single owner. No accounts, no telemetry. Outbound calls: your own sites and your LLM endpoint only. - Out of scope: YouTube transcripts, several bots, Slack or WhatsApp channels, human handoff. - README: serving it behind HTTPS, exactly what text is sent to the LLM, and a warning that anything you index can be pulled out through the public endpoint.
Opens your agent with the prompt filled in, you press enter. Or copy it and paste it into an empty folder.
The first prompt builds the core. Run these one at a time in the same folder to grow it into your own MagicChat.
Extend the website chatbot in this folder. Requirements: - After an "I don't know" answer, the widget offers a short form (name, email, message) that stores the lead in SQLite and emails it to SUPPORT_EMAIL through nodemailer. - Add a /admin list of leads with the conversation attached, a status (new, answered) and CSV export. - Validate the email, add a honeypot field and a per-IP limit of 5 submissions an hour. - Never send the lead's data to the LLM endpoint. - Update the README with the SMTP settings.
Add YouTube sources to the website chatbot in this folder. Requirements: - Accept a video, playlist or channel URL in /admin; list videos with `yt-dlp` (JSON output) and fetch captions only, never the video files. - Chunk each transcript by timestamp, store the video URL with a ?t= offset and show it as the source link. - Skip videos without captions and list them in the admin page. - Re-check each channel weekly for new videos. - Update the README with installing yt-dlp.
Add a weekly quality report to the website chatbot in this folder. Requirements: - A `node-cron` job (Mondays 08:00) groups last week's questions by embedding similarity and counts how many got "I don't know" or a thumbs-down from the widget. - Add thumbs up and down buttons to the widget and store the votes. - Email the owner the top 10 unanswered topics with example questions and the closest existing page. - Keep the report as Markdown in ./reports/YYYY-MM-DD.md. - Update the README.
Running a public endpoint that spends model tokens on strangers' questions, and keeping its answers current as the site changes, is a chore most site owners do not want. MagicChat turns it into a copy-and-paste embed for a few dozen dollars a month, which is also why non-developers pick it.
Estimate · A $5 VPS or a free tunnel, plus model tokens: a few cents per hundred answers on a small model. Indexing a small site costs well under a dollar once. The build is token usage on your agent plan.
| Plan | Monthly | Annual, per month | What you get |
|---|---|---|---|
| Free | $0 | $0 | 1 chatbot, 100 messages a month, up to 50 pages, embed on your site, API access, community support. |
| Lite | $29 | — | 1 chatbot, up to 1,500 messages a month, up to 500 pages, 1 seat, manual refresh of sources. |
| Starter | $59 | — | 1 chatbot, up to 4,000 messages a month, up to 1,000 pages, 1 seat, manual refresh. |
| Growth | $129 | — | Up to 2 chatbots, 12,000 messages, 10,000 pages, 4 seats, platform integrations, rate limiting, automatic monthly refresh. |
| Scale | $429 | — | Up to 10 chatbots, 50,000 messages, 50,000 pages, 10 seats, webhooks, weekly refresh and a daily scan. |
| Enterprise | custom | — | Custom volume and limits, priority support, signed DPA or BAA, HIPAA eligible. |
Free covers one chatbot, 100 messages a month and up to 50 pages, with embed and API access.
Yes. An AI coding agent such as Claude Code, Codex or Cursor can build a usable personal version in one session with the prompt on this page, running on your own machine.
About $29 a month on the Lite plan, $348 a year (checked 2026-10-19).
Scheduled re-indexing, so the bot follows your docs without you touching it; Training on YouTube videos and many file types out of the box; Ready-made install guides and integrations for Shopify, WordPress and WooCommerce; A live dashboard of activity and question counts, and webhooks; Someone else carrying uptime and abuse protection for a public endpoint. If any of those matter to you, keep paying.
Yes: AnythingLLM (open source), Onyx (open source), RAGFlow (open source).