pgvector

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() plugin.Plugin

New creates a new Plugin instance.

Types

type Config

type Config struct {
	EmbeddingProvider string `json:"embedding_provider"` // embedding provider name (e.g., "openai")
	EmbeddingModel    string `json:"embedding_model"`    // embedding model name (e.g., "text-embedding-3-small")
	Dimensions        int    `json:"dimensions"`         // vector dimensions (default 1536)
	DefaultCollection string `json:"default_collection"` // default collection to create on init (optional)
}

Config controls pgvector plugin behavior.

type Plugin

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

Plugin implements vector similarity search using the pgvector PostgreSQL extension. Workflows can store and query embedding vectors with metadata.

func (*Plugin) Info

func (p *Plugin) Info() plugin.PluginInfo

Info returns plugin metadata for discovery and documentation.

func (*Plugin) Init

func (p *Plugin) Init(ctx context.Context, env *plugin.Environment) error

Init initializes the plugin with the given environment. It parses optional configuration, ensures the pgvector extension is installed, and optionally creates a default collection.

func (*Plugin) Migrations

func (p *Plugin) Migrations() []plugin.Migration

Migrations returns the database schema for pgvector collections and embeddings. Tables are idempotent (IF NOT EXISTS) and safe to run multiple times.

func (*Plugin) RegisterHostFunctions

func (p *Plugin) RegisterHostFunctions(scope plugin.FuncRegistry) error

RegisterHostFunctions registers workflow-callable functions on the scoped function registry. The plugin name is implicit -- each plugin gets its own scope, so function names need not be globally unique.

Jump to

Keyboard shortcuts

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