Documentation
¶
Overview ¶
Package qdrant implements the memory.Store interface using Qdrant vector database.
Index ¶
- type Config
- type Store
- func (s *Store) Close() error
- func (s *Store) Delete(ctx context.Context, ids []string) (int, error)
- func (s *Store) DeleteExpired(ctx context.Context) (int, error)
- func (s *Store) EnsureCollection(ctx context.Context) error
- func (s *Store) Insert(ctx context.Context, mem *memory.Memory, vector []float32) error
- func (s *Store) Scroll(ctx context.Context, opts memory.ScrollOptions) ([]memory.Memory, string, error)
- func (s *Store) Search(ctx context.Context, vector []float32, opts memory.SearchOptions) ([]memory.ScoredMemory, error)
- func (s *Store) SearchByIDs(ctx context.Context, ids []string) ([]memory.Memory, error)
- func (s *Store) Stats(ctx context.Context) (*memory.CollectionStats, error)
- func (s *Store) Update(ctx context.Context, id string, fields map[string]any) error
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 ¶
New creates a new Qdrant-backed Store. The caller must call EnsureCollection before performing any read/write operations.
func (*Store) Delete ¶
Delete removes memories by IDs. Returns the number of successfully deleted items.
func (*Store) DeleteExpired ¶
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 ¶
EnsureCollection creates the collection if it doesn't exist, and idempotently creates all payload indexes (safe to call on existing collections).
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 ¶
SearchByIDs retrieves specific memories by their IDs.