Connecting to

To use as a vector database, create a "vector-database" resource in your configuration.yaml file.

    - type: "vector-database"
      name: "PineconeDatasource"
        service: "pinecone"
        api-key: "${secrets.pinecone.api-key}"
        environment: "${secrets.pinecone.environment}"
        index-name: "${secrets.pinecone.index-name}"
        project-name: "${secrets.pinecone.project-name}"
        server-side-timeout-sec: 10

Required parameters:

  • api-key: your Pinecone API key

  • index-name: the name of the index

  • project-name: the name of the project

  • environment: the environment

You can find the api-key, index-name, project-name and enviroment in the console.

Optional parameters:

  • server-side-timeout-sec: the timeout for any server-side operation (default is 10 seconds)

Querying Pinecone

You can query Pinecone using the "vector-db-query" agent in your pipeline.

  - name: "Execute Query"
    type: "query-vector-db"
      datasource: "PineconeDatasource"
      query: |
              "vector": ?,
              "topK": 5,
                {"$or": [{"genre": "comedy"}, {"year":2019}]}
        - "value.embeddings"
      output-field: "value.query-result"

To perform the query, define the JSON for the request to the Pinecone API. As usual you can use the '?' symbol as a placeholder for the fields that you specify in the "query" section.

Writing to Pinecone

You can write to Pinecone using the "vector-db-sink" agent in your pipeline.

  - name: "Write to Pinecone"
    type: "vector-db-sink"
      datasource: "PineconeDatasource" ""
      vector.vector: "value.embeddings"
      vector.namespace: ""
      vector.metadata.genre: "value.genre"

To write to Pinecone, define the values for the, vector.vector and vector.metadata fields. You can add as many vector.metadata fields as you want, but you need to specify the prefix "vector.metadata." for each field.


Check out the full configuration properties in the API Reference page.

Last updated