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

js-vector-store-headless

v1.0.0

Published

Headless semantic search API powered by js-vector-store and local Ollama embeddings. Vector + BM25 + Hybrid search with MCP and REST endpoints.

Readme

js-vector-store-headless

Headless semantic search API powered by js-vector-store and local Ollama embeddings.

Zero-dependency vector database with semantic (cosine similarity), keyword (BM25), and hybrid search (RRF). All embeddings generated locally via Ollama — no API keys needed.

Features

  • Semantic search — cosine similarity over Float32, Int8, or Binary quantized vectors
  • Keyword search — BM25 lexical ranking for exact term matching
  • Hybrid search — RRF fusion of semantic + keyword for best accuracy
  • Cross-collection search — search across multiple domains simultaneously
  • Local embeddings — Ollama (embeddinggemma, nomic-embed, etc.) — no cloud required
  • MCP Server — 12 tools for Codex/Claude LLM integration
  • REST API — endpoints for any frontend or service
  • Zero-dep core — js-vector-store itself has zero npm dependencies

Quick Start

Prerequisites

  • Ollama installed and running
  • An embedding model pulled: ollama pull embeddinggemma (or nomic-embed-text, etc.)

Start the API

npm install js-vector-store-headless
npx js-vector-store-headless api

The API will be at http://localhost:3000.

Index documents

curl -X POST http://localhost:3000/collections/docs \
  -H "Content-Type: application/json" \
  -d '{"id":"doc-1","text":"La IA revoluciona la medicina...","metadata":{"category":"salud"}}'

Search

# Semantic search
curl "http://localhost:3000/collections/docs?q=inteligencia%20artificial%20en%20salud&limit=5"

# Keyword search
curl "http://localhost:3000/collections/docs?q=diagnostico%20medico&mode=bm25&limit=5"

# Hybrid search (recommended)
curl "http://localhost:3000/collections/docs?q=machine%20learning%20hospitales&mode=hybrid&limit=5"

MCP Server (for LLMs)

npx js-vector-store-headless mcp

Tools available:

| Tool | Purpose | |------|---------| | vector_collection_create | Create a collection (float32/int8/binary backend) | | vector_collection_list | List all collections | | vector_collection_info | Stats: count, dimension, sample docs | | vector_index_text | Generate embedding via Ollama and index | | vector_index | Index a pre-computed embedding vector | | vector_search | Semantic similarity search | | vector_bm25_add | Add text to BM25 keyword index | | vector_bm25_search | Keyword-only search | | vector_hybrid_search | Vector + BM25 RRF fusion | | vector_cross_search | Search across multiple collections | | vector_remove | Delete a document | | vector_usage_guide | Full usage guide for LLMs |

Architecture

User Query
    |
    v
[Ollama] --generates embedding--> [VectorStore] --cosine sim--> Results
    |                                   ^
    v                                   |
[BM25Index] --keyword score----------> [HybridSearch] --RRF--> Final Ranking

REST API Endpoints

| Method | Endpoint | Description | |--------|----------|-------------| | GET | /health | Status + Ollama model info | | GET | /collections | List collections | | POST | /collections/:name | Index document | | GET | /collections/:name?q=... | Search (vector/bm25/hybrid) | | GET | /collections/:name/:id | Get document | | DELETE | /collections/:name/:id | Delete document |

Configuration

| Env Var | Default | Description | |---------|---------|-------------| | OLLAMA_HOST | http://localhost:11434 | Ollama API URL | | OLLAMA_MODEL | embeddinggemma:latest | Embedding model | | PORT | 3000 | API server port | | DATA_DIR | ./vector-data | Storage directory |

Backend Options

| Backend | Compression | Use Case | |---------|-------------|----------| | float32 | 1x | Best accuracy, small datasets | | int8 | ~4x | Balanced accuracy/size | | binary | ~32x | Maximum compression, large scale |

Integration with Codex/Claude

codex mcp add js-vector-store -- node /path/to/vector-store-server.js

The LLM can then:

  • Create collections on demand
  • Index documents by generating embeddings automatically
  • Search semantically, by keyword, or hybrid
  • Build RAG pipelines with retrieved context

License

MIT