storage

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QdrantClient

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

QdrantClient provides access to Qdrant vector database

func NewQdrantClient

func NewQdrantClient(config QdrantConfig) (*QdrantClient, error)

NewQdrantClient creates a new Qdrant client

func (*QdrantClient) Close

func (c *QdrantClient) Close() error

Close closes the Qdrant client connection

func (*QdrantClient) CollectionExists

func (c *QdrantClient) CollectionExists(ctx context.Context, name string) (bool, error)

CollectionExists checks if a collection exists in Qdrant

func (*QdrantClient) CreateCollection

func (c *QdrantClient) CreateCollection(ctx context.Context, name string, dimension int) error

CreateCollection creates a new collection

func (*QdrantClient) Delete

func (c *QdrantClient) Delete(ctx context.Context, id string) error

Delete deletes a vector by ID

func (*QdrantClient) DeleteByFilter

func (c *QdrantClient) DeleteByFilter(ctx context.Context, key, value string) error

DeleteByFilter deletes vectors matching a filter

func (*QdrantClient) DeleteCollection

func (c *QdrantClient) DeleteCollection(ctx context.Context, name string) error

DeleteCollection deletes an entire collection (DANGEROUS: removes all points)

func (*QdrantClient) GetCollectionPointCount

func (c *QdrantClient) GetCollectionPointCount(ctx context.Context, name string) (uint64, error)

GetCollectionPointCount returns the number of points (documents) in a collection

func (*QdrantClient) Search

func (c *QdrantClient) Search(ctx context.Context, vector []float64, limit int) ([]SearchResult, error)

Search searches for similar vectors

func (*QdrantClient) Upsert

func (c *QdrantClient) Upsert(ctx context.Context, id string, vector []float64, payload map[string]interface{}) error

Upsert inserts or updates vectors

type QdrantConfig

type QdrantConfig struct {
	URL        string
	APIKey     string
	Collection string
}

QdrantConfig contains Qdrant-specific configuration

type QdrantLongTermMemory

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

QdrantLongTermMemory implements memory.LongTermMemory using Qdrant

func NewQdrantLongTermMemory

func NewQdrantLongTermMemory(client *QdrantClient) *QdrantLongTermMemory

NewQdrantLongTermMemory creates a new Qdrant-backed long-term memory

func (*QdrantLongTermMemory) Clear

func (m *QdrantLongTermMemory) Clear(ctx context.Context) error

Clear clears all documents (not implemented for safety - use with caution)

func (*QdrantLongTermMemory) CollectionExists

func (m *QdrantLongTermMemory) CollectionExists(ctx context.Context, collectionName string) (bool, error)

CollectionExists checks if the collection exists

func (*QdrantLongTermMemory) Delete

func (m *QdrantLongTermMemory) Delete(ctx context.Context, id string) error

Delete deletes a document by ID

func (*QdrantLongTermMemory) DeleteByMetadata

func (m *QdrantLongTermMemory) DeleteByMetadata(ctx context.Context, key, value string) error

DeleteByMetadata deletes documents matching a metadata key-value pair

func (*QdrantLongTermMemory) GetCollectionPointCount

func (m *QdrantLongTermMemory) GetCollectionPointCount(ctx context.Context, collectionName string) (uint64, error)

GetCollectionPointCount returns the number of points (documents) in a collection

func (*QdrantLongTermMemory) Search

func (m *QdrantLongTermMemory) Search(ctx context.Context, query []float64, limit int) ([]memory.Document, error)

Search searches for similar documents

func (*QdrantLongTermMemory) Store

Store stores a document with its embedding

type SearchResult

type SearchResult struct {
	ID      string
	Score   float64
	Payload map[string]interface{}
}

SearchResult represents a search result

Jump to

Keyboard shortcuts

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