pg_embedding  by neondatabase-labs

Postgres extension for vector similarity search

created 2 years ago
572 stars

Top 57.2% on sourcepulse

GitHubView on GitHub
Project Summary

This PostgreSQL extension provides Hierarchical Navigable Small World (HNSW) indexing for efficient vector similarity search. It's designed for developers and data scientists working with high-dimensional vector data within PostgreSQL, enabling fast nearest neighbor searches for applications like recommendation systems and semantic search.

How It Works

The extension implements the HNSW algorithm, a graph-based approach for approximate nearest neighbor search. It constructs a multi-layered graph where each layer is a subset of the previous one. Searches start at the top layer and navigate downwards, efficiently converging on the most similar vectors. This method offers a strong balance between search speed and accuracy, outperforming brute-force methods.

Quick Start & Requirements

  • Install via CREATE EXTENSION embedding; within a PostgreSQL database.
  • Requires PostgreSQL.
  • Supports Euclidean (L2), Cosine, and Manhattan distance metrics.
  • Index creation requires specifying dims, m, efconstruction, and efsearch parameters.
  • See official Neon documentation for detailed usage and migration: Neon Documentation

Highlighted Details

  • Implements HNSW based on the ivf-hnsw library.
  • Supports Euclidean, Cosine, and Manhattan distance metrics.
  • Allows tuning of HNSW parameters (m, efconstruction, efsearch) for performance trade-offs.
  • Enables creating HNSW indexes on vector columns for accelerated similarity searches.

Maintenance & Community

Neon is no longer committing to pg_embedding as of September 29, 2023. Support is maintained for existing users, with a strong recommendation to migrate to pgvector. Migration instructions are available in the Neon documentation.

Licensing & Compatibility

The extension's license is not explicitly stated in the README. Compatibility with commercial or closed-source applications should be verified.

Limitations & Caveats

Neon has ceased active development and recommends migration to pgvector. While existing users will be supported, new development and feature enhancements are unlikely.

Health Check
Last commit

1 year ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
3 stars in the last 90 days

Explore Similar Projects

Starred by Jared Palmer Jared Palmer(Ex-VP of AI at Vercel; Founder of Turborepo; Author of Formik, TSDX).

pgvector-node by pgvector

0.8%
399
Node.js library for pgvector support
created 4 years ago
updated 2 weeks ago
Feedback? Help us improve.