Versions in this module Expand all Collapse all v0 v0.8.5 Jan 17, 2026 v0.8.4 Jan 7, 2026 v0.8.3 Jan 7, 2026 v0.8.2 Jan 6, 2026 Changes in this version + type Community struct + Children []string + CreatedAt time.Time + Entities []string + ID string + Level int + ParentID string + Properties map[string]any + Score float64 + Summary string + Title string + UpdatedAt time.Time type Config + LightRAG *LightRAGConfig + type GlobalRetrievalConfig struct + CommunityWeight float64 + IncludeHierarchy bool + MaxCommunities int + MaxHierarchyDepth int + type HybridRetrievalConfig struct + FusionMethod string + GlobalWeight float64 + LocalWeight float64 + RFFK int + type LightRAGConfig struct + ChunkOverlap int + ChunkSize int + CommunityDetectionAlgorithm string + EnableCommunityDetection bool + EntityExtractionThreshold float64 + GlobalConfig GlobalRetrievalConfig + HybridConfig HybridRetrievalConfig + LocalConfig LocalRetrievalConfig + MaxCommunities int + MaxEntitiesPerChunk int + Mode string + PromptTemplates map[string]string + Temperature float64 + type LocalRetrievalConfig struct + EntityWeight float64 + IncludeDescriptions bool + MaxHops int + TopK int v0.8.1 Jan 1, 2026 v0.8.0 Dec 31, 2025 v0.7.1 Dec 25, 2025 Changes in this version + func NewRetrievalNode(engine Engine, inputKey, outputKey string) func(context.Context, any) (any, error) + type RetrieverTool struct + DescVal string + Engine Engine + NameVal string + func NewRetrieverTool(engine Engine, name, description string) *RetrieverTool + func (t *RetrieverTool) Call(ctx context.Context, input string) (string, error) + func (t *RetrieverTool) Description() string + func (t *RetrieverTool) Name() string v0.7.0 Dec 21, 2025 Changes in this version + func WeightedAggregator(weights []float64) func([]*QueryResult) *QueryResult + type BaseEngine struct + func NewBaseEngine(retriever Retriever, embedder Embedder, config *Config) *BaseEngine + func (e *BaseEngine) AddDocuments(ctx context.Context, docs []Document) error + func (e *BaseEngine) DeleteDocument(ctx context.Context, docID string) error + func (e *BaseEngine) GetMetrics() *Metrics + func (e *BaseEngine) Query(ctx context.Context, query string) (*QueryResult, error) + func (e *BaseEngine) QueryWithConfig(ctx context.Context, query string, config *RetrievalConfig) (*QueryResult, error) + func (e *BaseEngine) ResetMetrics() + func (e *BaseEngine) SimilaritySearch(ctx context.Context, query string, k int) ([]Document, error) + func (e *BaseEngine) SimilaritySearchWithScores(ctx context.Context, query string, k int) ([]DocumentSearchResult, error) + func (e *BaseEngine) UpdateDocument(ctx context.Context, doc Document) error + type CompositeEngine struct + func NewCompositeEngine(engines []Engine, aggregator func([]*QueryResult) *QueryResult) *CompositeEngine + func (c *CompositeEngine) AddDocuments(ctx context.Context, docs []Document) error + func (c *CompositeEngine) DeleteDocument(ctx context.Context, docID string) error + func (c *CompositeEngine) Query(ctx context.Context, query string) (*QueryResult, error) + func (c *CompositeEngine) QueryWithConfig(ctx context.Context, query string, config *RetrievalConfig) (*QueryResult, error) + func (c *CompositeEngine) SimilaritySearch(ctx context.Context, query string, k int) ([]Document, error) + func (c *CompositeEngine) SimilaritySearchWithScores(ctx context.Context, query string, k int) ([]DocumentSearchResult, error) + func (c *CompositeEngine) UpdateDocument(ctx context.Context, doc Document) error + type Config struct + GraphRAG *GraphRAGConfig + VectorRAG *VectorRAGConfig + type Document struct + Content string + CreatedAt time.Time + Embedding []float32 + ID string + Metadata map[string]any + UpdatedAt time.Time + type DocumentLoader interface + Load func(ctx context.Context) ([]Document, error) + type DocumentSearchResult struct + Document Document + Metadata map[string]any + Score float64 + type Embedder interface + EmbedDocument func(ctx context.Context, text string) ([]float32, error) + EmbedDocuments func(ctx context.Context, texts []string) ([][]float32, error) + GetDimension func() int + type Engine interface + AddDocuments func(ctx context.Context, docs []Document) error + DeleteDocument func(ctx context.Context, docID string) error + Query func(ctx context.Context, query string) (*QueryResult, error) + QueryWithConfig func(ctx context.Context, query string, config *RetrievalConfig) (*QueryResult, error) + SimilaritySearch func(ctx context.Context, query string, k int) ([]Document, error) + SimilaritySearchWithScores func(ctx context.Context, query string, k int) ([]DocumentSearchResult, error) + UpdateDocument func(ctx context.Context, doc Document) error + type Entity struct + CreatedAt time.Time + Embedding []float32 + ID string + Name string + Properties map[string]any + Type string + UpdatedAt time.Time + type GraphQuery struct + EntityType string + EntityTypes []string + Filters map[string]any + Limit int + MaxDepth int + Relationships []string + StartEntity string + type GraphQueryResult struct + Entities []*Entity + Metadata map[string]any + Paths [][]*Entity + Relationships []*Relationship + Score float64 + Scores []float64 + type GraphRAGConfig struct + ChatModel string + DatabaseURL string + EmbeddingModel string + EnableReasoning bool + EntityTypes []string + ExtractionPrompt string + MaxDepth int + ModelProvider string + Relationships map[string][]string + type KnowledgeGraph interface + AddEntity func(ctx context.Context, entity *Entity) error + AddRelationship func(ctx context.Context, relationship *Relationship) error + GetEntity func(ctx context.Context, entityID string) (*Entity, error) + GetRelatedEntities func(ctx context.Context, entityID string, maxDepth int) ([]*Entity, error) + Query func(ctx context.Context, query *GraphQuery) (*GraphQueryResult, error) + type LLMInterface interface + Generate func(ctx context.Context, prompt string) (string, error) + GenerateWithConfig func(ctx context.Context, prompt string, config map[string]any) (string, error) + GenerateWithSystem func(ctx context.Context, system, prompt string) (string, error) + type LangChainDocumentLoader struct + func NewLangChainDocumentLoader(loader documentloaders.Loader) *LangChainDocumentLoader + func (l *LangChainDocumentLoader) Load(ctx context.Context) ([]Document, error) + func (l *LangChainDocumentLoader) LoadAndSplit(ctx context.Context, splitter textsplitter.TextSplitter) ([]Document, error) + func (l *LangChainDocumentLoader) LoadWithMetadata(ctx context.Context, metadata map[string]any) ([]Document, error) + type LangChainEmbedder struct + func NewLangChainEmbedder(embedder embeddings.Embedder) *LangChainEmbedder + func (l *LangChainEmbedder) EmbedDocument(ctx context.Context, text string) ([]float32, error) + func (l *LangChainEmbedder) EmbedDocuments(ctx context.Context, texts []string) ([][]float32, error) + func (l *LangChainEmbedder) GetDimension() int + type LangChainRetriever struct + func NewLangChainRetriever(store vectorstores.VectorStore, topK int) *LangChainRetriever + func (r *LangChainRetriever) Retrieve(ctx context.Context, query string) ([]Document, error) + func (r *LangChainRetriever) RetrieveWithConfig(ctx context.Context, query string, config *RetrievalConfig) ([]DocumentSearchResult, error) + func (r *LangChainRetriever) RetrieveWithK(ctx context.Context, query string, k int) ([]Document, error) + type LangChainTextSplitter struct + func NewLangChainTextSplitter(splitter textsplitter.TextSplitter) *LangChainTextSplitter + func (l *LangChainTextSplitter) JoinText(chunks []string) string + func (l *LangChainTextSplitter) SplitDocuments(docs []Document) []Document + func (l *LangChainTextSplitter) SplitText(text string) []string + type LangChainVectorStore struct + func NewLangChainVectorStore(store vectorstores.VectorStore) *LangChainVectorStore + func (l *LangChainVectorStore) Add(ctx context.Context, docs []Document) error + func (l *LangChainVectorStore) Delete(ctx context.Context, ids []string) error + func (l *LangChainVectorStore) GetStats(ctx context.Context) (*VectorStoreStats, error) + func (l *LangChainVectorStore) Search(ctx context.Context, query []float32, k int) ([]DocumentSearchResult, error) + func (l *LangChainVectorStore) SearchWithFilter(ctx context.Context, query []float32, k int, filter map[string]any) ([]DocumentSearchResult, error) + func (l *LangChainVectorStore) Update(ctx context.Context, docs []Document) error + type Metrics struct + AverageLatency time.Duration + CacheHits int64 + CacheMisses int64 + IndexingLatency time.Duration + LastQueryTime time.Time + MaxLatency time.Duration + MinLatency time.Duration + TotalDocuments int64 + TotalQueries int64 + type PipelineConfig struct + Embedder Embedder + IncludeCitations bool + LLM llms.Model + Loader RAGDocumentLoader + MaxTokens int + Reranker Reranker + Retriever Retriever + ScoreThreshold float64 + Splitter RAGTextSplitter + SystemPrompt string + Temperature float64 + TopK int + UseFallback bool + UseReranking bool + VectorStore VectorStore + func DefaultPipelineConfig() *PipelineConfig + type QueryResult struct + Answer string + Confidence float64 + Context string + Metadata map[string]any + Query string + ResponseTime time.Duration + Sources []Document + func DefaultAggregator(results []*QueryResult) *QueryResult + type RAGConfig struct + CacheSize int + Debug bool + EnableCache bool + EnableMetrics bool + Timeout time.Duration + type RAGDocument struct + Content string + CreatedAt time.Time + Metadata map[string]any + UpdatedAt time.Time + func DocumentFromRAGDocument(doc Document) RAGDocument + func (d RAGDocument) Document() Document + type RAGDocumentLoader interface + Load func(ctx context.Context) ([]RAGDocument, error) + type RAGPipeline struct + func NewRAGPipeline(config *PipelineConfig) *RAGPipeline + func (p *RAGPipeline) BuildAdvancedRAG() error + func (p *RAGPipeline) BuildBasicRAG() error + func (p *RAGPipeline) BuildConditionalRAG() error + func (p *RAGPipeline) Compile() (*graph.StateRunnable, error) + func (p *RAGPipeline) GetGraph() *graph.StateGraph + type RAGState struct + Answer string + Citations []string + Context string + Documents []RAGDocument + Metadata map[string]any + Query string + RankedDocuments []DocumentSearchResult + RetrievedDocuments []RAGDocument + type RAGTextSplitter interface + SplitDocuments func(documents []RAGDocument) ([]RAGDocument, error) + type Relationship struct + Confidence float64 + CreatedAt time.Time + ID string + Properties map[string]any + Source string + Target string + Type string + Weight float64 + type Reranker interface + Rerank func(ctx context.Context, query string, documents []DocumentSearchResult) ([]DocumentSearchResult, error) + type RetrievalConfig struct + Filter map[string]any + IncludeScores bool + K int + ScoreThreshold float64 + SearchType string + type Retriever interface + Retrieve func(ctx context.Context, query string) ([]Document, error) + RetrieveWithConfig func(ctx context.Context, query string, config *RetrievalConfig) ([]DocumentSearchResult, error) + RetrieveWithK func(ctx context.Context, query string, k int) ([]Document, error) + type TextSplitter interface + JoinText func(chunks []string) string + SplitDocuments func(documents []Document) []Document + SplitText func(text string) []string + type VectorRAGConfig struct + ChunkOverlap int + ChunkSize int + EmbeddingModel string + EnableReranking bool + RetrieverConfig RetrievalConfig + VectorStoreConfig map[string]any + VectorStoreType string + type VectorStore interface + Add func(ctx context.Context, documents []Document) error + Delete func(ctx context.Context, ids []string) error + GetStats func(ctx context.Context) (*VectorStoreStats, error) + Search func(ctx context.Context, query []float32, k int) ([]DocumentSearchResult, error) + SearchWithFilter func(ctx context.Context, query []float32, k int, filter map[string]any) ([]DocumentSearchResult, error) + Update func(ctx context.Context, documents []Document) error + type VectorStoreStats struct + Dimension int + LastUpdated time.Time + TotalDocuments int + TotalVectors int