Made by Arno

June 15, 2026

1 views

Building a chatbot for iFolio with Claude

Summary:

I built my own AI chatbot for ifolio.nl — a small WordPress plugin that answers visitor questions through the Claude API. It automatically indexes every post, page and project on the site, so it can answer broad, thematic questions (“what do you have on interactivity?”) and point people straight to the right page. No third-party chat service, my API key stays on my own server, and a busy month costs a couple of euros.

The ask

A friendly assistant living in the bottom corner of the site that actually knows iFolio — not a generic bot. It had to know my real work (design, music, the studio), answer associatively rather than only on exact keywords, always link to the real pages, reply in the visitor’s language, and stay cheap. And I wanted to control its tone and what it’s allowed to see without touching code every time.

How it was built

I described what I wanted in a Cowork session and Claude built it as a single self-contained WordPress plugin — one PHP file you upload and activate. Here is every step that went into it, in the order it matters if you want to rebuild it:

  • The content index instead of a vector database. The hard part of any site bot is getting it to know the site. Rather than a heavy search/embeddings setup, the plugin builds a lightweight text index of every published post, page and project: one line each with type | title | url | tags | short summary. It refreshes once a day and rebuilds automatically whenever I publish or edit something, so it’s never stale.
  • Feed the whole index to Claude, cached. That full index is sent along as part of the system prompt on every chat. Because it’s the same block every time, I use Anthropic’s prompt caching on it — so I don’t pay full price to resend it each message. This is what lets the bot answer wide questions: ask about “light” and it also surfaces projections, LED installations and kinetic sculptures, grouped into my own work vs. inspiration posts, each as a real link.
  • A server-side endpoint, so the key stays secret. The browser never talks to Anthropic directly. The widget posts messages to a WordPress REST endpoint (/wp-json/ifolio/v1/chat), and the PHP makes the API call with the key. The key lives on the server and is never visible to visitors.
  • Safety rails on that endpoint. Max 30 messages per hour per visitor (by IP), a same-origin check so other sites can’t use my endpoint, and only the last few messages of a conversation are sent — enough for context, not endless cost.
  • The chat widget. A round button bottom-right that opens a dark chat panel: avatar, a welcome message, a few example question “chips” to get people started, and markdown links rendered as real clickable links. It matches the site accent colour and works on mobile.
  • An admin control panel. Under Settings → iFolio Chatbot I can paste the API key, pick the model, set the accent colour, edit the welcome message and example questions, and — most useful — add free-text house rules that override the defaults (tone, topics to avoid, preferred answers). There are also filters to hide whole content types, certain categories/tags, or specific posts from the bot, plus a “Hide from chatbot” checkbox on every post. And a button to rebuild the index by hand.
  • Model and cost. It runs on Claude Haiku 4.5 by default — fast and cheap, roughly €0.005–0.01 per message thanks to the cached index. Sonnet 4.6 is selectable when I want it sharper. A €5 credit lasts a very long time.
  • Packaging and install. Claude bundled it as a .zip. Installing is the standard WordPress flow: create an API key at console.anthropic.com, upload the zip under Plugins → Add New → Upload, activate, paste the key in settings. The chat bubble appears, and the index builds itself on the first conversation.

The result

A chat bubble in the corner of ifolio.nl that anyone can ask about my design work, music or the studio — and it answers with direct links to the right pages, in their own language. Quietly, it’s also become a search tool over my own content: I open it and ask “what have I made about interactivity?” or “which sites did I build with a webshop?” and get a tidy, linked list back. One small plugin, full control, my key, and it keeps itself up to date.

You May Also Like...

Get inspired once a month

Subscribe to the latest innovations

0 Comments