Node.js API Reference
EmbexClient
Section titled “EmbexClient”The entry point for interacting with vector databases.
import { EmbexClient } from "@bridgerust/embex";
const client = new EmbexClient("qdrant", "http://localhost:6333");Constructor
Section titled “Constructor”new EmbexClient(provider, url)
Section titled “new EmbexClient(provider, url)”- provider:
qdrant,chroma,weaviate,lancedb,pgvector,milvus - url: Connection string or URL.
Methods
Section titled “Methods”collection(name)
Section titled “collection(name)”Get a reference to a collection. Returns a Collection instance.
Collection
Section titled “Collection”Represents a vector collection.
Methods
Section titled “Methods”async create(dim, distance = "cosine")
Section titled “async create(dim, distance = "cosine")”Create the collection.
async insert(points)
Section titled “async insert(points)”Insert vectors. points is an array of Point objects.
// Point is a plain object interface, not a classawait col.insert([ { id: "1", vector: [0.1, ...], metadata: { foo: "bar" } }]);async search(vector, limit = 10)
Section titled “async search(vector, limit = 10)”Search for similar vectors. Returns an array of results.
async deleteCollection()
Section titled “async deleteCollection()”Delete the collection.
async scroll(offset?: string, limit?: number)
Section titled “async scroll(offset?: string, limit?: number)”Paginated export of points. Returns { points: Point[], nextOffset?: string }.
DataMigrator
Section titled “DataMigrator”Utility for migrating data between providers.
import { DataMigrator } from "@bridgerust/embex";
const migrator = new DataMigrator(sourceClient, destClient);
// Migrate with auto-inferred schemaawait migrator.migrateSimple("source_col", "dest_col");