Class PineconePlugin

java.lang.Object
com.google.genkit.plugins.pinecone.PineconePlugin
All Implemented Interfaces:
Plugin

public class PineconePlugin extends Object implements Plugin
Pinecone plugin for Genkit providing vector database functionality.

Example usage:


 Genkit genkit = Genkit.builder().plugin(GoogleGenAIPlugin.create(apiKey))
 		.plugin(PineconePlugin.builder().apiKey(System.getenv("PINECONE_API_KEY")).addIndex(PineconeIndexConfig
 				.builder().indexName("my-index").embedderName("googleai/text-embedding-004").build()).build())
 		.build();
 
  • Method Details

    • builder

      public static PineconePlugin.Builder builder()
      Creates a new builder for PineconePlugin.
    • create

      public static PineconePlugin.Builder create(String apiKey)
      Creates a PineconePlugin with the specified API key.
      Parameters:
      apiKey - the Pinecone API key
      Returns:
      a builder for further configuration
    • getName

      public String getName()
      Description copied from interface: Plugin
      Returns the unique identifier for the plugin. This name is used for registration and lookup.
      Specified by:
      getName in interface Plugin
      Returns:
      the plugin name
    • init

      public List<Action<?,?,?>> init()
      Description copied from interface: Plugin
      Initializes the plugin. This method is called once during Genkit initialization. The plugin should return a list of actions that it provides.
      Specified by:
      init in interface Plugin
      Returns:
      list of actions provided by this plugin
    • init

      public List<Action<?,?,?>> init(Registry registry)
      Description copied from interface: Plugin
      Initializes 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).

      Specified by:
      init in interface Plugin
      Parameters:
      registry - the Genkit registry for resolving dependencies
      Returns:
      list of actions provided by this plugin
    • getVectorStore

      public PineconeVectorStore getVectorStore(String indexName)
      Gets a vector store by index name.
      Parameters:
      indexName - the index name
      Returns:
      the vector store, or null if not found
    • getVectorStore

      public PineconeVectorStore getVectorStore(String indexName, String namespace)
      Gets a vector store by index name and namespace.
      Parameters:
      indexName - the index name
      namespace - the namespace
      Returns:
      the vector store, or null if not found
    • getClient

      public io.pinecone.clients.Pinecone getClient()
      Gets the Pinecone client.