Versions in this module Expand all Collapse all v0 v0.2.0 Mar 8, 2026 v0.1.1 Mar 6, 2026 v0.1.0 Mar 6, 2026 Changes in this version + const DefaultSimilarityThreshold + const DefaultWindowSize + var ErrCollectionExists = errors.New("collection already exists") + var ErrCollectionNotFound = errors.New("collection not found") + var ErrDocumentNotFound = errors.New("document not found") + var ErrEmbeddingRequired = errors.New("embedding provider required for search") + var ErrEmptyContent = errors.New("document content cannot be empty") + var ErrInvalidChunkConfig = errors.New("invalid chunk configuration") + type BulkIngestDocResult struct + ChunksCreated int + DocumentID string + Error string + Index int + Success bool + Title string + type BulkIngestDocument struct + Content string + ContentType string + Metadata map[string]string + Source string + Title string + type BulkIngestOpts struct + ChunkConfig *types.ChunkConfig + Concurrency int + ContinueOnError bool + OnProgress func(completed, total int, doc string) + type BulkIngestResult struct + CollectionID string + Documents []*BulkIngestDocResult + Failed int + Succeeded int + TotalChunks int + TotalDocuments int + type ChunkOutput struct + Content string + Index int + TokenCount int + type ChunkStrategy string + const ChunkStrategyFixed + const ChunkStrategyParagraph + const ChunkStrategySemantic + const ChunkStrategySentence + type Chunker interface + Chunk func(content string, cfg types.ChunkConfig) []ChunkOutput + type CreateCollectionOpts struct + ChunkConfig *types.ChunkConfig + Description string + Name string + type DefaultChunker struct + func NewChunker() *DefaultChunker + func (c *DefaultChunker) Chunk(content string, cfg types.ChunkConfig) []ChunkOutput + type Engine struct + func NewEngine(store storage.Backend, emb embedding.Provider, cfg *config.KnowledgeConfig) (*Engine, error) + func (e *Engine) BulkIngest(ctx context.Context, namespace, collectionID string, ...) (*BulkIngestResult, error) + func (e *Engine) CollectionStats(ctx context.Context, namespace, collectionID string) (*types.CollectionStats, error) + func (e *Engine) CreateCollection(ctx context.Context, namespace string, opts CreateCollectionOpts) (*types.Collection, error) + func (e *Engine) DeleteCollection(ctx context.Context, namespace, collectionID string) error + func (e *Engine) DeleteDocument(ctx context.Context, namespace, docID string) error + func (e *Engine) GetCollection(ctx context.Context, namespace, collectionID string) (*types.Collection, error) + func (e *Engine) GetDocument(ctx context.Context, namespace, docID string) (*types.Document, error) + func (e *Engine) Ingest(ctx context.Context, namespace, collectionID, content string, opts *IngestOpts) (*IngestResult, error) + func (e *Engine) ListCollections(ctx context.Context, namespace, cursor string, limit int) ([]*types.Collection, string, error) + func (e *Engine) Search(ctx context.Context, namespace, query string, opts *SearchOpts) (*SearchResult, error) + func (e *Engine) SetExtractionEnqueuer(eq ExtractionEnqueuer) + type ExtractionEnqueuer interface + EnqueueForExtraction func(ctx context.Context, namespace, sourceType, sourceID, content string) error + type IngestOpts struct + ChunkConfig *types.ChunkConfig + ContentType string + Metadata map[string]string + Source string + Title string + type IngestResult struct + ChunksCreated int + CollectionID string + DocumentID string + type SearchMode string + const SearchModeHybrid + const SearchModeText + const SearchModeVector + type SearchOpts struct + Alpha float64 + CollectionID *string + ContextWindow int + Filters map[string]string + MinScore float64 + SearchMode SearchMode + TopK int + type SearchResult struct + Query string + Results []*types.ChunkResult + TotalFound int + type SemanticChunker struct + func NewSemanticChunker(emb embedding.Provider, opts ...SemanticChunkerOption) *SemanticChunker + func (c *SemanticChunker) Chunk(ctx context.Context, content string, cfg types.ChunkConfig) ([]ChunkOutput, error) + type SemanticChunkerOption func(*SemanticChunker) + func WithSimilarityThreshold(threshold float64) SemanticChunkerOption + func WithWindowSize(size int) SemanticChunkerOption