pgvector-dotnet  by pgvector

Vector database integration for .NET applications

Created 2 years ago
259 stars

Top 97.9% on SourcePulse

GitHubView on GitHub
Project Summary

<2-3 sentences summarising what the project addresses and solves, the target audience, and the benefit.> This library provides .NET developers with seamless integration for PostgreSQL's pgvector extension, enabling efficient storage and querying of high-dimensional vector embeddings. It targets C#, F#, and Visual Basic developers working with AI/ML applications, offering straightforward vector search capabilities within existing .NET data access layers.

How It Works

The project offers specific packages for Npgsql, Dapper, and Entity Framework Core. It extends these libraries to understand and serialize PostgreSQL's vector data type, allowing standard CRUD operations alongside vector-specific queries like nearest neighbor searches. The library maps .NET vector types (Vector, HalfVector, SparseVector) to their PostgreSQL equivalents.

Quick Start & Requirements

Installation via NuGet: dotnet add package Pgvector (or framework-specific packages). Requires PostgreSQL with the pgvector extension enabled. After installation, create the vector extension in the database (CREATE EXTENSION IF NOT EXISTS vector) and reload PostgreSQL types. Examples are available for various use cases.

Highlighted Details

  • Comprehensive support for Npgsql, Dapper, and Entity Framework Core, including F# integration via Npgsql.FSharp.
  • Handles Vector, HalfVector, and SparseVector types, with examples for AI tasks like embeddings (OpenAI, Cohere), hybrid search (Ollama), and recommendations.
  • Supports multiple distance metrics (L2, Inner Product, Cosine) and approximate nearest neighbor (ANN) indexing methods (HNSW, IVFFlat) for efficient querying.
  • Provides utilities for AI workflows, including topic modeling with ML.NET and horizontal scaling with Citus.

Maintenance & Community

The project encourages community contributions via bug reports, pull requests, and documentation improvements. Development setup involves cloning the repository and running tests. Specific community channels (Discord/Slack) or a public roadmap are not detailed in the provided README.

Licensing & Compatibility

The license type is not explicitly stated in the provided README content. Clarification would be needed for commercial use.

Limitations & Caveats

Entity Framework Core integration has version-specific compatibility: latest versions support .NET 8/9; .NET 6/7 require package version 0.1.2. No other specific limitations, alpha status, or known bugs are mentioned.

Health Check
Last Commit

3 weeks ago

Responsiveness

1 day

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

Explore Similar Projects

Starred by Chang She Chang She(Cofounder of LanceDB), Carol Willing Carol Willing(Core Contributor to CPython, Jupyter), and
11 more.

lancedb by lancedb

0.9%
8k
Embedded retrieval engine for multimodal AI
Created 2 years ago
Updated 2 days ago
Feedback? Help us improve.