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 🙏

© 2025 – Pkg Stats / Ryan Hefner

scintirete

v0.1.2

Published

TypeScript SDK for Scintirete Vector Database

Readme

Scintirete TypeScript SDK

npm version License: MIT

TypeScript/JavaScript SDK for Scintirete Vector Database.

Features

  • 🚀 High Performance: Built on gRPC with HTTP/2 multiplexing and compression
  • 🔒 Type Safe: Full TypeScript support with generated types from protobuf
  • 🌐 Cross Platform: Works on Node.js 18+ (ESM and CommonJS)
  • 📦 Lightweight: Minimal dependencies with tree-shaking support
  • 🔄 Auto Retry: Built-in connection management and error handling
  • 📊 Rich Features: Support for vector operations, text embedding, and metadata

Installation

npm install scintirete
# or
yarn add scintirete
# or
pnpm add scintirete

Quick Start

import { createScintireteClient, Scintirete, DistanceMetric } from 'scintirete';

// Create client
const client = createScintireteClient({
  address: '127.0.0.1:50051',
  password: 'your-password', // Optional
  useTLS: false,
});

const api = new Scintirete(client);

// Create database and collection
await api.createDatabase({ name: 'my_db' });
await api.createCollection({
  dbName: 'my_db',
  collectionName: 'documents',
  metricType: DistanceMetric.COSINE,
});

// Insert vectors with metadata
await api.insertVectors({
  dbName: 'my_db',
  collectionName: 'documents',
  vectors: [
    {
      elements: [0.1, 0.2, 0.3, 0.4],
      metadata: { title: 'Document 1' }
    }
  ]
});

// Search similar vectors
const results = await api.search({
  dbName: 'my_db',
  collectionName: 'documents',
  queryVector: [0.1, 0.2, 0.3, 0.4],
  topK: 10,
  includeVector: true
});

console.log(results.results);

// Clean up
client.close();

Text Embedding

Scintirete supports automatic text embedding:

// Insert text with automatic embedding
await api.embedAndInsert({
  dbName: 'my_db',
  collectionName: 'documents',
  texts: [
    {
      text: 'The quick brown fox jumps over the lazy dog',
      metadata: { source: 'example.txt' }
    }
  ],
  embeddingModel: 'text-embedding-ada-002' // Optional
});

// Search by text
const searchResults = await api.embedAndSearch({
  dbName: 'my_db',
  collectionName: 'documents',
  queryText: 'fox jumping',
  topK: 5
});

Configuration

Client Options

interface ScintireteClientOptions {
  address: string;              // gRPC server address
  password?: string;            // Authentication password
  useTLS?: boolean;             // Enable TLS (default: false)
  defaultDeadlineMs?: number;   // Default timeout (default: 10000)
  enableGzip?: boolean;         // Enable compression (default: false)
  channelOptions?: ChannelOptions; // Advanced gRPC options
}

Distance Metrics

enum DistanceMetric {
  DISTANCE_METRIC_UNSPECIFIED = 0,
  L2 = 1,           // Euclidean distance
  COSINE = 2,       // Cosine similarity
  INNER_PRODUCT = 3 // Inner product
}

HNSW Configuration

interface HnswConfig {
  m?: number;             // Max connections per node (default: 16)
  efConstruction?: number; // Construction search scope (default: 200)
}

API Reference

Database Operations

  • createDatabase(req) - Create a new database
  • dropDatabase(req) - Delete a database
  • listDatabases() - List all databases

Collection Operations

  • createCollection(req) - Create a new collection
  • dropCollection(req) - Delete a collection
  • getCollectionInfo(req) - Get collection metadata
  • listCollections(req) - List collections in a database

Vector Operations

  • insertVectors(req) - Insert vectors (batch supported)
  • deleteVectors(req) - Delete vectors by ID
  • search(req) - Vector similarity search

Text Embedding Operations

  • embedAndInsert(req) - Insert text with auto-embedding
  • embedAndSearch(req) - Search by text with auto-embedding
  • embedText(req) - Convert text to vectors
  • listEmbeddingModels() - Get available embedding models

Persistence Operations

  • save() - Synchronous snapshot save
  • bgSave() - Asynchronous background save

Error Handling

try {
  await api.search({
    dbName: 'nonexistent',
    collectionName: 'test',
    queryVector: [1, 2, 3],
    topK: 5
  });
} catch (error) {
  if (error.code === grpc.status.NOT_FOUND) {
    console.log('Database or collection not found');
  } else {
    console.error('Unexpected error:', error.message);
  }
}

Examples

Check out the examples directory for more usage patterns:

Development

# Clone the repository
git clone https://github.com/Scintirete/scintirete-sdk-typescript.git
cd scintirete-sdk-typescript

# Install dependencies
npm install

# Generate protobuf types
npm run gen

# Build the project
npm run build

# Run tests
npm test

Requirements

  • Node.js 18.0.0 or higher
  • Scintirete server running on accessible host

Related Projects

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support