rag

package
v0.0.0-...-ff5bb02 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrToolsetIndexRevisionSuperseded = errors.New("toolset index revision is superseded")

Functions

This section is empty.

Types

type MatchMode

type MatchMode string
const (
	MatchModeAny MatchMode = "any"
	MatchModeAll MatchMode = "all"
)

type SearchToolsOptions

type SearchToolsOptions struct {
	Query     string
	Tags      []string
	MatchMode MatchMode
	Limit     int
}

type ToolSearchResult

type ToolSearchResult struct {
	// ToolURN identifies the source tool independently of runtime variations.
	ToolURN string

	// ToolName is the name stored in the embedding payload.
	ToolName string

	// Tags are the indexed tags associated with the tool.
	Tags []string

	// SimilarityScore is the vector similarity between the query and tool.
	SimilarityScore float64
}

ToolSearchResult represents a search result with stable tool identity and ranking metadata.

type ToolsetIndexRevision

type ToolsetIndexRevision struct {
	ToolsetID      uuid.UUID
	ToolsetVersion int64
	DeploymentID   uuid.UUID
}

type ToolsetVectorStore

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

func NewToolsetVectorStore

func NewToolsetVectorStore(
	logger *slog.Logger,
	tracerProvider trace.TracerProvider,
	db *pgxpool.Pool,
	chatClient openrouter.CompletionClient,
) *ToolsetVectorStore

func (*ToolsetVectorStore) GetToolsetAvailableTags

func (s *ToolsetVectorStore) GetToolsetAvailableTags(ctx context.Context, toolset types.Toolset) ([]string, error)

func (*ToolsetVectorStore) IndexToolset

func (s *ToolsetVectorStore) IndexToolset(
	ctx context.Context,
	toolset types.Toolset,
	revision ToolsetIndexRevision,
) (err error)

func (*ToolsetVectorStore) SearchToolsetTools

func (s *ToolsetVectorStore) SearchToolsetTools(ctx context.Context, toolset types.Toolset, opts SearchToolsOptions) (matches []*ToolSearchResult, err error)

func (*ToolsetVectorStore) ToolsetToolsAreIndexed

func (s *ToolsetVectorStore) ToolsetToolsAreIndexed(ctx context.Context, toolset types.Toolset) (indexed bool, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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