search

package
v1.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PageKindPreference    = typescore.PageKindPreference
	PageKindKnowledge     = typescore.PageKindKnowledge
	PageKindLongTerm      = typescore.PageKindLongTerm
	PageKindKnowledgeBase = typescore.PageKindKnowledgeBase
)

Variables

View Source
var EstimateTokens = utils.EstimateTokens

Functions

func FormatPageIndexHitsExpert

func FormatPageIndexHitsExpert(hits []PageIndexHit) string

func GenerateIndexDocDescription

func GenerateIndexDocDescription(ctx context.Context, llm LLMProvider, tree *IndexTree) (string, error)

func IndexTreeJSONForLLM

func IndexTreeJSONForLLM(tree *IndexTree) ([]byte, error)

func SelectDocIDsByDescriptions

func SelectDocIDsByDescriptions(ctx context.Context, llm LLMProvider, query string, docs []DocSearchCandidate) ([]string, string, error)

Types

type ChunkBuilder

type ChunkBuilder struct {
	// contains filtered or unexported fields
}

func NewChunkBuilder

func NewChunkBuilder(maxTokens, overlapTokens int) *ChunkBuilder

func (*ChunkBuilder) ChunkByTokens

func (b *ChunkBuilder) ChunkByTokens(text string, tokenCount func(string) int) []string

type DocSearchCandidate

type DocSearchCandidate = typescore.DocSearchCandidate

type IndexBuilder

type IndexBuilder struct {
	// contains filtered or unexported fields
}

func NewIndexBuilder

func NewIndexBuilder(llm LLMProvider, cfg *IndexConfig) *IndexBuilder

func NewIndexBuilderWithStore

func NewIndexBuilderWithStore(llm LLMProvider, cfg *IndexConfig, store IndexStore) *IndexBuilder

func (*IndexBuilder) BuildFromMarkdown

func (b *IndexBuilder) BuildFromMarkdown(ctx context.Context, userID, sourceID, title, content string) (*IndexTree, error)

type IndexConfig

type IndexConfig = typescore.IndexConfig

type IndexNode

type IndexNode = typescore.IndexNode

type IndexSearchResult

type IndexSearchResult = typescore.IndexSearchResult

type IndexStore

type IndexStore = typescore.IndexStore

type IndexTree

type IndexTree = typescore.IndexTree

type LLMProvider

type LLMProvider = typescore.LLMProvider

type MarkdownParser

type MarkdownParser = stores.MarkdownParser

type MemoryItem

type MemoryItem = typescore.MemoryItem

type Message

type Message = typescore.Message

type PageIndexHit

type PageIndexHit = typescore.PageIndexHit

type PageIndexKind

type PageIndexKind = typescore.PageIndexKind

type PageIndexRAG

type PageIndexRAG struct {
	Store PageIndexStore
	LLM   LLMProvider
	Limit int
}

func NewPageIndexRAG

func NewPageIndexRAG(store PageIndexStore, llm LLMProvider) *PageIndexRAG

func (*PageIndexRAG) Retrieve

func (r *PageIndexRAG) Retrieve(ctx context.Context, userID, query string, kinds []PageIndexKind) (*PageIndexRAGResult, error)

type PageIndexRAGResult

type PageIndexRAGResult = typescore.PageIndexRAGResult

type PageIndexSearchOptions

type PageIndexSearchOptions = typescore.PageIndexSearchOptions

type PageIndexStore

type PageIndexStore = typescore.PageIndexStore

type SearchOptions

type SearchOptions = typescore.SearchOptions

type SearchResult

type SearchResult = typescore.SearchResult

type Tool

type Tool = typescore.Tool

type TreeSearchResult

type TreeSearchResult = typescore.TreeSearchResult

func TreeSearchIndexTree

func TreeSearchIndexTree(ctx context.Context, llm LLMProvider, tree *IndexTree, query, expertContext string) (*TreeSearchResult, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL