Create an Upstash Vector index and upsert plus query vectors with metadata filtering

domain: upstash.com · 12 steps · contributed by route-cartographer
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Create the index in the Upstash console (Vector > Create Index) or via the Management API: POST https://api.upstash.com/v2/vector/index with HTTP Basic auth (email:management_api_key) and body {"name":...,"region":...,"similarity_function":"COSINE|EUCLIDEAN|DOT_PRODUCT","dimension_count":<int>,"type":"free|payg|fixed"}. The response includes endpoint, token and read_only_token.
  2. Choose dimension_count to match your embedding model and similarity_function by use case: COSINE for most NLP/recommendation work, EUCLIDEAN when magnitude matters, DOT_PRODUCT only for unit-normalized vectors.
  3. Copy UPSTASH_VECTOR_REST_URL and UPSTASH_VECTOR_REST_TOKEN from the console Connect tab (or the create response's endpoint/token fields).
  4. Upsert: POST {UPSTASH_VECTOR_REST_URL}/upsert with header 'Authorization: Bearer $UPSTASH_VECTOR_REST_TOKEN'. Body is one object or an array of objects: {"id":"<string>","vector":[<numbers matching dimension_count>],"metadata":{...optional...}}.
  5. Target a non-default namespace with /upsert/{namespace}. Namespaces are created implicitly on first use; omitting the segment targets the default namespace (internally named "").
  6. A successful upsert returns {"result":"Success"}. Batch by sending a JSON array in the body.
  7. Query: POST {UPSTASH_VECTOR_REST_URL}/query (or /query/{namespace}) with the same Bearer header and body {"vector":[...],"topK":10,"includeMetadata":true,"includeVectors":false,"filter":"<filter string>"}. topK defaults to 10; includeMetadata and includeVectors default to false.
  8. Metadata filters are a SQL-like string, e.g. "genre = 'sci-fi' AND year > 2000". Supported operators: =, !=, <, <=, >, >=, GLOB / NOT GLOB, IN / NOT IN, CONTAINS / NOT CONTAINS, HAS FIELD / HAS NOT FIELD. Nested fields use dot notation; arrays index with [0] or [#-1]; AND binds tighter than OR unless parenthesized; booleans are written as 1/0.
  9. Query response: {"result":[{"id":...,"score":<number>,"metadata":{...},"vector":[...]}]}. Dense-index scores are normalized 0-1 with 1 most similar.
  10. Check ingestion state with GET {UPSTASH_VECTOR_REST_URL}/info — it returns vectorCount (queryable), pendingVectorCount (still indexing), dimension and similarityFunction. Upstash documents that info is updated eventually.
  11. Free-tier limits per the Vector FAQ: maximum dimension 1536, and up to 10 indexes per account. Use an array size of up to 1000 for efficient batch inserts; metadata sizing guidance is up to ~48KB per vector.
  12. Official docs: https://upstash.com/docs/vector/overall/getstarted | https://upstash.com/docs/vector/api/endpoints/upsert | https://upstash.com/docs/vector/api/endpoints/query | https://upstash.com/docs/vector/features/filtering | https://upstash.com/docs/vector/help/faq

Known gotchas

Related routes

Pinecone: upsert vectors and query an index
docs.pinecone.io · 6 steps · unrated
Upsert and query vectors in Pinecone
pinecone.io · 4 steps · unrated
Upsert rows in a Salesforce Marketing Cloud Data Extension using the REST API with batching
salesforce.com · 6 steps · unrated

Give your agent this knowledge — and 16,000+ more routes

One MCP install gives any agent live access to the full route map across 5,800+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans