Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vectoraidb.actian.com/llms.txt

Use this file to discover all available pages before exploring further.

The JavaScript SDK provides a TypeScript-first VectorAIClient for VectorAI DB over gRPC, plus REST-based auth/admin helpers.

Prerequisites

RequirementVersion
Node.js18 or higher
npm9 or higher
VectorAI DBRunning at localhost:6574 by default

Install the SDK

Add the SDK to your project.
npm install @actian/vectorai-client
With yarn:
yarn add @actian/vectorai-client

Verify installation

VectorAI DB required: To verify your installation, run VectorAI DB locally first. Follow the Docker installation guide if you need a server.
Save the following as health.ts and run it with npx tsx health.ts.
import { VectorAIClient } from '@actian/vectorai-client';

const client = new VectorAIClient('localhost:6574');

try {
  const health = await client.healthCheck();
  console.log(`Server: ${health.title} v${health.version}`);
} finally {
  client.close();
}

Project setup

Create a TypeScript project and install the SDK.
mkdir my-vectorai-app
cd my-vectorai-app
npm init -y
npm install @actian/vectorai-client
npm install --save-dev typescript tsx @types/node
npx tsc --init

Configure the client

Use constructor options or environment variables for connection settings.
import { VectorAIClient } from '@actian/vectorai-client';

const client = new VectorAIClient('localhost:6574', {
  accessToken: process.env.ACTIAN_VECTORAI_ACCESS_TOKEN,
  restUrl: 'http://localhost:6573',
  timeout: 30,
  maxRetries: 3,
});

Troubleshooting

IssueSolution
MODULE_NOT_FOUNDVerify the SDK is installed with npm ls @actian/vectorai-client.
gRPC connection errorsConfirm VectorAI DB is reachable at localhost:6574.
Node.js version mismatchRun node --version; the SDK requires Node.js 18 or later.
TypeScript module errorsUse an ESM-compatible setup and run examples with tsx.

Next steps

Quickstart

Create a collection, insert vectors, and run a search.

JavaScript reference

Review namespaces, client options, filters, auth, batching, and errors.