Documentation
¶
Index ¶
- Constants
- func AppendVector(values []int8, bytes []byte, dimension int) ([]int8, float32, error)
- func CitationURL(citation protocol.KnowledgeCitation) string
- func Excluded(name string) bool
- func Field(text string) string
- func Glob(pattern string) (*regexp.Regexp, error)
- func Hash(value string) bool
- func Index(text string) string
- func Native(path string) (string, error)
- func Phrase(text string) string
- func Protected(path string) bool
- func Query(text string) string
- func ValidateCitation(request protocol.KnowledgeCitationRequest) error
- func ValidateDefinition(definition protocol.KnowledgeDefinition) error
- func ValidateQuery(query protocol.KnowledgeQuery) error
- type Chunk
- type Direction
- type Ranked
- type Vector
Constants ¶
const ( DefaultLimit = 5 PageLimit = 100 CitationLimit = 64 * 1024 // MaxPrefixBytes bounds a plugin storage key prefix. MaxPrefixBytes = 128 )
Query and citation bounds of the protocol.
const (
Tokens = 256
)
Tokens is the largest chunk in model tokens; consecutive chunks overlap.
Variables ¶
This section is empty.
Functions ¶
func AppendVector ¶
AppendVector checks a stored vector as DecodeVector does and appends its components to values, so that many vectors share one allocation. It returns the norm of the appended components.
func CitationURL ¶
func CitationURL(citation protocol.KnowledgeCitation) string
CitationURL is the link a Node generates for an indexed chunk.
func Excluded ¶
Excluded reports a file or directory name that is never indexed: credentials, keys and tool configuration.
func Glob ¶
Glob compiles a collection filter with the reference matcher's defaults: "*" and "?" cross path separators, "**" spans whole directories, classes negate with "!" or "^", braces alternate and a backslash escapes. doublestar stops "*" at a separator, so the pattern is translated instead.
func Native ¶
Native maps an absolute source path to the directory the system resolves it to: macOS reaches /var and /tmp through links into /private.
func ValidateCitation ¶
func ValidateCitation(request protocol.KnowledgeCitationRequest) error
ValidateCitation checks a citation read.
func ValidateDefinition ¶
func ValidateDefinition(definition protocol.KnowledgeDefinition) error
ValidateDefinition checks the shape of a collection definition.
func ValidateQuery ¶
func ValidateQuery(query protocol.KnowledgeQuery) error
ValidateQuery checks a search and its filters.
Types ¶
type Direction ¶
type Direction struct {
// contains filtered or unexported fields
}
Direction is a query embedding checked once for many comparisons.
func NewDirection ¶
NewDirection checks a query embedding as Vector.Cosine does.
type Vector ¶
type Vector struct {
// contains filtered or unexported fields
}
Vector is a compact derived embedding: signed bytes under one scale.
func DecodeVector ¶
DecodeVector reads a stored vector of the collection's dimension.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package service indexes knowledge collections and answers queries and citation reads.
|
Package service indexes knowledge collections and answers queries and citation reads. |
|
Package source reads the files of a knowledge collection.
|
Package source reads the files of a knowledge collection. |