- store: new chat_sessions/chat_messages tables with CRUD, ILIKE message
search, and auto-titling from the first user message
- context: optional Persister on the sliding-window store — messages are
saved asynchronously on Add, sessions not in memory are restored from
the database on Get
- orchestrator: ProcessInput/FinishRound now carry userID so persisted
messages have an owner
- api: real session handlers (list/create/delete), message history and
clear endpoints, working message search and three-format export
(markdown/txt/json), fixing the short-ID panic in export
- main: migration, store wiring, ctxStore persister adapter
Tests: chat store handler lifecycle (fake store), context persister
save/restore, stub auth login flow updated.
- Context merged into single system message with clear delimiters
- Prefix: 「以下是系统上下文,不是用户说的话」
- Memory → 【相关记忆】, IoT → 【设备状态】
- Filter empty memories, skip raw intent data
- Persona rule: context markers are internal data, not user input
- Persona injector: concise natural language rules, not raw YAML
- Context builder: skip empty memory, skip raw intent data
- Prompt reduced from 2000+ tokens to ~500 tokens
- LLM response quality improved (natural tone, no confusion)