FluxIndex.Storage.PostgreSQL 0.2.9

dotnet add package FluxIndex.Storage.PostgreSQL --version 0.2.9
                    
NuGet\Install-Package FluxIndex.Storage.PostgreSQL -Version 0.2.9
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FluxIndex.Storage.PostgreSQL" Version="0.2.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FluxIndex.Storage.PostgreSQL" Version="0.2.9" />
                    
Directory.Packages.props
<PackageReference Include="FluxIndex.Storage.PostgreSQL" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FluxIndex.Storage.PostgreSQL --version 0.2.9
                    
#r "nuget: FluxIndex.Storage.PostgreSQL, 0.2.9"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FluxIndex.Storage.PostgreSQL@0.2.9
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FluxIndex.Storage.PostgreSQL&version=0.2.9
                    
Install as a Cake Addin
#tool nuget:?package=FluxIndex.Storage.PostgreSQL&version=0.2.9
                    
Install as a Cake Tool

FluxIndex

CI/CD NuGet License

A .NET library for building RAG (Retrieval-Augmented Generation) systems with vector search and hybrid search capabilities.

Overview

FluxIndex is a RAG infrastructure library that provides document indexing and retrieval functionality for .NET 9.0 applications. It combines vector search with keyword search to enable semantic and exact-match retrieval.

Features

  • Vector Search: Semantic similarity search using embeddings
  • Keyword Search: BM25-based exact term matching
  • Hybrid Search: Combines vector and keyword search with Reciprocal Rank Fusion (RRF)
  • Multiple Storage Backends: SQLite (with sqlite-vec), PostgreSQL (with pgvector)
  • AI Provider Agnostic: Use OpenAI, Azure OpenAI, or custom embedding services
  • Document Processing: Integrate with FileFlux for PDF/DOCX/TXT processing
  • Web Content: Integrate with WebFlux for web page crawling and extraction
  • Caching: In-memory or Redis-based caching for performance
  • Clean Architecture: Modular design with dependency injection

Installation

Required Packages

# Core SDK
dotnet add package FluxIndex.SDK

# Storage provider (choose one)
dotnet add package FluxIndex.Storage.SQLite      # For development
dotnet add package FluxIndex.Storage.PostgreSQL  # For production

Optional Packages

# AI provider integration (or implement custom IEmbeddingService)
dotnet add package FluxIndex.AI.OpenAI

# Caching
dotnet add package FluxIndex.Cache.Redis

# Document processing extensions
dotnet add package FluxIndex.Extensions.FileFlux
dotnet add package FluxIndex.Extensions.WebFlux

Quick Start

Basic Setup

using FluxIndex.SDK;
using Microsoft.Extensions.DependencyInjection;

var services = new ServiceCollection();

// Configure FluxIndex
services.AddFluxIndex()
    .AddSQLiteVectorStore()              // Storage
    .UseOpenAIEmbedding(apiKey: "...");  // AI service (optional)

var serviceProvider = services.BuildServiceProvider();
var client = serviceProvider.GetRequiredService<FluxIndexClient>();

Indexing Documents

// Index a text document
await client.Indexer.IndexDocumentAsync(
    content: "FluxIndex is a .NET RAG library for building retrieval systems.",
    documentId: "doc-001"
);

// Index with metadata
await client.Indexer.IndexDocumentAsync(
    content: "Document content...",
    documentId: "doc-002",
    metadata: new Dictionary<string, object>
    {
        ["category"] = "technical",
        ["author"] = "John Doe"
    }
);

Searching

// Semantic search
var results = await client.Retriever.SearchAsync(
    query: "RAG library",
    topK: 5
);

foreach (var result in results)
{
    Console.WriteLine($"Score: {result.Score:F2}");
    Console.WriteLine($"Content: {result.Content}");
}
var results = await client.Retriever.SearchAsync(
    query: "machine learning algorithms",
    topK: 10,
    options: new SearchOptions
    {
        SearchStrategy = SearchStrategy.Hybrid,
        VectorWeight = 0.7f,
        KeywordWeight = 0.3f
    }
);

Document Processing

FileFlux Integration

dotnet add package FluxIndex.Extensions.FileFlux
using FluxIndex.Extensions.FileFlux;

// Configure FileFlux
services.AddFluxIndex()
    .AddSQLiteVectorStore()
    .UseOpenAIEmbedding(apiKey);

services.AddFileFluxIntegration(options =>
{
    options.DefaultChunkingStrategy = "Auto";
    options.DefaultMaxChunkSize = 1024;
    options.DefaultOverlapSize = 128;
});

var serviceProvider = services.BuildServiceProvider();
var fileFlux = serviceProvider.GetRequiredService<FileFluxIntegration>();

// Process and index files
var documentId = await fileFlux.ProcessAndIndexAsync("document.pdf");

WebFlux Integration

dotnet add package FluxIndex.Extensions.WebFlux
using FluxIndex.Extensions.WebFlux;

services.AddWebFluxIntegration(options =>
{
    options.DefaultMaxChunkSize = 512;
    options.DefaultChunkOverlap = 50;
});

Architecture

FluxIndex follows Clean Architecture principles with the following structure:

FluxIndex.Core          # Domain models and application interfaces
FluxIndex.SDK           # Client API and builder
FluxIndex.AI.*          # AI service adapters (OpenAI, etc.)
FluxIndex.Storage.*     # Storage implementations (SQLite, PostgreSQL)
FluxIndex.Cache.*       # Caching implementations (Redis, Memory)
FluxIndex.Extensions.*  # Document processing integrations

Dependency Injection

All components are registered through dependency injection and can be replaced with custom implementations:

services.AddScoped<IEmbeddingService, CustomEmbeddingService>();
services.AddScoped<IVectorStore, CustomVectorStore>();
services.AddScoped<ICacheService, CustomCacheService>();

Configuration

Using OpenAI

var client = new FluxIndexClientBuilder()
    .UseOpenAI("your-api-key", "text-embedding-3-small")
    .UseSQLite("fluxindex.db")
    .UseMemoryCache()
    .Build();

Using Azure OpenAI

var client = new FluxIndexClientBuilder()
    .UseAzureOpenAI(
        endpoint: "https://your-resource.openai.azure.com/",
        apiKey: "your-api-key",
        deploymentName: "text-embedding-ada-002"
    )
    .UseSQLite("fluxindex.db")
    .Build();

Using PostgreSQL

var client = new FluxIndexClientBuilder()
    .UseOpenAI("your-api-key")
    .UsePostgreSQL("Host=localhost;Database=fluxindex;Username=user;Password=pass")
    .UseRedisCache("localhost:6379")
    .Build();

Search Strategies

FluxIndex provides multiple search strategies:

  • Vector Search: Semantic similarity using HNSW indexing
  • Keyword Search: BM25 algorithm for exact term matching
  • Hybrid Search: Combines vector and keyword results using RRF
  • Adaptive Search: Automatically selects strategy based on query complexity

Documentation

Examples

See the samples directory for complete working examples:

Requirements

  • .NET 9.0 SDK or later
  • SQLite or PostgreSQL database
  • OpenAI API key (optional, for AI-powered embeddings)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please see the development roadmap for planned features and current status.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.9 29 10/12/2025
0.2.8 146 10/2/2025
0.2.7 148 9/29/2025
0.2.5 125 9/26/2025
0.2.4 149 9/25/2025
0.2.3 150 9/23/2025
0.2.2 156 9/22/2025
0.1.4 231 9/15/2025
0.1.3 225 9/15/2025
0.1.2 229 9/15/2025