Problem
The workspace knowledgebase only re-indexes on explicit hermes workspace index or via the debounce-on-retrieve path (30s cooldown). Files modified between retrieval calls may serve stale results.
Research
- Continue.dev: Uses VS Code FileSystemWatcher with 5-second debounce and AbortController for cancellation
- PrivateGPT: IngestWatcher polls filesystem every 5 seconds via simple loop
- Khoj: No file watching — entirely API-triggered re-indexing
Proposed approach
Add an optional lightweight polling watcher:
- New config key:
knowledgebase.watch_for_changes: false (off by default)
- When enabled, spawn a background thread that polls workspace roots every N seconds (configurable, default 10)
- On change detection (mtime comparison), trigger
index_workspace_knowledgebase() in background
- Use existing
_AUTO_INDEX_DEBOUNCE_SECONDS to avoid redundant re-indexes
- New module:
agent/workspace_watcher.py
Related
Part of workspace foundation (#5840)
Problem
The workspace knowledgebase only re-indexes on explicit
hermes workspace indexor via the debounce-on-retrieve path (30s cooldown). Files modified between retrieval calls may serve stale results.Research
Proposed approach
Add an optional lightweight polling watcher:
knowledgebase.watch_for_changes: false(off by default)index_workspace_knowledgebase()in background_AUTO_INDEX_DEBOUNCE_SECONDSto avoid redundant re-indexesagent/workspace_watcher.pyRelated
Part of workspace foundation (#5840)