query

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxDepth = 32
	MaxDepthCap     = 128
)

Variables

This section is empty.

Functions

func Format

func Format(result *Result) string

func FormatCompact

func FormatCompact(result *Result) string

Types

type Engine

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

func NewEngine

func NewEngine(s QueryStore) *Engine

func (*Engine) Delta

func (e *Engine) Delta(ctx context.Context, sinceSnapshot int64) ([]*store.DiffRecord, error)

func (*Engine) Fetch

func (e *Engine) Fetch(ctx context.Context, anchor string, budget, depth int) (*Result, error)

func (*Engine) Search

func (e *Engine) Search(ctx context.Context, query string, budget int) (*Result, error)

type QueryStore

type QueryStore interface {
	GetNode(ctx context.Context, id string) (*store.Node, error)

	GetAncestors(ctx context.Context, id string) ([]*store.Node, error)

	GetDescendants(ctx context.Context, id string, maxDepth int) ([]*store.Node, error)

	GetSiblings(ctx context.Context, id string) ([]*store.Node, error)

	SearchRanked(ctx context.Context, query string, limit int) ([]*store.RankedNode, error)

	GetDiffsSince(ctx context.Context, sinceSnapshotID int64) ([]*store.DiffRecord, error)
}

type Result

type Result struct {
	Nodes      []ScoredNode
	TokensUsed int
}

type ScoredNode

type ScoredNode struct {
	Node  *store.Node
	Score float64
}

Jump to

Keyboard shortcuts

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