store

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilEmbedder          = errors.New("embedder cannot be nil")
	ErrEmptyCollection      = errors.New("qdrant collection name cannot be empty")
	ErrEmptyVectorSize      = errors.New("vector size must be greater than zero")
	ErrEmptyQdrantURL       = errors.New("qdrant URL cannot be empty")
	ErrEmptyEmbeddingVector = errors.New("embedder returned an empty vector")
)

Functions

func NewQdrant

func NewQdrant(
	rawURL, apiKey, collection string,
	embedder embeddings.Embedder,
) (vectorstores.VectorStore, error)

NewQdrant creates a ready-to-use Qdrant vector store.

func ProbeEmbeddingSize

func ProbeEmbeddingSize(ctx context.Context, embedder embeddings.Embedder, chunks []models.KnowledgeChunk) (int, error)

ProbeEmbeddingSize returns the vector dimension produced by the embedder, using the first non-empty chunk content as the sample text.

Types

type BootstrapResult

type BootstrapResult struct {
	PointsCount int
	ShouldIndex bool
}

BootstrapResult holds the outcome of preparing a Qdrant collection.

func PrepareCollection

func PrepareCollection(
	ctx context.Context,
	rawURL, apiKey, collection string,
	vectorSize int,
	reIndexOnBoot bool,
) (BootstrapResult, error)

PrepareCollection ensures the Qdrant collection exists and is ready for indexing. If reIndexOnBoot is true, any existing collection is deleted and recreated.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL