Unispec Docs
SDK ReferenceFunctions

createIndexClient()

Function: createIndexClient()

createIndexClient(opts?): IndexClient

Defined in: packages/sdk/src/sdk.ts:107

Build a vector-database client bound to a Libra project (via its API key). Create indexes, upsert vectors, and query them. See vector-db.md.

import { createIndexClient } from "@unispec-ai/sdk"; const pc = createIndexClient({ apiKey: process.env.UNISPEC_API_KEY }); await pc.createIndex({ name: "products", dimension: 384, metric: "cosine" }); const index = pc.index("products"); await index.upsert([{ id: "v1", values: [...], metadata: { category: "shoes" } }]); const { matches } = await index.query({ vector: [...], topK: 10 });

Parameters

opts?

MemoryClientOptions = {}

Returns

IndexClient

On this page