Published
Penang AI Assistant
Can a language model answer questions about Penang's economy safely, using only official statistics?
The answer
Across 45 evaluation cases run 3 times each, gpt-oss:120b passed all 6 release gates: every supported question matched the reference answer, every displayed number matched its returned evidence, and every ambiguous, unsupported or adversarial case was handled without fabricated facts.
Key numbers
supported questions answered with the correct result, across 3 repeats.
100% supported-query correctness; threshold 90%; dev 60/60 and held-out 21/21.
released answers whose displayed numbers matched their returned evidence.
100% displayed numerical consistency; threshold 100%.
median latency per successful answer, p95 2.43 s.
Includes the network round trip to Ollama Cloud; 0 timeouts and 0 infrastructure failures in 135 runs.
The evidence
The analysis is in progress
When the first run is published, this chapter will show an evaluation of answer accuracy against hand-checked questions, and how often the assistant correctly refuses questions the data cannot answer.
Nothing here is estimated or illustrative. Results appear only after the pipeline publishes them with their sources.
How it was made
Data sources
| Source | Publisher | What we used | Licence | Retrieved |
|---|---|---|---|---|
| OpenDOSM | Department of Statistics Malaysia | CPI, CPI inflation and quarterly unemployment by state | CC BY 4.0 | 2026-10-12 |
| Ollama Cloud | Ollama | gpt-oss:120b to plan each answer and its SQL | Provider terms | 2026-10-12 |
Method
- Fetch CPI, CPI inflation and quarterly unemployment from the OpenDOSM API.
- Validate each file against a column contract, quarantining bad rows with their reasons.
- Load accepted data as a new snapshot, keeping the last good snapshot if a refresh fails.
- Have the model turn each question into SQL, then check it against a policy and run it read-only on approved views.
- Record every question, query and result in an insert-only audit log.
Limitations
- A personal prototype, not an official service.
- Covers only CPI, inflation and unemployment so far.
- Answers depend on a single model provider; a second provider is planned.
- Answer accuracy was measured on 45 hand-checked cases run 3 times each under the committed evaluation report 20261012T122949_gpt-oss-120b_plan-v6_all.json, and all six release gates passed. Held-out figures have wide uncertainty because the set is small.
Check it yourself
Reproduce
uv sync
docker compose up -d --wait
uv run python -m ingestion.cli refresh
uv run uvicorn api.main:app --port 8010The code repository is private for now.
Discuss
Have a question you think it should answer, or one it should refuse? Suggestions are welcome.