Prerequisites
Before you begin, make sure you have the following installed.| Requirement | Version |
|---|---|
| Node.js | 18 or higher (LTS recommended) |
| npm | 9 or higher |
| VectorAI DB | Running on localhost:50051 |
@actian/cortex-client | Installed (installation guide) |
Step 1: Set up the SDK
Add the VectorAI DB JavaScript SDK to your project.Step 2: Run the Docker container
Download and run the VectorAI DB Docker container.localhost:50051.
Step 3: Build and run the quickstart
The following steps walk through each part of the quickstart. All code snippets below belong in a single file. Save the complete script asquickstart.ts and run it with npx ts-node quickstart.ts.
Connect and create a collection
Connect to the VectorAI server and create a collection namedproducts with dimension 128 and cosine distance metric.
Generate sample data
Define a helper function to generate sample product vectors with metadata.Insert vectors
Generate 100 sample products and insert them into the collection.Search for similar vectors
Perform similarity search to find the top five most similar vectors.Clean up
Delete the collection and close the connection.Next steps
Now that you have completed the quickstart, explore these resources to build further.Simple RAG pipeline
Build your first Retrieval-Augmented Generation application.
Documentation
Explore complete technical documentation.