Documentation
¶
Overview ¶
Package infinispan provides a vector store implementation using Infinispan REST API v3. Requires Infinispan 16.1 or later for vector search support with @Vector annotation.
Index ¶
- type InfinispanClient
- func (c *InfinispanClient) CacheExists(ctx context.Context, cacheName string) (bool, error)
- func (c *InfinispanClient) Close() error
- func (c *InfinispanClient) CreateCache(ctx context.Context, cacheName string, dimension int) error
- func (c *InfinispanClient) DeleteByQuery(ctx context.Context, cacheName, query string) error
- func (c *InfinispanClient) PutEntry(ctx context.Context, cacheName, key string, value map[string]interface{}) error
- func (c *InfinispanClient) RegisterSchema(ctx context.Context, dimension int) error
- func (c *InfinispanClient) Search(ctx context.Context, cacheName, query string, maxResults int) (*SearchResponse, error)
- type InfinispanStore
- func (s *InfinispanStore) DeleteByConversationGroupID(ctx context.Context, conversationGroupID uuid.UUID) error
- func (s *InfinispanStore) IsEnabled() bool
- func (s *InfinispanStore) Name() string
- func (s *InfinispanStore) Search(ctx context.Context, embedding []float32, conversationGroupIDs []uuid.UUID, ...) ([]registryvector.VectorSearchResult, error)
- func (s *InfinispanStore) Upsert(ctx context.Context, entries []registryvector.UpsertRequest) error
- type SearchHit
- type SearchRequest
- type SearchResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InfinispanClient ¶
type InfinispanClient struct {
// contains filtered or unexported fields
}
InfinispanClient handles HTTP communication with Infinispan REST API v3.
func (*InfinispanClient) CacheExists ¶
CacheExists checks if a cache exists using HEAD request.
func (*InfinispanClient) Close ¶
func (c *InfinispanClient) Close() error
Close closes the HTTP client.
func (*InfinispanClient) CreateCache ¶
CreateCache creates a new cache with the given configuration.
func (*InfinispanClient) DeleteByQuery ¶
func (c *InfinispanClient) DeleteByQuery(ctx context.Context, cacheName, query string) error
DeleteByQuery deletes entries matching an Ickle query.
func (*InfinispanClient) PutEntry ¶
func (c *InfinispanClient) PutEntry(ctx context.Context, cacheName, key string, value map[string]interface{}) error
PutEntry inserts or updates an entry in the cache.
func (*InfinispanClient) RegisterSchema ¶
func (c *InfinispanClient) RegisterSchema(ctx context.Context, dimension int) error
RegisterSchema registers a Protobuf schema with Infinispan.
func (*InfinispanClient) Search ¶
func (c *InfinispanClient) Search(ctx context.Context, cacheName, query string, maxResults int) (*SearchResponse, error)
Search executes an Ickle query and returns results.
type InfinispanStore ¶
type InfinispanStore struct {
// contains filtered or unexported fields
}
InfinispanStore implements VectorStore using Infinispan REST API.
func (*InfinispanStore) DeleteByConversationGroupID ¶
func (*InfinispanStore) IsEnabled ¶
func (s *InfinispanStore) IsEnabled() bool
func (*InfinispanStore) Name ¶
func (s *InfinispanStore) Name() string
func (*InfinispanStore) Search ¶
func (s *InfinispanStore) Search(ctx context.Context, embedding []float32, conversationGroupIDs []uuid.UUID, limit int) ([]registryvector.VectorSearchResult, error)
func (*InfinispanStore) Upsert ¶
func (s *InfinispanStore) Upsert(ctx context.Context, entries []registryvector.UpsertRequest) error
type SearchHit ¶
type SearchHit struct {
Hit map[string]interface{} `json:"hit"`
Score interface{} `json:"score()"`
}
SearchHit represents a single search result.
type SearchRequest ¶
type SearchRequest struct {
Query string `json:"query"`
MaxResults int `json:"max_results"`
QueryMode string `json:"query_mode"`
}
SearchRequest represents an Infinispan search request.
type SearchResponse ¶
SearchResponse represents an Infinispan search response.