Pinecone is a vector database that can be used as a source or destination within your mixpeek pipeline.

Setup connection

First we’ll need to create the pinecone connection, which returns a connection_id we use that when we create the pipeline from S3 to Pinecone.

Python
from mixpeek import Mixpeek

mixpeek = Mixpeek('API_KEY')

connection_id = mixpeek.connections.create(
    alias="my-pinecone",
    engine="pinecone",
    details={
        "api_key": "your_api_key",
        "environment": "your_environment",
        "index_name": "your_index_name"
    }
)

Create the pipeline

Assuming we already have our source connection_id ready, which if using S3 can be done here: S3 connection we can then map it in our Pipeline:

Python
pipeline_id = mixpeek.pipelines.create(
  alias="MyPipeline",
  code="function execute() { return true; }",
  source={
    "connection_id": "conn_456",
    "filters": {
      "foo": "bar"
    }
  },
  destination={
    "connection_id": "conn_431",
    "namespace": "my_pinecone_namespace",
    "metadata": {
      "type": "storage"
    }
  }
)

Notice how we have a namespace key, this is where the data from the pipeline’s response will be sent.

Enable the pipeline

mixpeek.pipelines.enable(
    pipeline_id="123",
    enable=True
)

Once done, all S3 object changes will be sent to your Pinecone namespace: my_pinecone_namespace.