Skip to content

v0.15.0 — Vector Store Plugins & pgvector

Choose a tag to compare

@quinnjr quinnjr released this 04 Mar 20:54
· 6 commits to develop since this release
b39a4b8

Vector Store Plugins & pgvector

This release makes the VectorStore trait available to external plugin crates and ships the first vector store plugin: pgvector.

New Crate: daimon-plugin-pgvector

A pgvector-backed VectorStore for PostgreSQL RAG workloads.

  • PgVectorStore — implements VectorStore (upsert, query, delete, count) using tokio-postgres with deadpool-postgres connection pooling
  • Distance metrics — Cosine (<=>), L2 (<->), Inner Product (<#>) with matching HNSW operator classes
  • HNSW indexing — configurable m and ef_construction parameters
  • Auto-migration — creates the vector extension, table, and HNSW index on first use (opt-out via builder)
  • Manual SQLmigrations module exports CREATE_EXTENSION, create_table_sql(), create_hnsw_index_sql() for DIY schema management
  • Builder patternPgVectorStoreBuilder::new(conn_str, dimensions) with .table(), .distance_metric(), .pool_size(), .hnsw_m(), .hnsw_ef_construction(), .auto_migrate()

Architecture: VectorStore in daimon-core

Document, ScoredDocument, VectorStore, ErasedVectorStore, and SharedVectorStore have been moved from the main daimon crate to daimon-core. This follows the same pattern as the TaskBroker refactor in v0.13.0, enabling plugin crates to implement VectorStore by depending only on the lightweight daimon-core. The main daimon crate re-exports everything — no breaking changes for existing users.

Quick Start

[dependencies]
daimon = { version = "0.15", features = ["pgvector", "openai"] }
use daimon::prelude::*;

let store = PgVectorStoreBuilder::new("postgresql://user:pass@localhost/db", 1536)
    .table("my_docs")
    .distance_metric(DistanceMetric::Cosine)
    .build()
    .await?;

let kb = SimpleKnowledgeBase::new(embedding_model, store);
kb.ingest(vec![Document::new("relevant text")]).await?;
let results = kb.search("query", 5).await?;

Full Changelog: v0.14.0...v0.15.0