Documentation
¶
Index ¶
- func DefaultNativeRetriever(opts ...Option) (core.Retriever, error)
- func DefaultRetriever(opts ...Option) (core.Retriever, error)
- func NewRetriever(vectorStore core.VectorStore, embedder embedding.Provider, llm chat.Client, ...) core.Retriever
- type Option
- func WithCache(cache core.SemanticCache) Option
- func WithContextPrune(pruner core.ResultEnhancer) Option
- func WithDocStore(s core.DocStore) Option
- func WithEmbedder(e embedding.Provider) Option
- func WithFusion(count int) Option
- func WithHyDE() Option
- func WithLLM(l chat.Client) Option
- func WithLogger(l logging.Logger) Option
- func WithName(name string) Option
- func WithParentDoc(expander core.ResultEnhancer) Option
- func WithQueryRewrite() Option
- func WithRerank() Option
- func WithSentenceWindow(expander core.ResultEnhancer) Option
- func WithStepBack() Option
- func WithTopK(k int) Option
- func WithTracer(t observability.Tracer) Option
- func WithVectorStore(s core.VectorStore) Option
- func WithWorkDir(dir string) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultNativeRetriever ¶ added in v1.1.3
DefaultNativeRetriever creates an out-of-the-box Native Retriever.
func DefaultRetriever ¶ added in v1.1.3
DefaultRetriever is an alias for DefaultNativeRetriever.
func NewRetriever ¶
func NewRetriever( vectorStore core.VectorStore, embedder embedding.Provider, llm chat.Client, topK int, opts ...Option, ) core.Retriever
NewRetriever creates a Native Retriever with options. Pipeline is automatically assembled in three phases: Pre-Retrieval → Retrieval → Post-Retrieval Users don't need to know the order - Retriever handles it internally.
Types ¶
type Option ¶ added in v1.1.3
type Option func(*Options)
func WithCache ¶ added in v1.1.6
func WithCache(cache core.SemanticCache) Option
Cache (works across all phases)
func WithContextPrune ¶ added in v1.1.6
func WithContextPrune(pruner core.ResultEnhancer) Option
func WithDocStore ¶ added in v1.1.3
func WithEmbedder ¶ added in v1.1.3
func WithFusion ¶ added in v1.1.6
func WithLogger ¶ added in v1.1.3
func WithParentDoc ¶ added in v1.1.6
func WithParentDoc(expander core.ResultEnhancer) Option
Post-Retrieval enhancements
func WithRerank ¶ added in v1.1.6
func WithRerank() Option
func WithSentenceWindow ¶ added in v1.1.6
func WithSentenceWindow(expander core.ResultEnhancer) Option
func WithStepBack ¶ added in v1.1.6
func WithStepBack() Option
func WithTracer ¶ added in v1.1.3
func WithTracer(t observability.Tracer) Option
func WithVectorStore ¶ added in v1.1.3
func WithVectorStore(s core.VectorStore) Option
func WithWorkDir ¶ added in v1.1.3
type Options ¶
type Options struct {
Name string
Logger logging.Logger
Tracer observability.Tracer
Embedder embedding.Provider
LLM chat.Client
TopK int
WorkDir string
VectorStore core.VectorStore
DocStore core.DocStore
// Pre-Retrieval enhancements (can be combined)
EnableQueryRewrite bool
EnableStepBack bool
EnableHyDE bool
EnableFusion bool // Fusion: Pre-Retrieval (Decompose) + Post-Retrieval (RRF)
FusionCount int
// Post-Retrieval enhancements (can be combined)
EnableParentDoc bool
ParentDocExpander core.ResultEnhancer // Required for ParentDoc
EnableSentenceWindow bool
SentenceExpander core.ResultEnhancer // Required for SentenceWindow
EnablePrune bool
ContextPruner core.ResultEnhancer // Required for Prune
EnableRerank bool
// Cache (works across all phases)
EnableCache bool
SemanticCache core.SemanticCache // Required for caching
}
Options for native retriever - users can combine freely
Click to show internal directories.
Click to hide internal directories.