In the first version of /ask (a page in Chinese: a small assistant that answers questions about my site using a local model), I proudly wrote "no conversations are stored, no record of who asked what". Later I wanted to see for myself: what are visitors actually asking? Which questions does the small model answer badly? What is missing from the knowledge base? Without a log, all of that is guesswork. So I switched to logging, but dealt with the risky parts first.
What is logged, and what is not
Logged: time, question, answer (truncated), the source URLs listed, how many milliseconds it took, which question of the conversation it was, and whether the answer finished.
Not logged: IP, User-Agent, any account. Rate limiting uses the IP, but only in memory; it is cleared on restart and never written to the log file.
The biggest risk: personal data visitors type in themselves
The most dangerous thing about a chat box is that people naturally type their email or phone number into it ("my email is …, could you …"). So the text is masked before it is written to disk:
- email →
[email] - numbers with 7 or more digits (including spaces, dashes, parentheses) →
[number]; short numbers such as years, version numbers, or "72 hours" are left alone - alphanumeric strings of 32 characters or more →
[token](probably a key)
Both question and answer are masked, because models often repeat the visitor's words verbatim. The masking lives in the function that writes the file, not in the code that reads the log, so the original text is never in the file at all.
How long it is kept, and where
It is kept for 90 days, at most 2,000 entries, and trimmed every 50 entries. The format is JSONL (one line per entry, appendFileSync), not "read everything, modify, write back", so two interleaved requests cannot overwrite each other. The log is only shown in the admin page /admin/ask; the demo admin that visitors can look around does not have that page.
Say it on the page
The /ask page (in Chinese) now says: questions are logged, IP is not recorded, email and phone numbers are masked first, entries are kept for 90 days, only the site owner can see them, and please do not put personal data in your question. I also changed the earlier posts that said "conversations are not stored", otherwise I would be contradicting myself.
What the admin page shows
Total count, last 7 days, average response time, unfinished answers, and repeated questions. Each entry opens to show its answer and sources. The most useful is the "no source" label: the answer does not match any project or post. Either it came from the basic profile data (fine), or the knowledge base is missing something, which is a hint about what the next post should cover.
Addendum (2026-11-29): I tested the masking rules properly
The unit tests only checked a few examples of "what should be masked is masked, years and version numbers are untouched". I ran the same regular expressions on a wider set of inputs. The results:
| Input | What goes into the log |
|---|---|
Taiwan ID number A123456789 | A[number] |
Credit card 4111 1111 1111 1111 | [number] |
Landline 07-123-4567 | [number] |
Server at 192.168.1.10 | [number] |
6,663 messages, 1,021 times | untouched (commas are not matched) |
deployment dropped from 5–40 s to 1–2 s | untouched |
| A name and a home address in Kaohsiung | untouched |
LINE ID: abc_1234 | untouched |
written on 2026-11-27 | written on [number] |
updated 2026/11/27 | untouched |
Three things stand out:
- Numeric personal data is caught. The rule is "digits, spaces, dashes, parentheses and dots run together, with 7 or more digits", and ID numbers, credit cards, landlines, mobiles and IPs all fall inside it.
- Text-type personal data is not caught. Names, addresses and LINE IDs (LINE is the messaging app most people in Taiwan use) have no fixed format, and a regular expression cannot stop them. So the line "please do not put personal data in your question" on the /ask page is not politeness, it is the real last line of defense of this approach.
- There are false positives: dates written with dashes get masked.
2026-11-27has 8 digits, which looks like a phone number. The model often cites article dates in its answers, so[number]can show up in logged answers; dates written with slashes are not affected. Knowing this when reading the log is enough; masking one extra date costs far less than missing a phone number.
Also, some actual usage numbers: two days after launch, the log holds only 2 entries, and neither triggered the masking. The server log shows several /api/chat/warm calls today (opening /ask makes the server load the model into the GPU first), but no matching requests that sent a question in the same period: people opened the page and nobody actually asked anything. Warm-up collects no data and is not written to the question log.