01 / CORE PRINCIPLES
兩句說話,定義成套架構。
LLM understands and proposes.
Code validates and executes.
Knowledge Base = long-term portable asset.
LLM = replaceable component.
所以 LIC-KEE 唔會將所有責任塞落一個 system prompt。自然語言理解可以交俾 LLM,但牌照名稱、source、citation、部門權限、clarification 上限等高風險決定,要有 backend control。
02 / SYSTEM ARCHITECTURE
由一條問題去到 final answer,中間有八層。
03 / CONVERSATION STATE
Multi-turn 唔係淨係保存 Chat History。
真正會影響牌照 route 嘅資料,需要抽成 canonical facts。State 明確分開:
- confirmed — 使用者明確講過;
- inferred_for_retrieval — 只可以幫搜尋,唔可以當成已確認事實;
- unknown — 目前未知;
- missing_decision_facts — 真正會改變下一步嘅 missing facts。
當新 material fact 出現,system 會重新 merge state,再 invalidate 舊 derived hypothesis,而唔係將新答案疊喺舊答案上面。
Latest explicit material fact wins.
04 / POLICY REGISTRY
Policy 唔應該只存在於 Prompt。
v1.0 將幾類高風險規則抽成獨立控制:
- 官方牌照/許可證 canonical name whitelist;
- bilingual aliases;
- Department ownership / routing;
- Premises eligibility;
- Maximum public clarification = 3;
- Human escalation route。
呢個設計令「模型生成得似唔似官方」唔再係唯一防線。
05 / KNOWLEDGE & RAG
Knowledge Base 同 Answer LLM 完全分離。
| Active KB | fehd_licensing_v5_candidate |
|---|---|
| Records | 3,089 |
| Rollback KB | fehd_licensing_v3 · 2,569 records |
| Vector DB | Chroma PersistentClient |
| Embedding | qwen3-embedding:0.6b via Ollama |
| Dimension | 1,024 |
Portability test 已證明 candidate Knowledge Base 可以 export / restore,而唔需要重新 download、OCR、chunk 或 re-embed 全部既有資料。
Answer Pipeline
Retrieve → Evidence Pack → Evidence Gate → LLM Synthesis → Citation / Claim Validation
06 / RELEASE & RUNTIME
v1.0 係真正 frozen release,而唔係另一個 UAT URL。
| Host OS | Debian 12 (gVisor guest) |
|---|---|
| CPU | x86_64 / 4 logical CPU |
| RAM | 32 GiB |
| Python | 3.13.15 |
| Node.js | 22.23.1 |
| Frontend | React + Vite 7.1.7 |
| Backend | FastAPI 0.142.2 / Uvicorn 0.54.0 |
| Vector DB | Chroma PersistentClient |
| Embedding | qwen3-embedding:0.6b via Ollama 0.34.0 |
| Answer LLM | OpenRouter / qwen/qwen3.7-flash |
| Process Manager | Supervisor 4.3.0.dev0 |
| Docker | NO |
Frozen Baseline
- Service:
fehd-licji-v1 - Release path:
/home/workspace/fehd-rag/releases/licji-v1.0 - Git tag:
v1.0 - Git commit:
68728edcfd378de9510071b037447c831db8f280 - Runtime hashes:11,974 / 11,974 MATCH
- Production service:no reload / no dev watch
07 / SAFETY CONTROLS
「唔亂答」係由多個 control 一齊做到。
Evidence Gate
Evidence 唔夠,就唔應該生成 factual conclusion。
Official-name Whitelist
阻止模型作出聽落似官方、實際未核實嘅牌照名稱。
Department Boundary
可以解釋跨部門關係,但唔代其他部門作個案決定。
Clarification Limit
最多公開追問三次;之後回答已知部分或轉人工。
Non-destructive Validator
只 block / rewrite 有問題 span,唔因一個錯名刪晒 supported answer。
Human Escalation
仍然 unresolved 就正式轉人,而唔係 forcing a guess。