retrieval

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package retrieval implements RAG search logic for Creel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Chunk   *store.Chunk
	TopicID string
	Score   float64
}

Result represents a single search result with context.

type Searcher

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

Searcher performs ACL-filtered vector similarity search.

func NewSearcher

func NewSearcher(chunkStore *store.ChunkStore, authorizer auth.Authorizer, backend vector.Backend) *Searcher

NewSearcher creates a new Searcher.

func (*Searcher) Search

func (s *Searcher) Search(ctx context.Context, principal *auth.Principal, topicIDs []string, queryEmbedding []float64, topK int, metadataFilter map[string]any) ([]Result, error)

Search performs an ACL-filtered similarity search. If topicIDs is empty, it searches all topics accessible to the principal.

Jump to

Keyboard shortcuts

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