Versions in this module Expand all Collapse all v1 v1.0.3 Feb 11, 2026 v1.0.2 Feb 11, 2026 v1.0.1 Feb 11, 2026 v1.0.0 Feb 11, 2026 Changes in this version + const ChunkOverlap + const DefaultMaxFileSize + const HeaderSize + const IndexVersion + const MagicNumber + const MaxContextChars + const MaxFileSize + const MaxLineLength + var AllPresets = []SearchPreset + var PresetAccurate = SearchPreset + var PresetBalanced = SearchPreset + var PresetDeep = SearchPreset + var PresetFast = SearchPreset + var PresetInteractive = SearchPreset + var PresetLargeCodebase = SearchPreset + func ApplyPreset(opts *BedSearchOptions, preset *SearchPreset) + func BenchmarkBackends(indexSize int) map[string]time.Duration + func Execute() error + func GetOptimalWorkerCount(indexSize int) int + func Main() + func ShouldUseGPU(indexSize int) bool + type AdaptiveSearcher struct + func NewAdaptiveSearcher() (*AdaptiveSearcher, error) + func (as *AdaptiveSearcher) Close() error + func (as *AdaptiveSearcher) GetStats() map[string]interface{} + func (as *AdaptiveSearcher) Search(options BedSearchOptions) error + type AutoOptimizer struct + func GetOptimizer() *AutoOptimizer + func (o *AutoOptimizer) GetCapabilities() SystemCapabilities + func (o *AutoOptimizer) Optimize() OptimizationResult + func (o *AutoOptimizer) RecordQueryTime(d time.Duration) + func (o *AutoOptimizer) UpdateProfile(indexSize, avgQueryLen int, queryRate float64) + type BedDaemon struct + func NewBedDaemon(config DaemonConfig) (*BedDaemon, error) + func (d *BedDaemon) Close() error + func (d *BedDaemon) Run() error + type BedSearchOptions struct + ColorMode string + Context int + ForceIndex bool + Limit int + NoIndex bool + Progressive bool + Query string + SearchBinaries bool + Threshold float32 + UseGPU bool + Verbose bool + type BinaryHeader struct + Compression uint8 + HeaderSize uint32 + IndexSize uint64 + Magic uint32 + NumEmbeddings uint32 + NumFiles uint32 + NumLines uint32 + Reserved [35]byte + Version uint32 + type BinarySearchResult struct + Confidence float32 + FilePath string + FileSize int64 + HasMatch bool + Note string + func ProcessBinaryFile(path string, query []float32, model interface{}) *BinarySearchResult + type CAGRABedSearcher struct + func NewCAGRABedSearcher() (*CAGRABedSearcher, error) + func (c *CAGRABedSearcher) BuildIndex(path string, options BedSearchOptions) error + func (c *CAGRABedSearcher) Close() error + func (c *CAGRABedSearcher) NumDocuments() int + func (c *CAGRABedSearcher) Search(options BedSearchOptions) error + func (c *CAGRABedSearcher) SearchMatches(options BedSearchOptions) ([]SearchMatch, error) + type ChunkedMatch struct + Column int + FullMatch bool + LineNumber int + Path string + Preview string + type ChunkedSearcher struct + func NewChunkedSearcher() (*ChunkedSearcher, error) + func (cs *ChunkedSearcher) PrintResults(results []ChunkedMatch, useColor bool) + func (cs *ChunkedSearcher) SearchDirectory(dir, pattern string, caseSensitive bool) ([]ChunkedMatch, error) + type Config struct + AsyncIndexing bool + BatchSize int + CacheDir string + ColorMode string + CompressionLevel int + DefaultContext int + DefaultLimit int + DefaultThreshold float32 + EmbeddingModel string + ExcludeExtensions []string + GPUDeviceID int + IgnoreLongLines bool + IgnorePatterns []string + IncludeExtensions []string + IndexFormat string + IndexPath string + MaxFileSize int64 + MaxFiles int + MaxLineLength int + MinLineLength int + RespectGitignore bool + SearchBinaries bool + UseGPU bool + WorkerThreads int + func DefaultConfig() *Config + func LoadConfig() (*Config, error) + func (c *Config) Display() error + func (c *Config) Save() error + type CrawlOptions struct + BufferSize int + FollowSymlinks bool + IncludeContent bool + MaxFileSize int64 + MaxWorkers int + Recursive bool + WatchMode bool + func DefaultCrawlOptions() CrawlOptions + type CrawlStats struct + BytesProcessed int64 + ElapsedTime time.Duration + EndTime time.Time + Errors int64 + FilesFound int64 + FilesProcessed int64 + LinesProcessed int64 + StartTime time.Time + type Crawler struct + func NewCrawler(basePath string, config *Config) (*Crawler, error) + func (c *Crawler) Close() error + func (c *Crawler) Crawl(options CrawlOptions) (<-chan *FileInfo, <-chan error, error) + func (c *Crawler) Stats() CrawlStats + type DaemonConfig struct + BatchDelay time.Duration + HTTPPort int + MaxFileSize int64 + SocketPath string + Verbose bool + WatchPaths []string + type Document struct + Content string + ID int + IsBinary bool + LineNumber int + Path string + type Embedder struct + func NewEmbedder(config *Config) (*Embedder, error) + func (e *Embedder) Close() error + func (e *Embedder) GetModel() *gobed.EmbeddingModel + func (e *Embedder) IsGPUAvailable() bool + func (e *Embedder) ProcessBatch(texts []string) ([][]float32, error) + func (e *Embedder) ProcessFiles(files <-chan *FileInfo, options EmbeddingOptions) (<-chan *EmbeddingResult, error) + func (e *Embedder) Stats() map[string]interface{} + type EmbeddingIndex struct + BasePath string + Config IndexConfig + CreatedAt time.Time + FileEmbeddings map[string][]float32 + Files map[string]*FileEntry + GPUIndex *GPUIndexData + IDToPath map[int]string + IndexSize int64 + LineEmbeddings [][]float32 + Lines []*LineEntry + PathToID map[string]int + TotalFiles int + TotalLines int + UpdatedAt time.Time + Version int + func LoadEmbeddingIndex(indexPath string) (*EmbeddingIndex, error) + func NewEmbeddingIndex(basePath, indexPath string, config IndexConfig) *EmbeddingIndex + func (idx *EmbeddingIndex) AddFile(fileInfo *FileInfo, embeddings [][]float32) error + func (idx *EmbeddingIndex) Save() error + func (idx *EmbeddingIndex) Search(query string, model *gobed.EmbeddingModel, options SearchOptions) ([]*SearchResult, error) + func (idx *EmbeddingIndex) Stats() map[string]interface{} + type EmbeddingOptions struct + BatchSize int + ContextSize int + FileLevel bool + LineLevel bool + MaxWorkers int + ShowProgress bool + UseGPU bool + type EmbeddingResult struct + Error error + FileEmbedding []float32 + FileInfo *FileInfo + LineEmbeddings [][]float32 + ProcessingTime time.Duration + type EnhancedIgnoreFilter struct + func NewEnhancedIgnoreFilter(baseDir string, options ...FilterOption) (*EnhancedIgnoreFilter, error) + func (f *EnhancedIgnoreFilter) ShouldProcess(path string) (bool, FileType) + type FastBedSearcher struct + func NewFastBedSearcher() (*FastBedSearcher, error) + func (fs *FastBedSearcher) Close() error + func (fs *FastBedSearcher) IndexDirectory(path string, options BedSearchOptions) error + func (fs *FastBedSearcher) IndexDirectoryAppend(path string, options BedSearchOptions) error + func (fs *FastBedSearcher) IndexPaths(paths []string, options BedSearchOptions) error + func (fs *FastBedSearcher) NumDocuments() int + func (fs *FastBedSearcher) RemoveFile(path string) + func (fs *FastBedSearcher) Search(options BedSearchOptions) error + func (fs *FastBedSearcher) SearchMatches(options BedSearchOptions) ([]SearchMatch, error) + func (fs *FastBedSearcher) UpsertFile(path string, options BedSearchOptions) error + type FastEmbedder struct + func NewFastEmbedder(config *Config) (*FastEmbedder, error) + func (e *FastEmbedder) Close() error + func (e *FastEmbedder) EmbedQuery(query string) ([]float32, func()) + func (e *FastEmbedder) EmbedQueryCopy(query string) ([]float32, error) + func (e *FastEmbedder) IsGPUAvailable() bool + func (e *FastEmbedder) ProcessBatch(texts []string) ([][]float32, error) + func (e *FastEmbedder) ProcessFiles(files <-chan *FileInfo, options EmbeddingOptions) (<-chan *EmbeddingResult, error) + func (e *FastEmbedder) Stats() map[string]interface{} + type FastIndexer struct + func NewFastIndexer(config FastIndexerConfig) (*FastIndexer, error) + func (fi *FastIndexer) Clear() + func (fi *FastIndexer) GetEngine() *Int8SearchEngine + func (fi *FastIndexer) IndexDirectory(dir string, verbose bool) error + func (fi *FastIndexer) Search(query string, topK int, threshold float32) ([]SearchMatch, error) + func (fi *FastIndexer) Stats() map[string]interface{} + type FastIndexerConfig struct + BatchSize int + MaxFileSize int64 + MaxLineLen int + NumWorkers int + func DefaultFastIndexerConfig() FastIndexerConfig + type FileEntry struct + Checksum uint32 + ID int + Language string + LineCount int + LineEnd int + LineStart int + ModTime time.Time + Path string + RelativePath string + Size int64 + type FileInfo struct + Content string + IsText bool + LineCount int + ModTime time.Time + Path string + RelativePath string + Size int64 + type FileResultGroup struct + FilePath string + Results []*SearchResult + type FileType int + const FileTypeBinary + const FileTypeIgnored + const FileTypeText + const FileTypeTooLarge + type FilterOption func(*EnhancedIgnoreFilter) + func WithBinarySearch(enable bool) FilterOption + func WithMaxFileSize(size int64) FilterOption + type GPUChunkedSearcher struct + func NewGPUChunkedSearcher() (*GPUChunkedSearcher, error) + func (gcs *GPUChunkedSearcher) Close() error + func (gcs *GPUChunkedSearcher) SearchWithChunkedOutput(options BedSearchOptions) error + type GPUIndexData struct + BatchSize int + CompressedData []byte + DeviceID int + IndexType string + MemoryUsage int64 + SearchParameters []byte + type GitignoreRule struct + type HighlightRange struct + End int + Start int + Type string + type IgnoreFilter struct + func NewIgnoreFilter(basePath string, respectGitignore bool) (*IgnoreFilter, error) + func (f *IgnoreFilter) AddPattern(pattern string) error + func (f *IgnoreFilter) IsTextFile(path string) bool + func (f *IgnoreFilter) ShouldIgnore(path string) bool + type IndexConfig struct + CompressionLevel int + ContextWindow int + EmbeddingModel string + ExcludeExtensions []string + IncludeExtensions []string + LineBasedIndex bool + MaxFileSize int64 + UseGPU bool + type IndexOptions struct + BatchSize int + FileLevel bool + Force bool + IncludeContent bool + LineLevel bool + MaxWorkers int + Path string + ShowProgress bool + UseGPU bool + Verbose bool + WatchMode bool + func DefaultIndexOptions() IndexOptions + type IndexStatus struct + Exists bool + IsUpToDate bool + LastUpdated time.Time + Path string + Size int64 + Stats map[string]interface{} + func GetIndexStatus() (*IndexStatus, error) + func (status *IndexStatus) Display() error + type Indexer struct + func NewIndexer() (*Indexer, error) + func (idx *Indexer) Close() error + func (idx *Indexer) EstimateIndexSize(path string, options IndexOptions) (int64, error) + func (idx *Indexer) Index(options IndexOptions) error + func (idx *Indexer) Stats() map[string]interface{} + func (idx *Indexer) UpdateIndex(changedFiles []string, options IndexOptions) error + type Int8SearchEngine = OptimizedSearchEngine + type LineEntry struct + Content string + ContextAfter string + ContextBefore string + Embedding []float32 + EmbeddingID int + FileID int + ID int + LineNumber int + type OptimizationResult struct + Backend SearchBackend + BatchSize int + NumWorkers int + Reason string + UseInt8 bool + UsePrecomputedNorms bool + type OptimizedSearchEngine struct + func NewInt8SearchEngine() (*OptimizedSearchEngine, error) + func NewOptimizedSearchEngine() (*OptimizedSearchEngine, error) + func (e *OptimizedSearchEngine) AddDocument(doc Document, embedding *gobed.Int8Result512) + func (e *OptimizedSearchEngine) AddDocumentFloat32(doc Document, embedding []float32) + func (e *OptimizedSearchEngine) BatchAddDocuments(docs []Document, numWorkers int) error + func (e *OptimizedSearchEngine) Clear() + func (e *OptimizedSearchEngine) NumDocuments() int + func (e *OptimizedSearchEngine) Search(query string, topK int, threshold float32) ([]SearchMatch, error) + func (e *OptimizedSearchEngine) UseInt8() bool + type OutputFormatter struct + func NewOutputFormatter(colorMode string) *OutputFormatter + func (f *OutputFormatter) FormatError(err error) string + func (f *OutputFormatter) FormatProgressBar(current, total int64, rate float64, eta string) string + func (f *OutputFormatter) FormatSearchResults(results []*SearchResult, query string) string + func (f *OutputFormatter) FormatStatistics(stats map[string]interface{}) string + func (f *OutputFormatter) FormatSuccess(message string) string + func (f *OutputFormatter) FormatWarning(message string) string + func (f *OutputFormatter) SetContextLines(lines int) + func (f *OutputFormatter) SetLineNumbers(show bool) + type ProcessedQuery struct + CodeTerms []string + Concepts []string + Enhanced string + Original string + QueryType QueryType + Terms []string + Weights map[string]float32 + func (processed *ProcessedQuery) Format() string + type QueryProcessor struct + func NewQueryProcessor() *QueryProcessor + func (qp *QueryProcessor) GetSuggestions(partial string) []string + func (qp *QueryProcessor) Process(query string) *ProcessedQuery + func (qp *QueryProcessor) ReRank(results []*SearchResult, processed *ProcessedQuery) []*SearchResult + type QueryType int + const QueryTypeCode + const QueryTypeDocumentation + const QueryTypeError + const QueryTypeFile + const QueryTypeFunction + const QueryTypeGeneral + type SearchBackend int + const BackendCPU + const BackendGPU + const BackendHybrid + const BackendSIMD + func (b SearchBackend) String() string + type SearchMatch struct + Document Document + Similarity float32 + type SearchOptions struct + ColorMode string + Context int + ForceIndex bool + IgnoreCase bool + Limit int + NoIndex bool + Query string + Threshold float32 + UseGPU bool + Verbose bool + type SearchPreset struct + Config SearchPresetConfig + Description string + Name string + func AutoSelectPreset(indexSize int, isInteractive bool) *SearchPreset + func GetPreset(name string) *SearchPreset + type SearchPresetConfig struct + BatchSize int + Context int + ForceCPU bool + ForceGPU bool + Limit int + NumWorkers int + Threshold float32 + UseInt8 bool + type SearchProfile struct + AvgQueryLength int + BatchSize int + IndexSize int + QueryRate float64 + type SearchRequest struct + Limit int + Query string + Threshold float32 + type SearchResponse struct + Count int + Latency float64 + Results []SearchMatch + type SearchResult struct + Content string + ContextAfter string + ContextBefore string + Distance float32 + FileID int + FilePath string + Highlights []HighlightRange + LineID int + LineNumber int + Similarity float32 + type Searcher struct + func NewSearcher() (*Searcher, error) + func (s *Searcher) Close() error + func (s *Searcher) Search(options SearchOptions) error + type SimpleBedSearcher struct + func NewSimpleBedSearcher() (*SimpleBedSearcher, error) + func (sbs *SimpleBedSearcher) Close() error + func (sbs *SimpleBedSearcher) Search(options BedSearchOptions) error + type SimpleSearchEngine struct + func NewSimpleSearchEngine() (*SimpleSearchEngine, error) + func (se *SimpleSearchEngine) IndexDirectory(path string, options BedSearchOptions) error + func (se *SimpleSearchEngine) Search(query string, limit int, threshold float32) ([]SearchMatch, error) + type StatusResponse struct + Indexed int + Uptime float64 + WatchPaths int + type SystemCapabilities struct + GPUAvailable bool + GPUMemoryMB int + GPUName string + HasAVX2 bool + HasAVX512 bool + NumCPUs int + TotalMemoryMB int