Table of Contents

What Vector Database Options Does LM-Kit.NET Support?


TL;DR

LM-Kit.NET provides a built-in FileSystemVectorStore that persists embeddings to disk with no external dependencies, and a Qdrant connector for production-grade vector search at scale. Both implement the IVectorStore interface, so you can swap between them without changing your application code. Use the built-in store for development and standalone applications. Use Qdrant for multi-service architectures and large datasets.


Option 1: FileSystemVectorStore (Built-In)

Zero-dependency vector storage that persists to local files:

using LMKit.Data.Storage;

var vectorStore = new FileSystemVectorStore("./vector-data");
Aspect Details
Dependencies None. Ships with LM-Kit.NET.
Storage .ds files on local disk
Performance In-memory cache for opened collections
Persistence Automatic file-based persistence
Best for Development, standalone apps, edge devices, air-gapped environments

Option 2: Qdrant (Enterprise Connector)

Production-grade vector database with gRPC communication:

using LMKit.Data.Connectors.Qdrant;

// Connect to Qdrant
var vectorStore = new QdrantEmbeddingStore("http://localhost:6334");

// Or with authentication
var vectorStore = new QdrantEmbeddingStore(
    new Uri("https://qdrant.example.com:6334"),
    apiKey: "your-api-key"
);
Aspect Details
Dependencies LM-Kit.NET.Data.Connectors NuGet package + Qdrant server
Communication gRPC (high performance)
Authentication API key + optional certificate thumbprint for HTTPS
Similarity metric Cosine distance
Best for Production deployments, large datasets, multi-service architectures, horizontal scaling

The IVectorStore Interface

Both options implement IVectorStore, providing a common API:

using LMKit.Data.Storage;

IVectorStore store = useQdrant
    ? new QdrantEmbeddingStore("http://localhost:6334")
    : new FileSystemVectorStore("./data");

// Same code works with either backend
await store.CreateCollectionAsync("documents", vectorSize: 768);
await store.UpsertAsync("documents", id, vector, metadata);

var results = await store.SearchAsync("documents", queryVector, topK: 10);

Key operations:

Method Purpose
CreateCollectionAsync Create a new vector collection with fixed dimension
UpsertAsync / UpsertBatchAsync Insert or update vectors with metadata
SearchAsync Similarity search with optional metadata filters
RetrieveFromMetadataAsync Retrieve vectors by metadata without similarity search
DeleteFromMetadataAsync Remove vectors matching metadata criteria
DeleteCollectionAsync Drop an entire collection

Using with RagEngine

RagEngine uses IVectorStore internally. You can plug in either backend:

using LMKit.Retrieval;

var ragEngine = new RagEngine(embeddingModel);

// Default: uses FileSystemVectorStore internally
ragEngine.ImportDocument("manual.pdf");

// Or wire up Qdrant for production
ragEngine.VectorStore = new QdrantEmbeddingStore("http://localhost:6334");
ragEngine.ImportDocument("manual.pdf");

Which Should I Use?

Scenario Recommended
Development and prototyping FileSystemVectorStore
Desktop or mobile application FileSystemVectorStore
Edge / air-gapped deployment FileSystemVectorStore
Web service with multiple replicas Qdrant
Large document collections (100K+ chunks) Qdrant
Need for metadata filtering at scale Qdrant
Microservices sharing a vector index Qdrant

Share