Help us shape the future of Go! Take the 2026 Go Developer Survey

toolstore

package
v0.29.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

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