Ultrahost/ docs

An index names the embedding model, the dimensions, and the similarity metric. Records can be embedded by Ultrahost or supplied already embedded.

Paths in the tables are relative to https://api.ultrahost.com/v1/projects/{projectId}. Pagination, idempotency, and errors are described in Conventions.

Create

SDKRESTDescription
vectors.createIndex(name, config)POST /vectors/indexesCreate a vector index
vectors.getIndex(name)GET /vectors/indexes/{name}Retrieve configuration
vectors.listIndexes()GET /vectors/indexesList indexes
vectors.updateIndex(name, config)PATCH /vectors/indexes/{name}Update supported index settings
vectors.deleteIndex(name)DELETE /vectors/indexes/{name}Delete an index
ts
await ultrahost.vectors.createIndex("knowledge", {
  model: "default-embedding",
  dimensions: 1536,
  similarity: "cosine"
});

Configure

Set the embedding model, dimensions, and similarity when you create the index. updateIndex changes only settings that can change in place. Similarity and dimensions that would invalidate stored vectors require a new index.

The API accepts both:

  • Text that Ultrahost embeds and stores
  • Vectors produced outside Ultrahost

Declare metadata filtering and similarity metrics through capabilities when a deployment does not support every option.

Use

SDKRESTDescription
vectors.upsert(index, records)POST /vectors/{index}/upsertInsert or update vectors
vectors.get(index, id)GET /vectors/{index}/{id}Retrieve one record
vectors.delete(index, id)DELETE /vectors/{index}/{id}Delete a vector
vectors.search(index, query)POST /vectors/{index}/searchSimilarity search from text
vectors.searchByVector(index, vector, options?)POST /vectors/{index}/search/vectorSearch with a supplied embedding
vectors.embedAndStore(index, content)POST /vectors/{index}/embedGenerate embeddings and store them
vectors.stats(index)GET /vectors/indexes/{index}/statsIndex statistics
ts
await ultrahost.vectors.embedAndStore("knowledge", {
  id: "article-123",
  text: "How to configure an application",
  metadata: { category: "documentation" }
});

const results = await ultrahost.vectors.search("knowledge", {
  query: "How do I set up my app?",
  topK: 5
});

useVectorSearch(index, query) is the React hook for the text search path.