qdrant

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package qdrant implements the memory.Store interface using Qdrant vector database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// URL is the Qdrant gRPC address in "host:port" format (default "localhost:6334").
	URL string
	// APIKey for Qdrant Cloud or authenticated deployments. Empty means no auth.
	APIKey string
	// CollectionName is the Qdrant collection to use (default "engram").
	CollectionName string
	// Dimension is the embedding vector size (default 1536).
	Dimension uint64
}

Config holds connection and collection settings for the Qdrant store.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements memory.Store backed by Qdrant via gRPC. It is safe for concurrent use.

func New

func New(cfg Config) (*Store, error)

New creates a new Qdrant-backed Store. The caller must call EnsureCollection before performing any read/write operations.

func (*Store) Close

func (s *Store) Close() error

Close closes the underlying gRPC connection.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, ids []string) (int, error)

Delete removes memories by IDs. Returns the number of successfully deleted items.

func (*Store) DeleteExpired

func (s *Store) DeleteExpired(ctx context.Context) (int, error)

DeleteExpired removes all memories whose valid_until > 0 AND valid_until < now. This is the physical cleanup counterpart to the soft-filter applied in Search/Scroll. Returns the number of deleted points (always == points matched, since Qdrant delete is idempotent and does not report per-point success).

func (*Store) EnsureCollection

func (s *Store) EnsureCollection(ctx context.Context) error

EnsureCollection creates the collection if it doesn't exist, and idempotently creates all payload indexes (safe to call on existing collections).

func (*Store) Insert

func (s *Store) Insert(ctx context.Context, mem *memory.Memory, vector []float32) error

Insert stores a memory with its embedding vector.

func (*Store) Scroll

func (s *Store) Scroll(ctx context.Context, opts memory.ScrollOptions) ([]memory.Memory, string, error)

Scroll returns memories matching filters without requiring a query vector.

func (*Store) Search

func (s *Store) Search(ctx context.Context, vector []float32, opts memory.SearchOptions) ([]memory.ScoredMemory, error)

Search returns scored memories matching the query vector. Results are ordered by raw cosine similarity (descending). Expired (valid_until > 0 && valid_until < now) and superseded memories are always excluded.

func (*Store) SearchByIDs

func (s *Store) SearchByIDs(ctx context.Context, ids []string) ([]memory.Memory, error)

SearchByIDs retrieves specific memories by their IDs.

func (*Store) Stats

func (s *Store) Stats(ctx context.Context) (*memory.CollectionStats, error)

Stats returns collection statistics.

func (*Store) Update

func (s *Store) Update(ctx context.Context, id string, fields map[string]any) error

Update modifies payload fields of an existing memory without re-embedding.

Jump to

Keyboard shortcuts

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