firehose> #llmops

Incremental Indexing

Keeping a search index fresh without re-embedding everything on every change. The engine of it is hashing to skip work at two granularities. A file watcher (debounced ~1.5 s, dirty-flag) triggers a sync; the sync lists memory files and compares each file's content hash against a files table — if the hash matches, that file is skipped entirely, so only genuinely-changed files get re-chunked. When a file does change, it's split into chunks (OpenClaw: ~400 tokens with 80-token overlap) and each chunk's text is hashed against an embedding cache — a cache hit reuses the stored vector and skips the embedding API call. Embedding calls cost money and add up, so the cache is a direct cost optimization. Re-embedding runs under a concurrency limit so it doesn't overwhelm the provider.

A full re-index is reserved for changes that invalidate existing embeddings — a different embedding provider, model, or chunk-size config, detected as a mismatch in a metadata table. Even then it's done safely: build the new index into a temporary database, then atomically swap it into place, so a half-built index is never live. Session transcripts get a lighter delta-tracking trigger (sync once accumulated bytes/messages cross a threshold). Net effect: memory stays searchable without an expensive full rebuild on every edit — the same "spend work only where the input actually changed" discipline that content-addressed caches everywhere rely on.

Claims


Linked from