Documentation
¶
Index ¶
- func ExtractTextFromRecord(title, intent string, constraints []string) string
- type Client
- func (c *Client) Dimension() int
- func (c *Client) Generate(text string) ([]float32, error)
- func (c *Client) GenerateDocument(text string) ([]float32, error)
- func (c *Client) GenerateQuery(text string) ([]float32, error)
- func (c *Client) IndexOnComplete() bool
- func (c *Client) IsConfigured() bool
- func (c *Client) SimilarityThreshold() float64
- type RecordEmbedding
- type SearchResult
- type Store
- func (s *Store) Delete(recordID string) error
- func (s *Store) Exists(recordID string) (bool, error)
- func (s *Store) Find(query []float32, topN int) ([]SearchResult, error)
- func (s *Store) ReadAll() ([]RecordEmbedding, error)
- func (s *Store) SetDimension(dim int)
- func (s *Store) Write(embedding RecordEmbedding) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTextFromRecord ¶
ExtractTextFromRecord extracts the text to embed from a provenance record Uses full title, complete intent, and all constraints for rich semantic content
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client generates embeddings via a configured API
func NewClient ¶
func NewClient(cfg config.EmbeddingConfig) (*Client, error)
NewClient creates a new embedding client from configuration
func (*Client) Dimension ¶
Dimension returns the embedding dimension (2048 for both voyage-4-large and voyage-4-lite)
func (*Client) Generate ¶
Generate creates an embedding vector for the given text (backward compatibility)
func (*Client) GenerateDocument ¶
GenerateDocument creates an embedding using 'document' input_type (for indexing)
func (*Client) GenerateQuery ¶
GenerateQuery creates an embedding using 'query' input_type (for searching)
func (*Client) IndexOnComplete ¶
IndexOnComplete returns whether to generate embeddings on complete
func (*Client) IsConfigured ¶
IsConfigured returns true if the client has valid configuration
func (*Client) SimilarityThreshold ¶
SimilarityThreshold returns the configured similarity threshold
type RecordEmbedding ¶
RecordEmbedding stores an embedding vector for a provenance record
type SearchResult ¶
SearchResult represents a similarity search result
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages the local embedding storage at .linespec/embeddings.bin
func (*Store) Find ¶
func (s *Store) Find(query []float32, topN int) ([]SearchResult, error)
Find searches for similar embeddings using brute-force cosine similarity Returns results sorted by similarity (highest first), limited to topN results
func (*Store) ReadAll ¶
func (s *Store) ReadAll() ([]RecordEmbedding, error)
ReadAll reads all embeddings from the store
func (*Store) SetDimension ¶
SetDimension allows overriding the default dimension (for testing)
func (*Store) Write ¶
func (s *Store) Write(embedding RecordEmbedding) error
Write stores an embedding vector for a record