Documentation
¶
Index ¶
- Constants
- func BM25RankToScore(rank float64) float64
- func BuildFtsQuery(raw string) string
- func ComputeProviderKey(providerID, model, baseURL string, headers map[string]string) string
- type BatchConfig
- type CacheConfig
- type Chunk
- type ChunkingConfig
- type EmbeddingProvider
- type ExperimentalConfig
- type FallbackStatus
- type HybridConfig
- type HybridKeywordResult
- type HybridVectorResult
- type ProviderStatus
- type QueryConfig
- type RemoteConfig
- type ResolvedConfig
- type SearchOptions
- type SearchResult
- type SessionSyncConfig
- type StoreConfig
- type SyncConfig
- type VectorConfig
Constants ¶
View Source
const ( DefaultChunkTokens = 400 DefaultChunkOverlap = 80 DefaultWatchDebounceMs = 1500 DefaultSessionDeltaBytes = 100_000 DefaultSessionDeltaMessages = 50 DefaultMaxResults = 6 DefaultMinScore = 0.35 DefaultHybridEnabled = true DefaultHybridVectorWeight = 0.7 DefaultHybridTextWeight = 0.3 DefaultHybridCandidateMultiple = 4 DefaultCacheEnabled = true DefaultMemorySource = "memory" )
Variables ¶
This section is empty.
Functions ¶
func BM25RankToScore ¶
BM25RankToScore normalizes an FTS5 bm25 rank into a 0-1-ish score.
func BuildFtsQuery ¶
BuildFtsQuery builds a simple AND query for FTS5 from raw input.
Types ¶
type BatchConfig ¶
type CacheConfig ¶
type Chunk ¶
func ChunkMarkdown ¶
type ChunkingConfig ¶
type EmbeddingProvider ¶
type ExperimentalConfig ¶
type ExperimentalConfig struct {
SessionMemory bool
}
type FallbackStatus ¶
type HybridConfig ¶
type HybridKeywordResult ¶
type HybridVectorResult ¶
type ProviderStatus ¶
type ProviderStatus struct {
Provider string
Model string
Fallback *FallbackStatus
}
type QueryConfig ¶
type QueryConfig struct {
MaxResults int
MinScore float64
MaxInjectedChars int
Hybrid HybridConfig
}
type RemoteConfig ¶
type RemoteConfig struct {
BaseURL string
APIKey string
Headers map[string]string
Batch BatchConfig
}
type ResolvedConfig ¶
type ResolvedConfig struct {
Enabled bool
Sources []string
ExtraPaths []string
Provider string
Model string
Fallback string
Remote RemoteConfig
Store StoreConfig
Chunking ChunkingConfig
Sync SyncConfig
Query QueryConfig
Cache CacheConfig
Experimental ExperimentalConfig
}
type SearchOptions ¶
type SearchOptions struct {
MaxResults int
MinScore float64
SessionKey string
// Mode controls search strategy.
// - auto: prefer hybrid (vector + keyword), else keyword, else semantic, else scan fallback
// - semantic: vector-only
// - keyword: keyword-only (FTS if available; else scan fallback)
// - hybrid: merge vector + keyword when possible
// - list: list recent files (ignores query text)
Mode string
// Sources restrict which indexed sources to search (e.g. ["memory","workspace"]).
// If empty, uses the manager's configured sources.
Sources []string
// PathPrefix restricts results to paths under this prefix (virtual paths).
// Example: "workspace/projects/acme/".
PathPrefix string
}
type SearchResult ¶
type SearchResult struct {
Path string `json:"path"`
StartLine int `json:"startLine"`
EndLine int `json:"endLine"`
Score float64 `json:"score"`
Snippet string `json:"snippet"`
Source string `json:"source"`
}
func MergeHybridResults ¶
func MergeHybridResults(vector []HybridVectorResult, keyword []HybridKeywordResult, vectorWeight, textWeight float64) []SearchResult
MergeHybridResults merges vector + keyword results with weighted scores.
type SessionSyncConfig ¶
type StoreConfig ¶
type StoreConfig struct {
Driver string
Path string
Vector VectorConfig
}
type SyncConfig ¶
type VectorConfig ¶
Click to show internal directories.
Click to hide internal directories.