npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ouim/vectoriadb-client

v0.1.2

Published

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)]()

Readme

VectoriaDB SDK

License: MIT Version

A lightweight, JavaScript-only client/server SDK for VectoriaDB. Forward vector database operations from client applications to a centralized server instance with ease.

⚠️ Not for large production deployments. This SDK is primarily intended for small applications, prototypes, demos, and hobby projects where quick setup and simplicity are priorities. For mission‑critical or large-scale production use, consider a hardened, production-grade solution.


Features

  • Mirror API: Client SDK replicates the full VectoriaDB API surface.
  • Remote Execution: Perform heavy vector operations on the server; keep your client light.
  • Smart Filtering: Send JavaScript functions as filters; they are automatically serialized and executed on the server.
  • Streaming Support: Smoothly handle large result sets with built-in chunking.
  • Robust Connection: Automatic reconnection, request queueing, and configurable timeouts.
  • Collection Helpers: High-level abstractions for simplified document management.

Project Structure

vectoriadb-sdk/
├── server/         # Server implementation (hosts VectoriaDB instance)
└── client/         # Client implementation (forwards requests via Socket.io)

Quick Start

1. Start the Server

The server requires vectoriadb to be installed.

cd server
npm install
npm start

Basic Server Configuration (server/index.js):

import VectoriaDBServer from '@ouim/vectoriadb-server'

const server = new VectoriaDBServer({
  port: 3001,
  cors: ['http://localhost:3000'],
  // apiKey: 'your-secure-key' // Optional authentication
})

await server.listen()

2. Connect the Client

npm install @ouim/vectoriadb-client

Basic Usage:

import VectoriaDB from '@ouim/vectoriadb-client'

const db = new VectoriaDB({
  serverUrl: 'http://localhost:3001',
  // apiKey: 'your-secure-key'
})

await db.initialize()

// Add documents
await db.add('doc1', 'Vector databases are awesome!', { category: 'tech' })

// Search with semantic similarity
const results = await db.search('vector database', { topK: 5 })
console.log(results)

Advanced Search & Filtering

Remote Function Filtering

One of the most powerful features is the ability to filter results server-side using client-defined functions:

const results = await db.search('cloud computing', {
  filter: metadata => metadata.category === 'tech' && metadata.priority > 5,
  threshold: 0.7, // Strict similarity matching
})

Collection-Style API

Use insert and query for a more traditional database feel:

await db.insert('my-collection', [
  { text: 'Hello World', metadata: { author: 'Alice' } },
  { text: 'Goodbye World', metadata: { author: 'Bob' } },
])

const bobDocs = await db.query('my-collection', 'farewell', {
  filter: m => m.author === 'Bob',
})

⚙️ Configuration

Server Options

| Option | Description | Default | | :---------------- | :------------------------------------- | :--------- | | port | Server listening port | 3001 | | host | Server host address | 0.0.0.0 | | apiKey | Optional key for client authentication | null | | cors | Allowed origins (array) | [] (All) | | streamChunkSize | Max results per chunk for streaming | 500 |

Client Options

| Option | Description | Default | | :--------------- | :--------------------------- | :----------- | | serverUrl | URL of the VectoriaDB server | Required | | apiKey | Authentication key | null | | requestTimeout | API request timeout in ms | 30000 |


Large Datasets & Streaming

The SDK automatically handles large result sets by chunking data on the server and assembling it on the client. This prevents memory issues and payload limits when retrieving thousands of vectors.

  • Automatic assembly: You don't need to worry about chunks; the Promise resolves only when all data has arrived.
  • Configurable limits: Set streamChunkSize on the server to tune the chunking behavior.

Connection Resilience

Built for real-world networks, the client includes:

  • Offline Queueing: Requests made while the connection is down are queued and sent automatically upon reconnection.
  • Heartbeat & Health Checks: Monitors connection status to ensure reliable delivery.
  • Configurable Timeouts: Each request can have its own timeout, or use a global default.

Security Note

[!WARNING] Filter functions passed from the client are serialized and evaluated on the server using new Function(). Never expose the server to untrusted clients without strict network controls or additional sandboxing.


Docker Integration

When deploying with Docker, ensure you persist the database state:

services:
  vectoriadb-server:
    image: node:18
    # ... other config
    volumes:
      - vectoria-data:/app/server/.cache/vectoriadb

volumes:
  vectoria-data:

Best Practices

  • Intended use: Not recommended for large production systems — best suited for prototypes, demos, and hobby projects where quick setup matters.
  • Batching: Use addMany instead of repeated add calls for efficiency.
  • Timeouts: Adjust requestTimeout for large-scale operations.
  • Shutdown: Always call db.close() on the client and server.close() on the server for graceful termination.

FAQ

Q: Do I need vectoriadb on the client?
A: No! The client only needs socket.io-client. It's designed to be used in browsers or lightweight Node environments.

Q: How does the server-side filtering work?
A: The client SDK stringifies your filter function. The server then reconstructs it using new Function(). This is why the filter must be self-contained and not rely on variables outside its scope.


Credits

This SDK builds on and integrates with VectoriaDB. See the Vectoria product website at https://agentfront.dev/vectoria for more information and additional resources.


License

MIT © 2026 VectoriaDB SDK Authors