Skip to content
CAI
Software that uses CAICheck a score

pgvector/pgvector-elixir

61.0

Adequate · 15 November 2026

1.1k

lines of production code

Elixir

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Added Bumblebee pgvector similarity search example

A new example in the bumblebee directory demonstrates how to use Bumblebee for text embedding and similarity search with PostgreSQL. The example configures the EXLA backend and provides a script that loads the 'all-MiniLM-L6-v2' model, generates embeddings for sample text, stores them in a PostgreSQL database using the pgvector extension, and performs a nearest-neighbor search to find similar documents.

examples/bumblebee · high confidence

Added Citus distributed vector search example

A new example script (examples/citus/example.exs) demonstrates how to use pgvector with Citus for distributed vector similarity search. The script covers enabling the necessary extensions, configuring database settings for Citus workers, creating a distributed table, loading data in parallel using binary COPY, creating an HNSW index, and running distributed nearest-neighbor queries.

examples/citus · high confidence

Added Cohere vector embedding example

Added a new example script demonstrating how to use the Cohere API to generate binary embeddings and store them in a PostgreSQL database using the pgvector extension. The example shows how to configure Postgrex with custom types, create a table with a bit vector column, insert embeddings generated via the Cohere embed-v4.0 model, and perform similarity search queries.

examples/cohere · high confidence

Added OpenAI embeddings example with pgvector integration

A new example script (examples/openai/example.exs) demonstrates how to generate text embeddings using the OpenAI text-embedding-3-small model and store them in a PostgreSQL database using the pgvector extension. The script shows the full workflow: creating a vector table, embedding input text via the OpenAI API, inserting the vectors, and performing a similarity search using the cosine distance operator.

examples/openai · high confidence

Added Postgrex extensions for vector, halfvec, and sparsevec types

New Postgrex extension modules have been added to support the \vector\, \halfvec\, and \sparsevec\ database types. These additions enable automatic encoding and decoding of these specific vector formats when interacting with PostgreSQL via Postgrex, allowing users to store and retrieve high-dimensional vectors, half-precision vectors, and sparse vectors seamlessly within their Elixir applications.

lib/pgvector/extensions · high confidence

Added bulk loading example for Pgvector

The examples/loading directory now includes a new example script that demonstrates how to bulk load 100,000 vector embeddings into a PostgreSQL database using the Pgvector extension. The script generates sample data, establishes a connection with custom types, creates the target table, and performs a high-performance binary COPY operation from standard input. It also includes optional configuration for creating HNSW indexes and updating planner statistics after the data load.

examples/loading · high confidence

Added hybrid search example using PostgreSQL and Bumblebee

The examples/hybrid\_search directory now includes a runnable Elixir script demonstrating hybrid search. It combines semantic search via Bumblebee (using the sentence-transformers/multi-qa-MiniLM-L6-cos-v1 model) with keyword search in PostgreSQL (using pgvector and full-text search). The example sets up a documents table, generates embeddings, and performs a combined search using Reciprocal Rank Fusion (RRF) to rank results.

_examples/hybrid\search · high confidence

Added sparse semantic search example using PostgreSQL and Bumblebee

The examples/sparse\_search directory now includes a working demonstration of sparse semantic search. The example configures the EXLA backend for numerical computations and uses the Bumblebee library to load the 'opensearch-neural-sparse-encoding-v1' model and tokenizer. It demonstrates embedding text documents into sparse vectors, storing them in a PostgreSQL database with the pgvector extension, and performing similarity searches to retrieve relevant content based on a query.

_examples/sparse\search · high confidence

Added support for half-precision and sparse vector types

The library now includes new \Pgvector.HalfVector\ and \Pgvector.SparseVector\ modules, enabling users to create, manipulate, and inspect vectors using 16-bit floating-point precision and sparse data structures respectively. These additions allow for more memory-efficient storage and computation when working with half-precision tensors (via Nx) and sparse datasets, expanding the range of vector types supported by the library.

lib/pgvector · high confidence

Adds Ecto integration for pgvector types and distance functions

This change introduces Ecto support for pgvector data types, allowing users to store and query vector data directly within their Ecto schemas. New Ecto types are provided for \:vector\, \:halfvec\, \:sparsevec\, and \:bit\ formats, handling casting, loading, and dumping of these values. Additionally, a new \Pgvector.Ecto.Query\ module exposes macro-based distance functions (L2, cosine, L1, inner product, Hamming, and Jaccard) that can be used in Ecto queries to perform similarity searches against the database.

lib/pgvector/ecto · high confidence

Initial release of Pgvector library with vector type support

This change introduces the core Pgvector library, providing a \Pgvector\ struct to handle vector data types for PostgreSQL. It includes functions to create vectors from lists or Nx tensors, and convert them to binary, lists, or tensors. The library also adds support for \HalfVector\ and \SparseVector\ types, and provides Postgrex extensions for these types via the \Pgvector.extensions/0\ function.

lib · high confidence

Initial release of pgvector-elixir library

This entry marks the first release (v0.1.0) of the pgvector-elixir library, providing Elixir support for the pgvector PostgreSQL extension. The diff establishes the core project structure, including \.formatter.exs\ for code formatting, \.gitignore\ for build artifacts, and a comprehensive \CHANGELOG.md\ and \README.md\. The library introduces support for Ecto and Postgrex, allowing users to store and query vector data types (such as \vector\, \halfvec\, \bit\, and \sparsevec\) in PostgreSQL. It provides Ecto distance functions (e.g., \l2\_distance\, \cosine\_distance\) and Postgrex type extensions for seamless integration with existing Elixir applications.

(repo-wide) · high confidence

Test coverage

Added test suite for Pgvector Elixir integration

Added comprehensive test coverage for the Pgvector library, including unit tests for core data types (Vector, HalfVector, SparseVector) and integration tests for Ecto and Postgrex. The tests verify schema field definitions, distance functions (L2, cosine, L1, Hamming, Jaccard), Nx tensor conversions, and binary copy operations.

test · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 65 → 61 (-4.2)
  • Rubric changed (rubric-2026.11.1 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 97 → 91 (-6.2)
  • Architecture 69 → 69 (+0.0)
  • Maturity 54 → 54 (+0.0)
  • Readiness 67 → 54 (-13.6)
  • Security 100 → 100 (+0.0)

New (6)

  • Edited copies of one member (3 members, 4+ corresponding lines) (lib/pgvector/extensions/halfvec.ex)
  • Edited copies of one member (3 members, 4+ corresponding lines) (lib/pgvector/extensions/halfvec.ex)
  • Edited copy of a member (3 corresponding lines) (lib/pgvector.ex)
  • Edited copy of a member (4 corresponding lines) (lib/pgvector/sparse_vector.ex)
  • Edited copy of a member (6 corresponding lines) (lib/pgvector.ex)
  • Edited copy of a member (7 corresponding lines) (lib/pgvector.ex)

Changes since last survey

  • 1 commits — 1 feature/other, 0 fixes

By area

  • examples/cohere — 1 commit

Notable commits

  • change: Updated Cohere example [skip ci]

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

pgvector/pgvector-elixir was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 15 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 752e95ff405de49133c3a8bddf2d965914a18701 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.73+preprod-52de90b74216.