pgvector

Active
GitHub C NOASSERTION

Description

Open-source vector similarity search extension for PostgreSQL, enabling native vector storage and ANN retrieval in relational databases, a foundational component for building agent memory and RAG systems.

Key Features

  • PostgreSQL native extension — Store and query vectors directly in relational database, no extra infrastructure
  • Multiple distance metrics — L2, cosine distance, inner product, L1, Hamming, and Jaccard distance
  • Exact and approximate search — HNSW and IVFFlat indexes for ANN approximate nearest neighbor search
  • Multiple vector types — Single-precision, half-precision, binary, and sparse vectors
  • ACID compliant — PostgreSQL transactions, point-in-time recovery, and JOIN capabilities
  • Quantization scaling — Vector quantization for large-scale datasets

Use Cases

💡 Build persistent memory storage systems for AI agents
💡 Implement vector similarity retrieval in RAG pipelines
💡 Add semantic search capabilities to existing PostgreSQL databases
💡 Build embedding storage and retrieval systems for multimodal content

Strengths & Limitations

Strengths

  • Actively maintained, recent updates
  • High community interest (22.6k stars)
  • Established track record (5 years in production)
  • Responsive to issues, low backlog

⚠️ Limitations

  • No clear open-source license

Quick Start

CREATE EXTENSION vector;
CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3));
INSERT INTO items (embedding) VALUES ('[1,2,3]'), ('[4,5,6]');
SELECT * FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5;

Related Projects

LanceDB

11.2k · Rust
Active A

An open-source embedded retrieval library for multimodal AI with zero server configuration, using the Lance columnar format for efficient vector search and filtering, ideal for agent memory and RAG applications.

vector-databaseembeddingsretrieval +2
  • · Millisecond vector search with state-of-the-art indexing for billions of vectors
  • · Comprehensive search: vector similarity, full-text search, and SQL queries in one platform
  • · Multimodal support — store and query text, images, videos, point clouds, and more

Qdrant

34.0k · Rust
Active A

Qdrant is a high-performance, massive-scale vector database and vector search engine written in Rust, built for the next generation of AI applications.

vector-databaseragsimilarity-search +2
  • · High-performance ANN — HNSW and scalar quantization for millisecond vector search at scale
  • · Rich filtering — payload filters, geo queries and hybrid sparse-dense retrieval
  • · Multimodal & multi-vector — sparse vectors, named vectors and recommendation-style multi-vector recall

HelixDB

5.7k · Rust
Active A+

An open-source graph-vector database built from scratch in Rust, combining graph database and vector retrieval capabilities to provide AI agents with unified storage for both knowledge graphs and semantic search.

graph-databasevector-databaserag +2
  • · Graph-vector database combining graph traversal and vector similarity search in one system
  • · Rust-based engine for high performance with low resource consumption
  • · TypeScript and Rust SDKs with declarative query DSL for building queries

Embedchain

63.4k · Python
Active A+

Embedchain is a universal memory layer for AI agents, enabling quick integration of diverse data sources into LLMs for context-aware AI applications.

memoryragembeddings +2
  • · Universal memory layer — quickly integrates diverse data sources (web, PDFs, YouTube, Notion) into LLMs for context
  • · Vectorized storage — auto-chunks, embeds, and stores data in vector databases with semantic retrieval support
  • · Multi-LLM backend support — compatible with OpenAI, Cohere, Ollama and other LLM and embedding models