xiaoxixi acf74981b2 feat(memory): relevance-gated auto recall with hard timeout
Replace the unconditional top-5 keyword recall with a deterministic,
layered gate so only relevant Knowledge entries reach the prompt.

- New src/memory/recall.rs: tokenization with stopword filtering and a
  bounded term list; ranking combines lexical relevance, importance and
  recency; double gate (min_relevance + min_score) drops weak or stale
  matches; hard tokio::time::timeout wraps the SQL search so a slow FTS5
  query never delays a turn.
- MemoryConfig gains recall_min_relevance, recall_min_score,
  recall_recency_half_life_days, recall_timeout_ms (default 1000ms);
  recall_limit is now actually wired instead of being a dead field.
- MemoryManager::recall_for_context exposes the gated path; the
  memory_recall tool keeps the raw search.
- Storage::search_memories / search_memories_by_time share a single
  jieba-based tokenizer via the new module; search_memories_by_terms
  accepts pre-tokenized input for the gated path.
- Docs and example configs (README, about-picobot references, both
  config.example.json templates) updated to reflect the new behavior.
2026-08-21 17:29:48 +08:00
..