Class LocalVecPlugin
java.lang.Object
com.google.genkit.plugins.localvec.LocalVecPlugin
- All Implemented Interfaces:
Plugin
Local file-based vector store plugin for development and testing.
This plugin provides a simple file-based vector store implementation suitable for local development and testing. It stores document embeddings in JSON files and performs similarity search using cosine similarity.
NOT INTENDED FOR PRODUCTION USE.
Example usage with embedder name (recommended):
Genkit genkit = Genkit.builder().plugin(OpenAIPlugin.create())
.plugin(LocalVecPlugin.builder().addStore(
LocalVecConfig.builder().indexName("my-docs").embedderName("openai/text-embedding-3-small").build())
.build())
.build();
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic LocalVecPlugin.Builderbuilder()Creates a builder for LocalVecPlugin.getName()Returns the unique identifier for the plugin.init()Initializes the plugin.Initializes the plugin with access to the registry.
-
Field Details
-
PROVIDER
- See Also:
-
-
Method Details
-
builder
Creates a builder for LocalVecPlugin.- Returns:
- a new builder
-
getName
Description copied from interface:PluginReturns the unique identifier for the plugin. This name is used for registration and lookup. -
init
Description copied from interface:PluginInitializes the plugin. This method is called once during Genkit initialization. The plugin should return a list of actions that it provides. -
init
Description copied from interface:PluginInitializes the plugin with access to the registry. This method is called once during Genkit initialization. The plugin should return a list of actions that it provides.Override this method instead of
Plugin.init()when your plugin needs to resolve dependencies from the registry (e.g., embedders, models).
-