Data / semantic retrieval
P1 · Intelligence
Vector DB
Store embeddings and find information by semantic similarity rather than exact keywords.
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
| SDK | REST | Description |
|---|---|---|
vectors.createIndex(name, config) | POST /vectors/indexes | Create a vector index |
vectors.getIndex(name) | GET /vectors/indexes/{name} | Retrieve configuration |
vectors.listIndexes() | GET /vectors/indexes | List indexes |
vectors.updateIndex(name, config) | PATCH /vectors/indexes/{name} | Update supported index settings |
vectors.deleteIndex(name) | DELETE /vectors/indexes/{name} | Delete an index |
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
| SDK | REST | Description |
|---|---|---|
vectors.upsert(index, records) | POST /vectors/{index}/upsert | Insert 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}/search | Similarity search from text |
vectors.searchByVector(index, vector, options?) | POST /vectors/{index}/search/vector | Search with a supplied embedding |
vectors.embedAndStore(index, content) | POST /vectors/{index}/embed | Generate embeddings and store them |
vectors.stats(index) | GET /vectors/indexes/{index}/stats | Index statistics |
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.