Vector Index
The vector index is the platform's similarity search engine. It is not the source of truth for any memory — it is a derived store that can be rebuilt from the primary datastore. This page describes its layout, what it stores, what it deliberately does not, and how it stays consistent with the row.
One collection per user
Collections are named memorysync-user-{user_id}. There is exactly one per user, no per-project sub-collections. A query against another user's collection cannot happen through the API surface — the collection name is derived from the authenticated user_id, never from the body.
Similarity metric
Every collection is created with cosine similarity. The index returns a distance; the platform converts to similarity with similarity = 1 - clamp(distance, 0, 1). No other metric is configured.
What is stored per row
vector_id— stable handle, unique inside the collection.vector— the embedding floats themselves.- metadata payload:
memory_id,user_id,project_id,environment,source,tags,importance,created_at(ISO string),tier.
What the index deliberately does not store
- Memory text — encrypted in the durable store only.
- Memory summary — same.
- Quality, confidence, and freshness scores — those live on the row and are joined in at rank time.
- The relationship graph — separate table, accessed only when traversal is needed.
- Extraction metadata — irrelevant to similarity search.
Upserts and idempotency
- When a memory is created, a vector row is inserted under a freshly generated
vector_id. - When a memory's content is updated, a new
vector_idis generated. The old vector is deleted by the previous handle; the new one is upserted. - When a memory's tier changes, the vector is re-upserted so the metadata payload's
tierfield stays consistent. - Deleting a non-existent vector is a no-op — deletion is idempotent so retry-on-failure is safe.
Filter pushdown is the key feature
Where-clauses on metadata fields run during the similarity search, not after. That is what makes a tightly filtered query as fast as an unfiltered one — the index never returns 10,000 rows that the platform then throws away.
Reliability around index calls
- Every call wraps in a retry loop: 50 ms → 100 ms → 200 ms exponential backoff.
- After three consecutive failures, the call surfaces an HTTP 503; recall does not silently degrade to "empty index".
- Per-user collections are cached locally so steady-state queries skip the collection-listing path on every call.
Archived vector pathway
When a memory is archived or moved to cold tier, its vector can be exported to a cold object-storage bucket and removed from the active collection. The platform tracks archived vectors so cold-tier recall (a slow path with a multi-second SLA) can pull them back in on demand. Cold archive purge is governed by the same retention timeline as the row.