Registry / ai-ml / vald-client-node

vald-client-node

JSON →
library1.7.17jsnpmunverified

A Node.js gRPC client library (v1.7.17) for Vald, an AI-powered vector similarity search engine. This client enables inserting, updating, searching, and removing vectors via gRPC with support for both CommonJS and ESM. It ships TypeScript types and targets Node.js >=18.16.0. Compared to other vector database clients, it is optimized for Vald's cloud-native architecture and offers auto-indexing and distributed search capabilities.

npm install vald-client-node
INSTALL
IMPORT
SIG · VALD-CLIENT-NODE
V
vald-client-node
ai-mljavascriptv1.7.17
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ValdClient
✓ import { ValdClient } from 'vald-client-node'
✗ const ValdClient = require('vald-client-node').ValdClient
ESM or CommonJS both work; named export.
InsertRequest
✓ import { InsertRequest } from 'vald-client-node'
✗ const InsertRequest = require('vald-client-node').InsertRequest
Protobuf message type, also exported.
DefaultRPCClient
✓ import { DefaultRPCClient } from 'vald-client-node'
✗ import DefaultRPCClient from 'vald-client-node'
Default export is the package itself, not a class.

Demonstrates how to instantiate a ValdClient, insert a vector, and perform a similarity search.

import { ValdClient } from 'vald-client-node'; import { InsertRequest, Object, SearchRequest } from 'vald-client-node'; const client = new ValdClient('localhost:8080', grpc.credentials.createInsecure()); const insertReq = new InsertRequest({ vector: new Object({ id: 'vec1', floatVector: { vector: [0.1, 0.2, 0.3] } }) }); client.insert(insertReq, (err, response) => { if (err) console.error(err); else console.log('Inserted:', response); }); const searchReq = new SearchRequest({ vector: [0.1, 0.2, 0.3], config: { num: 10 } }); client.search(searchReq, (err, response) => { if (err) console.error(err); else console.log('Results:', response.results); });
Debug
Known issues
breakingIn v1.0.0, the client constructor changed from (address, options) to (address, credentials, options).
fix
Update constructor call to include credentials as second argument.
affects: >=1.0.0 <1.7.0
deprecatedSearchRequest.vector field is deprecated in favor of SearchRequest.vectorObject.
fix
Use SearchRequest.vectorObject for new projects.
affects: >=1.7.0
gotchagRPC deadline is not set by default; long-running calls may hang indefinitely.
fix
Set a deadline on the gRPC call options, e.g., { deadline: new Date(Date.now() + 5000) }.
affects: >=1.0.0
gotchaThe Vector message uses float_vector for floats and binary_vector for bytes; mixing them causes serialization errors.
fix
Ensure you set the correct field based on vector type: floatVector vs binaryVector.
affects: >=1.0.0
deprecatedCreateIndexRequest and CreateIndexResponse are deprecated; use IndexInfoRequest/Response instead.
fix
Replace with IndexInfoRequest and IndexInfoResponse.
affects: >=1.7.0
Errors
Common errors & fixes
Error: 12 UNIMPLEMENTED: Method not found: vald.v1.Insert/Insert
Outdated Vald server version that doesn't support the Insert RPC.
fix
Upgrade Vald server to v1.7 or later, or check the server's available methods.
TypeError: Class constructor ValdClient cannot be invoked without 'new'
Missing 'new' keyword when instantiating ValdClient in ESM.
fix
Use: const client = new ValdClient(...);
Error: Metadata expected as object, got array
Passing an array of metadata entries where an object is expected.
fix
Pass metadata as a plain object: { key: 'value' }.
Error: Failed to connect to remote host: connection refused
Vald server not running or wrong address/port.
fix
Ensure Vald server is running and accessible at the given host:port.
Upgrade
Version history
1.7.17latest on npm
Audit
Dependencies
@grpc/grpc-jsrequiredRequired for gRPC communication with Vald server
google-protobufrequiredUsed for Protocol Buffers serialization
Agent activity
33 hits · last 30 days
node
30
OpenAI (training)
1
Resources
vald-client-node — npm install vald-client-node · libregistry