toolstore

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package toolstore implements a SQLite-based ToolStore for search over MCP tool metadata. It uses FTS5 for full-text search and optional embedding-based semantic search for hybrid retrieval.

Index

Constants

View Source
const (
	// DefaultMaxToolsToReturn is the maximum number of results returned to the caller.
	DefaultMaxToolsToReturn = 8

	// DefaultHybridSemanticToolsRatio controls the proportion of semantic vs FTS5
	// results in hybrid mode: 0 = all FTS5, 1 = all semantic.
	DefaultHybridSemanticToolsRatio = 0.5

	// DefaultSemanticDistanceThreshold is the maximum cosine distance for semantic search results.
	// Results with distance > threshold are filtered out in searchSemantic only.
	// Cosine distance: 0 = identical, 2 = opposite.
	DefaultSemanticDistanceThreshold = 1.0
)

Default values for configurable search parameters.

Variables

This section is empty.

Functions

func NewSQLiteToolStore

func NewSQLiteToolStore(embeddingClient types.EmbeddingClient, cfg *types.OptimizerConfig) (types.ToolStore, error)

NewSQLiteToolStore creates a new ToolStore backed by a shared in-memory SQLite database. All callers of this constructor share the same database, which is the intended production behavior (one shared store per server). If embeddingClient is non-nil, semantic search is enabled alongside FTS5. If cfg is non-nil, its search parameters override the defaults; nil values use defaults.

Types

This section is empty.

Jump to

Keyboard shortcuts

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