Context
#16643 (importer for #16642) is admin-triggered on demand (POST /knowledge_base/import_claude_memory) — someone has to remember to call it. Claude Code continuously writes and updates memory files during sessions, so the knowledge_facts store drifts out of date between manual triggers.
Proposal
A folder watcher (e.g. watchdog/inotify) on get_claude_memory_dir() that calls the existing import_claude_memory() pipeline incrementally when a memory file is created or modified, instead of (or in addition to) the manual admin endpoint. Reuses the importer's existing idempotent upsert (fact_id_for) — a watched change just re-triggers import_memory_file for that one path, no full-directory rescan needed.
Acceptance Criteria
Depends on
#16643 (the importer this would wrap) landing first — currently blocked on #16507/#16654.
Owner idea, raised during #16643's review.
Context
#16643 (importer for #16642) is admin-triggered on demand (
POST /knowledge_base/import_claude_memory) — someone has to remember to call it. Claude Code continuously writes and updates memory files during sessions, so the knowledge_facts store drifts out of date between manual triggers.Proposal
A folder watcher (e.g.
watchdog/inotify) onget_claude_memory_dir()that calls the existingimport_claude_memory()pipeline incrementally when a memory file is created or modified, instead of (or in addition to) the manual admin endpoint. Reuses the importer's existing idempotent upsert (fact_id_for) — a watched change just re-triggersimport_memory_filefor that one path, no full-directory rescan needed.Acceptance Criteria
get_claude_memory_dir()for create/modify events on*.mdfiles (excludingMEMORY.md)import_memory_file()path (same redaction, same owner/visibility metadata, same idempotent upsert)while TrueloopPOST /import_claude_memoryendpoint stays available as a manual backfill/re-sync triggerDepends on
#16643 (the importer this would wrap) landing first — currently blocked on #16507/#16654.
Owner idea, raised during #16643's review.