How to Set Up AI Chat on Any Static Site
Add AI chat to any static site — HTML, Hugo, Eleventy, Jekyll — so it answers from your own content with citations. Here is the universal embed setup.
You can add AI chat to any static site — plain HTML, Hugo, Eleventy, Jekyll, or a hand-rolled build — by dropping one embed snippet into your template and indexing your content. Because the widget is a single async script tag, it works anywhere HTML does, with no framework required.
Why static sites are a perfect fit
Static sites are fast and content-rich — blogs, docs, marketing sites, handbooks — which is exactly what an AI agent answers well. The only "integration" a static site needs is a script tag, because there's no backend to wire. An agent reads your published pages and answers visitors directly, cited, turning a static archive into something interactive. See the documentation use case.
Step 1: Index your site
Create an account, get your publishable site key, and point the platform at your published static site to crawl your pages. The platform chunks and embeds that content so the agent answers from it accurately. Schedule a re-crawl so new pages are covered when you rebuild and deploy.
Step 2: Add the embed to your template
Add the AIML.chat embed init, with your publishable key, to the shared layout your generator uses — the base template or partial that wraps every page, just before the closing body tag. For Hugo that's your baseof template; for Eleventy or Jekyll, your base layout; for plain HTML, your shared footer include. Rebuild and deploy, and the widget appears site-wide.
Step 3: Configure the agent
Choose the agent type that fits your goal — support, sales, or a custom one — and give it a grounded prompt: answer only from your indexed content, cite the source, and capture a lead or escalate when it can't help. Grounding is what keeps answers specific to your site — see what is RAG.
Step 4: Structure for retrieval
Static sites often have clean, file-based content, which retrieves well. Keep pages focused, use clear headings, lead with the answer, and write descriptive titles. Split any page too long to chunk cleanly. Good structure improves the agent and helps human readers.
Step 5: Improve from the analytics
The analytics show what visitors ask and which questions the agent couldn't answer — a content backlog. Write those pages, rebuild, re-crawl, and the agent improves. Your static site keeps getting smarter without becoming dynamic.
What you get
Any static site, regardless of generator, now answers visitors instantly with cited responses, deflects repetitive questions, and captures leads — all from one embed in your template. No backend, no framework lock-in. See the add-widget skill for the universal install.
Why grounding beats a generic widget
Whatever platform you are on, the value is not the chat box — it is that the answers come from your own content. A generic chatbot bolted onto a static site will improvise from a general model and confidently get your details wrong, which erodes trust fast. A grounded agent answers only from what you indexed and cites the page, so every reply is traceable to something you actually published. That is the difference between a widget that frustrates visitors and one they come to rely on, and it is why indexing your real content is the step that matters most.
Getting started
Add AI chat to your static site on the AIML.chat free plan: index your content, drop the embed into your base template, and configure the agent. Compare tiers on the pricing page.
Does it work with Hugo, Eleventy, and Jekyll?+
Yes — add the embed to your generator's base layout or footer partial, and it appears on every page when you rebuild and deploy.
Do I need a backend?+
No — the agent and content live on AIML.chat; a static site only needs the one async embed snippet.
Will it stay current when I rebuild?+
Yes — schedule a re-crawl so new and changed pages are re-indexed after each deploy.
Related reading
Get the AIML.chat newsletter
Practical tips on AI docs assistants, RAG, and growing with content — a couple of emails a month. No spam, unsubscribe anytime.
Double opt-in — we'll email you to confirm.