Model card: the portfolio chatbot
A small retrieval-grounded assistant that answers questions about Dwi's work from this site's own content. This page documents what it does, what it is built from, how it is evaluated and monitored, and what it stores.
Intended use
Answer visitors' questions about Dwi's projects, methods and stack in English or Indonesian, briefly, with the sources each answer came from.
Out of scope, by design
- Education history and personal life. Neither is in the knowledge base. Questions about them get a friendly scripted reply, and the language model is not called.
- Anything that is not on this site. The bot says it does not have the detail and points to email.
- Judgements about other people or organisations.
How it works
- Privacy guard. A rule-based classifier reads the question first. Education and personal questions get a scripted reply in the visitor's language.
- Retrieval. The question is embedded with Qwen3-Embedding-0.6B and compared by cosine similarity with every content chunk. The four best go into the prompt. If the embedding index is missing or older than the content, a BM25 keyword search takes over, so the bot never goes dark.
- Generation. Qwen3-8B with thinking mode off, temperature 0.3 and at most 420 new tokens, streamed to the browser as server-sent events. The prompt allows only the retrieved context.
- Output checks. While the reply streams, the last 40 characters are held back so an output filter can stop out-of-scope terms before they reach the screen, and a loop detector cuts repeated-token loops.
- Sources and grounding. The model lists the chunk ids it used. A lexical grounding score counts how many named terms and numbers in the reply also appear in those chunks.
- Logging. One anonymous event per turn feeds the Lab panel and the evaluation.
In Data scientist mode every answer shows this trace: the chunks retrieved and their similarity, timings, which checks ran, and the grounding score.
Data
Knowledge base
One file, content/content.json, renders the page and feeds the bot, so the two cannot disagree. It is split into 15 chunks: one per project plus short notes on Dwi, contact, stack, other builds, privacy and evaluation. The embedding index records the content version it was built from and is ignored when they differ.
Content is edited without touching code: through a private admin page, or by Claude through this site's own MCP server at /mcp, protected with OAuth 2.1 and PKCE. Every change is checked against the education and personal-life policy, versioned, reversible, and followed by a rebuild of the embedding index, so the page and the bot change together. Hidden projects are removed from the public content before the page loads it.
Visitor logs
| Field | What it holds |
|---|---|
| ts | Time of the event, UTC |
| sid | Random id created in the browser tab, gone when the tab closes |
| q | The question text, omitted under Do Not Track and for self-introductions |
| ret | Retrieval method, chunk ids and scores, whether a good source was found |
| llm | Time to first token, total time, reply length, errors |
| stop, gr, src | Safety stops, lexical grounding, cited sources |
| mode, lang | Visitor or Data scientist mode, English or Indonesian |
| cc, dev | Two-letter country code from Cloudflare, device class (mobile, desktop, bot) |
Not stored: IP addresses, cookies, full user-agent strings, or names, unless a visitor chooses to pass a hello on to Dwi.
Evaluation
A golden set of fact questions with expected facts, plus privacy probes that must be redirected, in English and Indonesian. Each version of the bot is scored on:
- Answer accuracy: share of fact questions whose reply contains every expected fact.
- Retrieval hit in top 3: share of fact questions whose expected chunk is among the three best matches.
- Privacy probes redirected: share of probes answered without any out-of-scope term.
- Normal questions wrongly redirected: share of fact questions the guard blocked by mistake.
- Replies with out-of-scope terms: share of all replies containing a blocked term.
- Answers adding a detail not in the content: share of fact replies that state something the content does not, checked claim by claim. Accuracy alone misses this: a reply can contain every expected fact and still invent a reason or a feature.
- First token and full reply, median: latency as a visitor feels it. The old version did not stream, so it reports only the full reply.
The baseline is v1 from August 2026: a static prompt with Qwen2.5-7B-Instruct and no retrieval, measured on the same set before it was retired.
Loading results…
Monitoring
The Lab panel on the portfolio, visible in Data scientist mode, recomputes these every ten minutes from the last 30 days of logs: questions answered, share that found a good source, mean lexical grounding, first-token latency at the median and 95th percentile, safety stops, and topic clusters. Weekly, logged questions are clustered by topic and the ones without a good source become content to add.
Limitations
- An 8B model can still phrase things loosely or miss nuance. Answers are short and cite their sources so they can be checked.
- Lexical grounding catches invented names and numbers, not faulty reasoning.
- The privacy guard is rule-based, so unusual phrasings can slip past it. That is why the knowledge base itself holds no education or personal records and the output filter runs on every reply.
- The threshold for "found a good source" was set by hand and is reviewed against logged gaps.
- Page views exclude bots and visitors with Do Not Track. Their questions are still counted, without text.
Privacy and data governance
- No IP addresses and no cookies. The session id lives only in the browser tab.
- Rate limiting uses a salted hash of the IP address, kept for at most two days and never written to the logs.
- Do Not Track and Global Privacy Control are honoured: no interaction events, and questions are stored without their text.
- Only aggregates are public. Raw logs stay on the hosting server and are readable only by Dwi.
- Logs are deleted after 12 months, or earlier on request by email to dwiahmaddzul@gmail.com.
- If Cloudflare Web Analytics is switched on, it is cookieless and counts page views only.
Changelog
- v2.2, December 2026. Content management: an admin page and an MCP server (dual protocol support for MCP 2026-07-28 and earlier revisions) with tools to add, edit, hide, reorder and undo, plus a self-check that asks the live bot after each change.
- v2.1, December 2026. The first live evaluation of v2 found three answers adding details the content does not state, and one Indonesian answer that missed the right word for deaf. Fix: Indonesian terms in every content chunk and a prompt rule against unstated reasons or features. On the same golden set, answer accuracy went from 96% to 100% and answers adding a detail from 11% to 4%.
- v2.0, December 2026. Retrieval over a single content file, privacy guard, output filter, anonymous logging, Lab panel, golden-set evaluation, Data scientist mode.
- v1, August 2026. Static prompt, streamed replies, guard against repeated-token loops.