fix: recover missing embeddings safely

This commit is contained in:
ntduc committed 2026-07-22 19:01:16 +07:00
1 parent 51a27af707
commit 876104950b
9 files changed
+914 -52

No files matched your search

+11 -2
View File
@@ -282,8 +282,8 @@ sequenceDiagram
PG-->>GW: PG stores created
GW->>GW: 5. Start tracing collector
GW->>PG: 6. Register providers from DB
GW->>PG: 7. Wire embedding provider to PGMemoryStore
GW->>PG: 8. Backfill memory embeddings (background)
GW->>PG: 7. Wire embedding provider to vector-enabled PG stores
GW->>PG: 8. Backfill missing embeddings in bounded background batches
GW->>GW: 9. Register config-based providers
GW->>GW: 10. Create tool registry (filesystem, exec, web, memory, browser, TTS, subagent, MCP)
@@ -303,6 +303,15 @@ sequenceDiagram
GW->>Engine: 22. Listen on host:port
```
Embedding recovery covers memory chunks, knowledge graph entities, active
skills, non-cancelled team tasks, active agents, episodic summaries, and vault
documents. The process-wide provider is resolved from the master tenant because
startup recovery may process semantic content from multiple tenants. Agent,
episodic, and vault backfills run sequentially with independent deadlines and
bounded batches. They only select rows whose embedding is `NULL`, re-check the
source fields before writing, isolate malformed rows, and can retry remaining
rows on the next startup.
---
## 7. Database Wiring