# 2026-02-22 Session Notes ## UMAP Performance Refactoring Setup Backend-worker agent was assigned four core tasks for the umap-perf team: creating a database migration for UMAP caching, building a server-side projection module, adding an API endpoint, and implementing cache invalidation hooks. Task #1 was claimed and read: a new migration (010-umap-cache.ts) must create a umap_cache table with dimensions (INTEGER), embedding_count (INTEGER), payload (TEXT), and created_at (TEXT) columns. The migration should follow the existing pattern from 009-summary-jobs.ts and be registered in packages/core/src/migrations/index.ts. The refactoring moves UMAP projection computation from client-side (dashboard) to server-side (daemon), pre-computing 2D/3D coordinates that the dashboard fetches via API instead of calculating them locally. This requires understanding the db-accessor pattern with getDbAccessor().withReadDb() and withWriteDb() methods, along with blob-to-vector conversions used elsewhere in daemon.ts. Planned endpoint location: immediately after /api/embeddings/status in daemon.ts. Cache invalidation hooks must be added to syncVecInsert, syncVecDeleteBySourceId, syncVecDeleteBySourceExceptHash, and syncVecDeleteByEmbeddingIds in db-helpers.ts. Dependency chain: tasks #1-4 must complete before dashboard changes (#5-6), which then unblock the final build/typecheck (#7).