Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CosineSimilarity ¶
CosineSimilarity calculates cosine similarity between two vectors
Types ¶
type EmbeddingClient ¶
type EmbeddingClient struct {
// contains filtered or unexported fields
}
EmbeddingClient handles communication with embedding services
func NewEmbeddingClient ¶
func NewEmbeddingClient(cfg *config.Config) *EmbeddingClient
NewEmbeddingClient creates a new embedding client
func (*EmbeddingClient) GenerateEmbedding ¶
func (c *EmbeddingClient) GenerateEmbedding(text string) ([]float32, error)
GenerateEmbedding generates embeddings for the given text
type EmbeddingRequest ¶
EmbeddingRequest represents a request to generate embeddings
type EmbeddingResponse ¶
type EmbeddingResponse struct {
Data []struct {
Embedding []float32 `json:"embedding"`
} `json:"data"`
}
EmbeddingResponse represents the response from an embedding service
type SemanticEngine ¶
type SemanticEngine struct {
// contains filtered or unexported fields
}
SemanticEngine enhances recall with semantic similarity
func NewSemanticEngine ¶
func NewSemanticEngine( db *storage.DB, memoryService *memory.Service, evidenceService *evidence.Service, cfg *config.Config, logger *zap.Logger, ) *SemanticEngine
NewSemanticEngine creates a new semantic recall engine
func (*SemanticEngine) Close ¶
func (s *SemanticEngine) Close()
Close gracefully shuts down the semantic engine.
func (*SemanticEngine) Recall ¶
func (s *SemanticEngine) Recall(options recall.RecallOptions) ([]recall.RecallResult, error)
Recall implements recall.Recaller using semantic recall when enabled.
func (*SemanticEngine) SemanticRecall ¶
func (s *SemanticEngine) SemanticRecall(options recall.RecallOptions) ([]recall.RecallResult, error)
SemanticRecall performs semantic recall combined with lexical recall