NB5 Docs► Reference Section► Drivers▼ pinecone driver adapter 🖺

pinecone driver adapter

The pinecone driver adapter is a nb adapter for the pinecone driver, an open source Java driver for connecting to and performing operations on an instance of a Pinecone Vector database. The driver is hosted on github at https://github.com/pinecone-io/pinecone-java-client

activity parameters

The following parameters must be supplied to the adapter at runtime in order to successfully connect to an instance of the Pinecone database:

Op Templates

The Pinecone adapter supports all operations supported by the Java driver published by Pinecone. The official Pinecone API reference can be found at https://docs.pinecone.io/reference/describe_index_stats_post

The operations include:

Examples

ops:
  # A pinecone query op
  query-example:
    type: query
    index: query_index
    # The query vector. Use these fields if only querying a single vector. If querying multiple use the
    # query_vectors structure below.
    vector: my_array_of_floats
    namespace: query_namespace
    # The number of results to return for each query.
    top_k: int_query_topk
    # You can use vector metadata to limit your search. See https://www.pinecone.io/docs/metadata-filtering/
    filter:
      filterfield: metadata_field
      operator: [$lt, $eq, $gt, ...]
      comparator: value
    # Indicates whether vector values are included in the response.
    include_values: boolean
    # Indicates whether metadata is included in the response as well as the ids.
    include_metadata: boolean
    query_vectors:
      - id: 1
        values: csv_separated_floats
        top_k: int_val
        namespace: string_val
        filter:
          filterfield: metadata_field
          operator: [$lt, $eq, $gt, ...]
          comparator: value
        sparse_values:
          indices: list_of_ints
          values: list_of_floats
      - id: 2
        values: csv_separated_floats
        top_k: int_val
        namespace: string_val
        filter:
          filterfield: metadata_field
          operator: [$lt, $eq, $gt, ...]
          comparator: value
        sparse_values:
          indices: list_of_ints
          values: list_of_floats

# A delete op
# If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive
# with specifying ids to delete in the ids param or using delete_all=True. delete_all indicates that all vectors
# in the index namespace should be deleted.
  delete-example:
    type: delete
    index: delete_index
    namespace: delete_namespace
    ids: csv_list_of_vectors_to_delete
    deleteall: [true,false]
    filter:
      filterfield: metadata_field
      operator: [$lt, $eq, $gt, ...]
      comparator: value

# A describe index stats op. Specify metadata filters to narrow the range of indices described.
  describe-index-stats-example:
    type: describe-index-stats
    index: describe_index
    filter:
      filterfield: metadata_field
      operator: [$lt, $eq, $gt, ...]
      comparator: value

# A pinecone fetch op
  fetch-example:
    fetch: fetch_index
    namespace: fetch_namespace
    ids: csv_list_of_vectors_to_fetch

# A pinecone update op
  update-example:
    type: update
    index: update_index
    id: string_id
    values: list_of_floats
    namespace: update_namespace
    metadata:
      key1: val1
      key2: val2
      key3: val3
    sparse_values:
      indices: list_of_ints
      values: list_of_floats

# A pinecone upsert op
  upsert-example:
    type: upsert
    index: upsert_index
    namespace: upsert_namespace
    upsert_vectors:
      - id: 1
        values: csv_separated_floats
        sparse_values:
          indices: list_of_ints
          values: list_of_floats
        metadata:
          key1: val1
          key2: val2
      - id: 2
        values: csv_separated_floats
        sparse_values:
          indices: list_of_ints
          values: list_of_floats


Back to top