Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
DataDirectory string `yaml:"data_directory"`
Database DatabaseConfig `yaml:"database"` // SQLite settings
Search SearchConfig `yaml:"search"` // Optional search
Vectors VectorConfig `yaml:"vectors"` // Optional vectors
Embeddings EmbeddingConfig `yaml:"embeddings"`
}
Config represents the SRAKE configuration
func (*Config) EnsureDirectories ¶
EnsureDirectories creates necessary directories
func (*Config) GetOperationalMode ¶
GetOperationalMode returns the operational mode based on config
func (*Config) IsSearchEnabled ¶
IsSearchEnabled returns true if search is enabled
func (*Config) IsVectorEnabled ¶
IsVectorEnabled returns true if vectors are enabled
type DatabaseConfig ¶
type DatabaseConfig struct {
Path string `yaml:"path"`
CacheSize int `yaml:"cache_size"` // in KB
MMapSize int64 `yaml:"mmap_size"` // in bytes
JournalMode string `yaml:"journal_mode"` // WAL
}
DatabaseConfig contains SQLite database settings
type EmbeddingConfig ¶
type EmbeddingConfig struct {
Enabled bool `yaml:"enabled"`
ModelsDirectory string `yaml:"models_directory"`
DefaultModel string `yaml:"default_model"` // HuggingFace model path
DefaultVariant string `yaml:"default_variant"` // quantized, fp16, or default
BatchSize int `yaml:"batch_size"` // Batch size for embedding
NumThreads int `yaml:"num_threads"` // ONNX runtime threads
MaxTextLength int `yaml:"max_text_length"` // Max tokens
CombineFields []string `yaml:"combine_fields"` // Fields to combine for embedding
CacheEmbeddings bool `yaml:"cache_embeddings"` // Cache computed embeddings
}
EmbeddingConfig contains embedding settings
type SearchConfig ¶
type SearchConfig struct {
Enabled bool `yaml:"enabled"` // Enable Bleve search
Backend string `yaml:"backend"` // "bleve" or "sqlite"
IndexPath string `yaml:"index_path"` // Path to Bleve index
RebuildOnStart bool `yaml:"rebuild_on_start"` // Rebuild index on startup
AutoSync bool `yaml:"auto_sync"` // Auto-sync with SQLite
SyncInterval int `yaml:"sync_interval"` // Sync interval in seconds
DefaultLimit int `yaml:"default_limit"` // Default result limit
BatchSize int `yaml:"batch_size"` // Indexing batch size
UseCache bool `yaml:"use_cache"` // Enable search cache
CacheTTL int `yaml:"cache_ttl"` // Cache TTL in seconds
}
SearchConfig contains search-related settings
type VectorConfig ¶
type VectorConfig struct {
Enabled bool `yaml:"enabled"` // Enable vector search
RequiresSearch bool `yaml:"requires_search"` // Requires search to be enabled
SimilarityMetric string `yaml:"similarity_metric"` // cosine, dot_product, l2_norm
UseQuantized bool `yaml:"use_quantized"` // Use INT8 for speed
Dimensions int `yaml:"dimensions"` // Vector dimensions (768 for SapBERT)
Optimization string `yaml:"optimization"` // memory_efficient, latency, recall
}
VectorConfig contains vector search settings
Click to show internal directories.
Click to hide internal directories.