Documentation
¶
Overview ¶
Package embed provides embedding-based tool retrieval for the skillgraph gateway. It embeds tool descriptions once at boot, rebuilds on config change, and exposes cosine-similarity search with optional two-tier (server → tool) hierarchy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Provider Provider
Endpoint string // e.g. http://localhost:11434 or https://api.openai.com
APIKey string
Model string
Dimension int // 0 = model default; set via EMBED_DIMENSIONS (e.g. 256 for Matryoshka)
}
Config holds embedding configuration, resolved from env vars.
func ResolveConfig ¶
func ResolveConfig() Config
ResolveConfig detects the embedding provider using the same priority chain as the LLM provider in refine/engine.go. Priority: LLM_BASE_URL (Ollama/LiteLLM) > OPENAI_API_KEY
type Embedder ¶
type Embedder struct {
// contains filtered or unexported fields
}
Embedder calls the embedding API and returns a float32 vector.
func NewEmbedder ¶
NewEmbedder creates an Embedder from a resolved Config.
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index is a thread-safe in-memory embedding index over tool descriptions.
type SearchResult ¶
SearchResult is a single match returned by Find.