- orchestrator: Tracer interface with spans for intent analysis, persona,
subsession dispatch, context build, LLM streaming and each tool call;
traces finish when the stream completes — the admin Trace waterfall
finally receives data
- background: Thinker generates real LLM thoughts (post-chat + silence
triggers, recent history as context, empty/overlong outputs discarded);
thoughts broadcast to web clients as 'thinking' WS messages; pipeline
postChatHook triggers post-chat thinking after each round
- memory: ApplyDecayAll + ListUserIDs with a 6h decay/purge cron in main
(was implemented but never scheduled)
- repository: optional pgvector embedding column (migration with
CREATE EXTENSION guarded by main), SearchByVector cosine search,
vector-enabled insert path
- service: SetEmbedder — memories are embedded on Add; Search merges
vector hits with n-gram keyword matches (vector first, deduped)
- embedder was already implemented (OpenAI-compatible API + n-gram FNV
fallback) but never instantiated; main now wires it from
EMBEDDING_API_URL/EMBEDDING_MODEL config
- memory/extractor: async LLM-based memory extraction from chat history
- Parses JSON lines from LLM response as memory entries
- Wire into orchestrator pipeline via PostProcess hook
- Non-blocking: runs in goroutine with 30s timeout
- Automatic dedup via existing keyword overlap logic