Documentation
¶
Index ¶
- type Client
- type EmbeddingStore
- type HTTPClient
- type Service
- func (s *Service) BackfillMissing(ctx context.Context) (int, error)
- func (s *Service) EmbedQuery(ctx context.Context, taskDescriptor string) ([]float32, error)
- func (s *Service) EmbedRecord(ctx context.Context, rec *schema.MemoryRecord) error
- func (s *Service) Similarity(ctx context.Context, recordID string, query []float32) (float64, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmbeddingStore ¶
type EmbeddingStore interface {
StoreTriggerEmbedding(ctx context.Context, recordID string, embedding []float32, model string) error
GetTriggerEmbedding(ctx context.Context, recordID string) ([]float32, error)
}
EmbeddingStore is the narrow vector-storage interface needed by Service.
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient calls an OpenAI-compatible embeddings endpoint.
func NewHTTPClient ¶
func NewHTTPClient(endpoint, model, apiKey string, dimensions int) *HTTPClient
NewHTTPClient creates a new HTTP embedding client.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service coordinates query-time and write-time embedding operations.
func NewService ¶
func NewService(client Client, store storage.Store, vectorStore EmbeddingStore, model string) *Service
NewService creates a new embedding service.
func (*Service) BackfillMissing ¶
BackfillMissing computes embeddings for existing competence and plan graph records that do not have one.
func (*Service) EmbedQuery ¶
EmbedQuery generates an embedding for the given task descriptor.
func (*Service) EmbedRecord ¶
EmbedRecord generates and persists the trigger embedding for a record when supported.
Click to show internal directories.
Click to hide internal directories.