Pinecone
Upsert and query vector embeddings in Pinecone indexes.
On this page
Connect
Auth type: API key (secret_text). Paste the API key (or token) from the provider's settings into the connect dialog. It is encrypted at rest and only decrypted on the server when an action runs.
- In the editor: Backend panel, Integrations tab, then Connect. This connects it for the project.
- For every project in a workspace: Workspace settings, Integrations.
- Owners and admins choose which integrations members may connect in the admin panel (Integrations tab), and can attach their own OAuth app there.
Call it from a workflow
Pass the action name and its input. The call resolves with { success, output, error? }; a missing connection resolves with success false and the reason. See ctx.integrations.invoke and ctx.integrations.call.
// .workflow.js (native ctx)
export async function run(ctx) {
const res = await ctx.integrations.invoke("pinecone", "create_index", {
"name": "<index name>",
"dimension": 1,
"indexType": "serverless"
});
if (!res.success) throw new Error(res.error);
ctx.log.info("Pinecone answered", { output: res.output });
}// defineWorkflow module (@app/sdk ctx)
import { defineWorkflow } from "@app/sdk";
export default defineWorkflow({
id: "pinecone-create-index",
name: "Pinecone: Create Index",
description: "Calls Pinecone when a row is created.",
trigger: { type: "entity_event", entity: "tickets", event: "created" },
async run(ctx, event) {
const res = await ctx.integrations.call("pinecone", {
"action": "create_index",
"name": "<index name>",
"dimension": 1,
"indexType": "serverless"
}) as { success: boolean; error?: string };
if (!res.success) throw new Error(res.error);
},
});curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/pinecone/create_index" \
-H "Authorization: Bearer $APP_KEY" \
-H "content-type: application/json" \
-d '{"props":{"name":"<index name>","dimension":1,"indexType":"serverless"}}'Actions
create_indexin catalog
Create Index. Creates a new Pinecone index with custom settings.
| Input | Type | Description |
|---|---|---|
namerequired | text | You must pass a non-empty string for name in order to create an index |
dimensionrequired | number | You must pass a positive integer for dimension in order to create an index. For dense indexes, this is required. |
indexTyperequired | one of "serverless" | "pod" | Choose between serverless or pod-based index deployment |
cloudoptional | one of "aws" | "gcp" | "azure" | The public cloud where you would like your index hosted (for serverless) |
regionoptional | text | The region where you would like your index to be created (for serverless) |
environmentoptional | text | The environment where the index is hosted (for pod-based indexes) |
podTypeoptional | one of "s1.x1" | "s1.x2" | "s1.x4" | "s1.x8" | "p1.x1" | "p1.x2" | "p1.x4" | "p1.x8" | "p2.x1" | "p2.x2" | "p2.x4" | "p2.x8" | The type of pod to use |
replicasoptional | number | The number of replicas. Replicas duplicate your index for higher availability and throughput. |
shardsoptional | number | The number of shards. Shards split your data across multiple pods. |
podsoptional | number | The number of pods to be used in the index. This should be equal to shards x replicas. |
metricoptional | one of "cosine" | "euclidean" | "dotproduct" | The distance metric to use. Defaults to cosine for dense indexes, dotproduct for sparse indexes. |
vectorTypeoptional | one of "dense" | "sparse" | The type of vectors to store. Dense is default for most use cases. |
deletionProtectionoptional | boolean | Enable deletion protection for the index |
waitUntilReadyoptional | boolean | Wait until the index is ready to receive data before completing |
suppressConflictsoptional | boolean | Do not throw if you attempt to create an index that already exists |
tagsoptional | JSON | Optional tags for the index (e.g., {"team": "data-science"}) |
sourceCollectionoptional | text | The name of the collection to be used as the source for the index |
delete_vectorin catalog
Delete a Vector. Delete vectors by ID from a namespace.
| Input | Type | Description |
|---|---|---|
indexNamerequired | text | The name of the index to delete vectors from |
indexHostoptional | text | The unique host for the index (optional, see Pinecone docs for targeting an index) |
namespaceoptional | text | The namespace to delete vectors from (e.g., "example-namespace") |
deleteModerequired | one of "one" | "many" | "all" | "filter" | Choose how to delete vectors |
idoptional | text | The ID of the vector to delete (for single vector deletion) |
idsoptional | array | Array of vector IDs to delete (e.g., ["id-2", "id-3"]) |
confirmDeleteAlloptional | boolean | Check this box to confirm you want to delete ALL vectors in the namespace |
filteroptional | JSON | Metadata filter expression to select vectors to delete. Examples: • {"genre": {"$eq": "documentary"}} • {"year": {"$gt": 2019}} • {"$and": [{"genre": "comedy"}, {"year": {"$gte": 2020}}]} |
get_vectorin catalog
Get a Vector. Look up and return vectors by ID from a namespace.
| Input | Type | Description |
|---|---|---|
indexNamerequired | text | The name of the index to fetch vectors from |
indexHostoptional | text | The unique host for the index (optional, see Pinecone docs for targeting an index) |
idsrequired | array | The vector IDs to fetch. Does not accept values containing spaces (e.g., ["id-1", "id-2"]) |
namespaceoptional | text | The namespace containing the vectors to fetch (e.g., "example-namespace") |
search_indexin catalog
Search Index. Search indexes by name or list all indexes in your project.
| Input | Type | Description |
|---|---|---|
searchModerequired | one of "list" | "find" | Choose how to search for indexes |
indexNameoptional | text | The name of the specific index to search for (when using Find Specific Index mode) |
nameFilteroptional | text | Filter indexes by name (partial match, case-insensitive) |
search_vectorin catalog
Search Vectors. Search a namespace using a query vector to find similar records.
| Input | Type | Description |
|---|---|---|
indexNamerequired | text | The name of the index to search in |
indexHostoptional | text | The unique host for the index (optional, see Pinecone docs for targeting an index) |
topKrequired | number | The number of results to return for each query (range: 1-10000) |
namespaceoptional | text | The namespace to query (e.g., "example-namespace") |
queryMethodrequired | one of "vector" | "id" | Choose how to provide the query |
vectoroptional | array | The query vector. This should be the same length as the dimension of the index (e.g., [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]) |
idoptional | text | The unique ID of the vector to be used as a query vector (max length: 512) |
sparseIndicesoptional | array | Array of indices for sparse vector data (optional) |
sparseValuesoptional | array | Array of sparse values corresponding to indices (must be same length as indices) |
filteroptional | JSON | Filter to apply using vector metadata. Examples: • {"genre": {"$eq": "documentary"}} • {"year": {"$gt": 2019}} • {"$and": [{"genre": {"$in": ["comedy", "drama"]}}, {"year": {"$gte": 2020}}]} |
includeValuesoptional | boolean | Whether vector values are included in the response |
includeMetadataoptional | boolean | Whether metadata is included in the response |
update_vectorin catalog
Update a Vector. Updates a vector in a namespace. Overwrites existing values and metadata.
| Input | Type | Description |
|---|---|---|
indexNamerequired | text | The name of the index containing the vector to update |
indexHostoptional | text | The unique host for the index (optional, see Pinecone docs for targeting an index) |
idrequired | text | Vector's unique id (required, string length: 1 - 512) |
namespaceoptional | text | The namespace containing the vector to update (e.g., "example-namespace") |
valuesoptional | array | Vector data to update (e.g., [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]) |
sparseIndicesoptional | array | Array of indices for sparse values (optional) |
sparseValuesoptional | array | Array of sparse values corresponding to indices (must be same length as indices) |
metadataoptional | array | Key-value pairs to set for the vector |
upsert_vector
Upsert Vector. Upsert vectors into a namespace. Overwrites existing vectors with the same ID.
| Input | Type | Description |
|---|---|---|
indexNamerequired | text | The name of the index to upsert vectors into |
indexHostoptional | text | The unique host for the index (optional, see Pinecone docs for targeting an index) |
namespaceoptional | text | The namespace where you upsert vectors (e.g., "example-namespace") |
vectorsInputrequired | one of "single" | "multiple" | Choose how to provide vector data |
idoptional | text | The unique identifier for the vector (e.g., "vec1") |
valuesoptional | array | Array of numbers representing the vector (e.g., [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]) |
vectorsoptional | array | Array of vectors to upsert (for multiple vectors input) |
Details
- Id
pinecone- Category
- Data and storage
- Tags
- vector, embeddings, ai, similarity-search
- Package
@activepieces/piece-pinecone@0.1.3- Tier
- Community