Documentation
¶
Overview ¶
Package memory provides an in-memory vector store using brute-force cosine similarity. Suitable for testing and development.
Index ¶
- type Store
- func (s *Store) Delete(_ context.Context, ids []string) error
- func (s *Store) DeleteByMetadata(_ context.Context, filter map[string]string) error
- func (*Store) Describe() weave.ComponentInfo
- func (s *Store) Len() int
- func (s *Store) Search(_ context.Context, vector []float32, opts *vectorstore.SearchOptions) ([]vectorstore.SearchResult, error)
- func (s *Store) Upsert(_ context.Context, entries []vectorstore.Entry) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is an in-memory vector store with brute-force cosine similarity search.
func (*Store) DeleteByMetadata ¶
DeleteByMetadata removes entries matching the given metadata filter. An empty filter would match every entry and is ErrInvalidArgument.
func (*Store) Describe ¶
func (*Store) Describe() weave.ComponentInfo
Describe reports the in-memory vector store: cosine similarity, and an exact tenant_id metadata filter that is covered by Weave's own tests.
func (*Store) Search ¶
func (s *Store) Search(_ context.Context, vector []float32, opts *vectorstore.SearchOptions) ([]vectorstore.SearchResult, error)
Search returns the most similar entries of one tenant to the given vector using cosine similarity. An empty TenantKey is ErrTenantRequired.
Click to show internal directories.
Click to hide internal directories.