Documentation
¶
Index ¶
- func GetAbsolutePaths(basePath string, docPaths []string) []string
- func NewManagers(ctx context.Context, cfg *latest.Config, buildCfg ManagersBuildConfig) (map[string]*Manager, error)
- type Config
- type FusionConfig
- type Manager
- func (m *Manager) CheckAndReindexChangedFiles(ctx context.Context) error
- func (m *Manager) Close() error
- func (m *Manager) Description() string
- func (m *Manager) Events() <-chan types.Event
- func (m *Manager) Initialize(ctx context.Context) error
- func (m *Manager) Name() string
- func (m *Manager) Query(ctx context.Context, query string) ([]database.SearchResult, error)
- func (m *Manager) StartFileWatcher(ctx context.Context) error
- func (m *Manager) ToolInstruction() string
- func (m *Manager) ToolName() string
- type ManagersBuildConfig
- type RerankingConfig
- type ResultsConfig
- type ToolConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAbsolutePaths ¶
GetAbsolutePaths converts doc paths to absolute paths
func NewManagers ¶
func NewManagers( ctx context.Context, cfg *latest.Config, buildCfg ManagersBuildConfig, ) (map[string]*Manager, error)
NewManagers constructs all RAG managers defined in the config.
Types ¶
type Config ¶
type Config struct {
Tool ToolConfig
Docs []string
Results ResultsConfig
FusionConfig *FusionConfig
StrategyConfigs []strategy.Config
}
Config represents RAG manager configuration in domain terms, independent of any particular config schema version.
type FusionConfig ¶
type FusionConfig struct {
Strategy string // "rrf", "weighted", "max"
K int // RRF parameter
Weights map[string]float64 // Strategy weights
}
FusionConfig holds configuration for result fusion
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager orchestrates RAG operations using pluggable strategies Supports both single-strategy and hybrid multi-strategy retrieval with fusion
func New ¶
func New(_ context.Context, name string, config Config, strategyEvents <-chan types.Event) (*Manager, error)
New creates a new RAG manager with one or more strategies. Pass multiple strategy configs to enable hybrid retrieval. The strategyEvents channel should be shared across all strategies for this manager.
func (*Manager) CheckAndReindexChangedFiles ¶
CheckAndReindexChangedFiles checks for file changes and re-indexes if needed
func (*Manager) Description ¶
Description returns the RAG source description
func (*Manager) Events ¶
Events returns the event channel shared by all strategies and RAG operations for this manager.
func (*Manager) Initialize ¶
Initialize indexes all documents using all configured strategies Each strategy indexes its own document set (shared + strategy-specific) Strategies are initialized in parallel for better performance
func (*Manager) Query ¶
Query searches for relevant documents using all configured strategies If multiple strategies are configured, results are combined using the fusion strategy
func (*Manager) StartFileWatcher ¶
StartFileWatcher starts monitoring files and directories for changes
func (*Manager) ToolInstruction ¶ added in v1.9.26
ToolInstruction returns the tool instruction for this RAG source
type ManagersBuildConfig ¶
type ManagersBuildConfig struct {
ParentDir string
ModelsGateway string
Env environment.Provider
Models map[string]latest.ModelConfig // Model configurations from config
}
ManagersBuildConfig contains dependencies needed to build RAG managers from config.
type RerankingConfig ¶ added in v1.9.22
type RerankingConfig struct {
Reranker rerank.Reranker // The reranker instance (already configured)
TopK int // Optional: only rerank top K results (0 = rerank all)
Threshold float64 // Optional: minimum score threshold after reranking
}
RerankingConfig holds configuration for result reranking
type ResultsConfig ¶
type ResultsConfig struct {
Limit int // Maximum number of results to return (top K)
Deduplicate bool // Remove duplicate entries based on final content
IncludeScore bool // Include relevance scores in results (if/when used)
ReturnFullContent bool // Return full document content instead of just matched chunks
RerankingConfig *RerankingConfig // Optional reranking configuration
}
ResultsConfig captures result-postprocessing behavior for the manager.
type ToolConfig ¶ added in v1.9.26
ToolConfig represents tool-specific configuration