Documentation
¶
Overview ¶
Package hybrid provides hybrid retrieval combining vector and graph strategies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Policy ¶
type Policy string
Policy defines how to combine vector and graph retrieval.
const ( // PolicyParallel runs vector and graph retrieval in parallel and merges results. PolicyParallel Policy = "parallel" // PolicyVectorThenGraph runs vector search first, then expands via graph. PolicyVectorThenGraph Policy = "vector_then_graph" // PolicyGraphThenVector runs graph traversal first, then grounds via vector. PolicyGraphThenVector Policy = "graph_then_vector" )
type Retriever ¶
type Retriever struct {
// contains filtered or unexported fields
}
Retriever implements hybrid vector+graph retrieval.
func NewRetriever ¶
func NewRetriever(cfg RetrieverConfig) *Retriever
NewRetriever creates a new hybrid retriever.
type RetrieverConfig ¶
type RetrieverConfig struct {
// Vector is the vector retriever.
Vector retrieve.Retriever
// Graph is the graph retriever.
Graph retrieve.Retriever
// Policy defines how to combine results.
Policy Policy
// Weights for combining scores.
Weights Weights
// Reranker to apply after merging (optional).
Reranker retrieve.Reranker
// DedupByID removes duplicate items by ID.
DedupByID bool
// Observer for tracing and metrics.
Observer retrieve.Observer
}
RetrieverConfig configures the hybrid retriever.
Click to show internal directories.
Click to hide internal directories.