Build a vector search engine
Stage 1 of 5v1 · 3015f897

Create the vector store

Insert, replace, and delete vectors with consistent dimensions.

Consistent state

Read one JSON object per line and emit one compact response per command. upsert receives a text id, a vector of finite numbers, and optional metadata. The first insertion fixes the store dimension; later vectors must match it.

An upsert with an existing id replaces its vector and metadata. delete returns deleted:true when the id existed and deleted:false otherwise. An invalid command reports {"error":"..."} and processing continues.

Acceptance criteria

  • Preserve state between lines until EOF.
  • Replacing does not duplicate an id.
  • Reject mismatched dimensions without changing the store.