### Pinecone FTS Index Setup and Search Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-full-text-search/SKILL.md This Python script demonstrates the end-to-end process of setting up a Pinecone index for full-text search with filterable metadata. It includes schema definition, index creation, document upsertion, and a search query combining text relevance and metadata filtering. Ensure you have the Pinecone client installed and your API key configured. ```python import time from pinecone import Pinecone from pinecone.preview import SchemaBuilder INDEX_NAME = "my-fts-index" # TODO: name your index (lowercase alphanumeric + hyphens, ≤45 chars) NAMESPACE = "__default__" # TODO: pick a namespace; auto-created on first upsert pc = Pinecone() # reads PINECONE_API_KEY # TODO: preprod backends require an x-environment header on the client: # pc = Pinecone(additional_headers={"x-environment": "preprod-aws-0"}) # 1. Schema — one FTS string field, one filterable string, one filterable float. # Field names must NOT start with `_` (reserved for `_id` / `_score`) or `$` # (reserved for filter operators), and are limited to 64 bytes. schema = ( SchemaBuilder() .add_string_field("body", full_text_search={"language": "en"}) # TODO: rename for your content .add_string_field("category", filterable=True) # TODO: any exact-match metadata .add_integer_field("year", filterable=True) # TODO: any numeric filter — emits `"type": "float"` on the wire .build() ) # 2. Create the index. read_capacity defaults to {"mode": "OnDemand"}; pass # {"mode": "Dedicated", ...} only if you specifically want provisioned reads. if not pc.preview.indexes.exists(INDEX_NAME): pc.preview.indexes.create(name=INDEX_NAME, schema=schema) # 3. Wait for the index itself to become Ready. while not pc.preview.indexes.describe(INDEX_NAME).status.ready: time.sleep(5) idx = pc.preview.index(name=INDEX_NAME) # 4. Upsert a single document. `_id` is required, every other field is optional. # upsert REPLACES the document on conflict — there is no per-field merge in 2026-01.alpha. idx.documents.upsert( namespace=NAMESPACE, documents=[ { "_id": "doc-1", "body": "Full-text search is great for keyword queries.", "category": "intro", "year": 2025.0, } ], ) # 5. Poll until the FTS side is searchable (upsert returns BEFORE docs are indexed). deadline = time.time() + 300 while time.time() < deadline: resp = idx.documents.search( namespace=NAMESPACE, top_k=1, score_by=[{"type": "text", "field": "body", "query": "search"}], # TODO: sentinel query likely to hit include_fields=[], # required on every search; [] = lightest payload (ids + _score only) ) if resp.matches: break time.sleep(5) # 6. Search — text scoring composed with metadata filter. resp = idx.documents.search( namespace=NAMESPACE, top_k=5, score_by=[{"type": "text", "field": "body", "query": "keyword queries"}], filter={"year": {"$gte": 2024}}, # TODO: adjust filter or drop it include_fields=["*"], # "*" = all stored fields; [] = `_id` + `_score` only ) for m in resp.matches: print(m._id, getattr(m, "_score", getattr(m, "score", None)), m.to_dict()) ``` -------------------------------- ### Install Pinecone Skill Library Source: https://context7.com/pinecone-io/skills/llms.txt Install the Pinecone Agent Skills library using npm. ```bash # Install the skill library npx skills add pinecone-io/skills ``` -------------------------------- ### Copy Quickstart Script Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-quickstart/SKILL.md Copies a complete Python quickstart script to the current working directory. This script handles index creation, upserting, querying, and reranking. ```bash cp scripts/quickstart_complete.py ./pinecone_quickstart.py ``` -------------------------------- ### Multi-Step Request Example Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-assistant/SKILL.md Demonstrates a multi-step request involving creating an assistant, uploading files, and then asking a question. ```bash uv run scripts/create.py --name docs-bot uv run scripts/upload.py --assistant docs-bot --source ./docs uv run scripts/chat.py --assistant docs-bot --message "what are the main features?" ``` -------------------------------- ### Install uv Source: https://context7.com/pinecone-io/skills/llms.txt Install uv, a fast Python package installer and virtual environment manager, used for running bundled Python scripts. ```bash # Optional: uv (runs bundled Python scripts) # https://docs.astral.sh/uv/getting-started/installation/ ``` -------------------------------- ### Example Upload Command Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-assistant/references/upload.md Use this command to upload files from a directory to a specified assistant. You can customize patterns to include or exclude specific file types. ```bash uv run scripts/upload.py \ --assistant "assistant-name" \ --source "./docs" \ --patterns "*.md,*.pdf" ``` -------------------------------- ### Install Pinecone CLI Source: https://context7.com/pinecone-io/skills/llms.txt Install the Pinecone CLI tool using Homebrew. This enables the `pinecone-cli` skill. ```bash # Optional: Pinecone CLI (enables pinecone-cli skill) brew tap pinecone-io/tap && brew install pinecone-io/tap/pinecone ``` -------------------------------- ### Metadata Example Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-assistant/references/upload.md Include additional metadata in JSON format to enrich your uploaded documents. This can be useful for tracking sources or versions. ```bash --metadata '{"source":"github","repo":"owner/repo","branch":"main"}' ``` -------------------------------- ### Perform Semantic Search with MCP Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-quickstart/SKILL.md Query your Pinecone index using the MCP `search-records` tool. This example demonstrates semantic search by querying for "getting things done efficiently", which retrieves relevant text embeddings. ```yaml index: quickstart-skills namespace: example-namespace query: topK: 3 inputs: text: "getting things done efficiently" ``` -------------------------------- ### Install Pinecone CLI on macOS Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/SKILL.md Use Homebrew to install the Pinecone CLI on macOS. Download from GitHub Releases for Linux and Windows. ```bash brew tap pinecone-io/tap brew install pinecone-io/tap/pinecone ``` -------------------------------- ### Upload a directory with patterns Source: https://context7.com/pinecone-io/skills/llms.txt Uploads files from a local directory to a Pinecone assistant, filtering by specified patterns. Ensure the 'uv' command-line tool is installed and configured. ```bash uv run scripts/upload.py \ --assistant docs-bot \ --source ./docs \ --patterns "*.md,*.pdf" ``` -------------------------------- ### Install Pinecone CLI Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-help/SKILL.md Install the Pinecone CLI tool using Homebrew. This command allows you to manage Pinecone indexes and perform batch operations from your terminal. ```bash brew tap pinecone-io/tap && brew install pinecone-io/tap/pinecone ``` -------------------------------- ### Install Pinecone CLI on macOS Source: https://context7.com/pinecone-io/skills/llms.txt Install the Pinecone CLI using Homebrew on macOS. Ensure you have Homebrew installed before running these commands. ```bash # macOS brew tap pinecone-io/tap brew install pinecone-io/tap/pinecone ``` -------------------------------- ### describe-index Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-mcp/SKILL.md Get configuration details for a specific index. ```APIDOC ## describe-index ### Description Get configuration details for a specific index — cloud, region, dimension, metric, embedding model, field map, and status. ### Method GET ### Endpoint /describe-index ### Parameters #### Query Parameters - **name** (string) - Required - Index name ``` -------------------------------- ### List, Describe, and Get Stats for Pinecone Indexes Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/command-reference.md Commands to view a summary or detailed information about your Pinecone indexes, including host, embed, and tags. JSON output is available for programmatic use. ```bash pc index list # Summary view ``` ```bash pc index list --wide # Additional columns (host, embed, tags) ``` ```bash pc index list -j # JSON output ``` ```bash pc index describe -n my-index ``` ```bash pc index describe -n my-index -j ``` ```bash pc index stats -n my-index ``` ```bash pc index stats -n my-index --filter '{"genre":{"$eq":"rock"}}' ``` -------------------------------- ### Pinecone Search Query Example Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-full-text-search/references/onboarding-walkthrough.md Example of a Pinecone documents search query using score_by for text relevance and including all fields. Refer to querying documentation for variations. ```python idx.documents.search( score_by=[{"type":"text", "field":"", "query":""}], include_fields=["*"], top_k=3 ) ``` -------------------------------- ### Example Record for Upsert Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-mcp/SKILL.md This is an example of a record structure expected by the `upsert-records` tool. Ensure records have an `_id` or `id` and include the text field specified in the index's `fieldMap`. ```json { "_id": "rec1", "chunk_text": "The Eiffel Tower was built in 1889.", "category": "architecture" } ``` -------------------------------- ### Execute Chat with Assistant Command Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-assistant/references/chat.md Use this command to send a message to a specific assistant and get a response. Ensure the assistant name and message are provided. ```bash uv run scripts/chat.py \ --assistant "assistant-name" \ --message "user's question" ``` -------------------------------- ### Add String Field with Full-Text Search Configuration Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-full-text-search/references/schema-design.md Configure a string field to support full-text search. This example shows how to enable English language search with stemming enabled, and includes a description for LLM-driven workflows. ```python .add_string_field( "body", full_text_search={"language": "en", "stemming": True}, description="Full article text. Use for keyword searches, narrative phrases, and topical queries.", ) ``` -------------------------------- ### Multi-step chained request: create, upload, chat Source: https://context7.com/pinecone-io/skills/llms.txt Demonstrates a multi-step process involving creating an assistant, uploading data to it, and then querying it with a chat message. This showcases sequential command execution. ```bash uv run scripts/create.py --name docs-bot uv run scripts/upload.py --assistant docs-bot --source ./docs uv run scripts/chat.py --assistant docs-bot --message "What are the main features?" ``` -------------------------------- ### Pinecone CLI Best Practices for Authentication Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/troubleshooting.md Use interactive login for development, service accounts for CI/CD, and API keys for quick testing. ```bash pc login pc api-key create -n "my-key" --store ``` -------------------------------- ### Create a Pinecone Assistant Source: https://context7.com/pinecone-io/skills/llms.txt Create a Pinecone Assistant for document Q&A. This command sets up the assistant with a name, instructions, and region. It supports using a `.env` file for configuration. ```bash uv run scripts/create.py \ --name docs-bot \ --instructions "Use professional technical tone and cite sources." \ --region us # With .env file uv run --env-file .env scripts/create.py --name docs-bot ``` -------------------------------- ### List API Keys Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/command-reference.md Lists all available API keys. ```bash pc api-key list ``` -------------------------------- ### List Projects Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/command-reference.md Lists all available Pinecone projects. ```bash pc project list ``` -------------------------------- ### Apply Sync Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-assistant/references/sync.md Execute the sync script to upload new or changed files to the assistant. ```bash uv run scripts/sync.py --assistant my-docs --source ./docs ``` -------------------------------- ### describe-index-stats Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-mcp/SKILL.md Get statistics for an index including total record count and per-namespace breakdown. ```APIDOC ## describe-index-stats ### Description Get statistics for an index including total record count and per-namespace breakdown. ### Method GET ### Endpoint /describe-index-stats ### Parameters #### Query Parameters - **name** (string) - Required - Index name ``` -------------------------------- ### Get Pinecone Index Statistics Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/SKILL.md Command to retrieve statistics for a specific Pinecone index. ```bash pc index stats -n my-index ``` -------------------------------- ### Create Project Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/command-reference.md Creates a new Pinecone project with a specified name. The `--target` flag can be used to immediately switch to the newly created project. ```bash pc project create -n "demo-project" ``` ```bash pc project create -n "demo-project" --target ``` -------------------------------- ### Execute Sync Script Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-assistant/references/sync.md Run the sync script with specified assistant and source directories. Optional flags include `--delete-missing`, `--dry-run`, and `--yes` for automation. ```bash uv run scripts/sync.py \ --assistant "assistant-name" \ --source "./docs" \ [--delete-missing] \ [--dry-run] \ [--yes] ``` -------------------------------- ### Add Pinecone Skills Source: https://github.com/pinecone-io/skills/blob/main/README.md Use this command to add the Pinecone Agent Skills to your project. Ensure you have Node.js and npm installed. ```bash npx skills add pinecone-io/skills ``` -------------------------------- ### Preview Sync Changes Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-assistant/references/sync.md Use the `--dry-run` flag to preview changes without applying them. This is recommended before executing the actual sync. ```bash uv run scripts/sync.py --assistant my-docs --source ./docs --dry-run ``` -------------------------------- ### Create and Export API Key for SDKs Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/SKILL.md Generate an API key using the CLI and export it as an environment variable for use with Pinecone SDKs. This is necessary because `pc login` does not set `PINECONE_API_KEY`. ```bash KEY=$(pc api-key create --name agent-sdk-key --json | jq -r '.value') export PINECONE_API_KEY="$KEY" ``` -------------------------------- ### List Pinecone Assistants Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-assistant/references/list.md Use this command to list all assistants in your account. The `--files` flag shows file details, and `--json` provides output in JSON format. ```bash # Basic listing uv run scripts/list.py ``` ```bash # With file details uv run scripts/list.py --files ``` ```bash # JSON output uv run scripts/list.py --json ``` ```bash # JSON with files (useful for scripting) uv run scripts/list.py --files --json ``` -------------------------------- ### Create API Key Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/command-reference.md Creates a new API key with a specified name. Options include storing the key locally or associating it with a specific project. ```bash pc api-key create -n "my-key" ``` ```bash pc api-key create -n "my-key" --store ``` ```bash pc api-key create -n "my-key" -i proj-abc123 ``` -------------------------------- ### Get Context Snippets from Pinecone Assistant Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-assistant/SKILL.md Retrieve context snippets from a Pinecone Assistant based on a query. Specify the number of top results with --top-k. ```bash uv run scripts/context.py --assistant --query "" --top-k ``` -------------------------------- ### Create, List, Describe, and Restore Pinecone Backups Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/command-reference.md Manage backups for your Pinecone indexes. Create new backups, list existing ones, describe backup details, and restore indexes from backups. Supports enabling deletion protection on restored indexes. ```bash # Create / list / describe pc backup create -i my-index -n "nightly-backup" -d "Backup before deployment" ``` ```bash pc backup list ``` ```bash pc backup list --index-name my-index ``` ```bash pc backup describe -i ``` ```bash # Restore (creates a new index) pc backup restore -i -n restored-index ``` ```bash pc backup restore -i -n restored-index --deletion-protection enabled ``` ```bash # Check restore job status pc backup restore list ``` ```bash pc backup restore describe -i rj-abc123 ``` ```bash # Delete backup pc backup delete -i ``` -------------------------------- ### Get Pinecone Index Statistics with Filter Source: https://context7.com/pinecone-io/skills/llms.txt Retrieve statistics for a Pinecone index, applying a filter to include only data matching specific criteria. The filter is applied as a JSON string. ```bash # Stats with filter pc index stats -n my-index --filter '{"genre":{"$eq":"rock"}}' ``` -------------------------------- ### Create Pinecone Index Backup Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/SKILL.md Create a backup (snapshot) of a Pinecone index with a specified name. ```bash pc backup create -i my-index -n "my-backup" ``` -------------------------------- ### Describe Project Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/command-reference.md Displays detailed information about a specific Pinecone project using its ID. ```bash pc project describe -i proj-abc123 ``` -------------------------------- ### Automate CI/CD with Pinecone CLI Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/SKILL.md Configure authentication using client ID and secret for CI/CD environments and perform bulk vector upserts with a specified batch size. ```bash export PINECONE_CLIENT_ID="..." export PINECONE_CLIENT_SECRET="..." pc auth configure --client-id "$PINECONE_CLIENT_ID" --client-secret "$PINECONE_CLIENT_SECRET" pc index vector upsert -n my-index --file ./vectors.jsonl --batch-size 1000 ``` -------------------------------- ### Automate Pinecone Backups Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/troubleshooting.md Automate the creation of backups for your Pinecone indexes, including dynamic naming based on the current date. ```bash pc backup create -i my-index -n "daily-backup-$(date +%Y%m%d)" ``` -------------------------------- ### List assistants Source: https://context7.com/pinecone-io/skills/llms.txt Lists all available assistants with their basic information in a table format. This command provides a quick overview of the assistants managed by the system. ```bash uv run scripts/list.py ``` -------------------------------- ### Apply Sync and Delete Missing Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-assistant/references/sync.md Apply the sync and remove files from the assistant that are no longer present locally. This is useful after cleaning up local files or after a `git pull`. ```bash uv run scripts/sync.py --assistant my-docs --source ./docs --delete-missing ``` -------------------------------- ### Create Pinecone Assistant Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-quickstart/SKILL.md Invokes the Pinecone Assistant script to create a new assistant. Use `--env-file .env` if your API key is in a .env file. ```bash uv run ../pinecone-assistant/scripts/create.py --name my-assistant ``` -------------------------------- ### List assistants with file counts Source: https://context7.com/pinecone-io/skills/llms.txt Lists all assistants and includes the file count associated with each. This provides more detailed information for managing assistant data. ```bash uv run scripts/list.py --files ``` -------------------------------- ### Execute Context Retrieval Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-assistant/references/context.md Run the context retrieval script with specified assistant, query, and top-k parameters. Ensure the SDK is updated to v8.0.0+ for this functionality. ```bash uv run scripts/context.py \ --assistant "assistant-name" \ --query "search text" \ --top-k 5 ``` -------------------------------- ### Run Skill Linting Checks Source: https://github.com/pinecone-io/skills/blob/main/CLAUDE.md Execute these commands from the ../tools/ directory to lint skills, check source tags, and validate links within the skills directory. ```bash uv run ../tools/check-skills.py --skills-dir skills/ ``` ```bash uv run ../tools/check-source-tags.py --dir . ``` ```bash uv run ../tools/check-links.py --skills-dir skills/ ``` -------------------------------- ### Create Pinecone Assistant Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-assistant/SKILL.md Use this script to create a new Pinecone Assistant. Specify the assistant's name, instructions, and region. ```bash uv run scripts/create.py --name --instructions "" --region ``` -------------------------------- ### Create a Serverless Pinecone Index Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/SKILL.md Command to create a new serverless Pinecone index with specified name, dimension, metric, cloud provider, and region. ```bash pc index create -n my-index -d 1536 -m cosine -c aws -r us-east-1 ``` -------------------------------- ### Backup and Restore Pinecone Index Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/SKILL.md Create a snapshot backup of an index before a migration and restore it to a new index if necessary. Requires backup UUID for restore. ```bash # Snapshot before a migration pc backup create -i my-index -n "pre-migration" ``` ```bash # Restore to a new index if something goes wrong pc backup restore -i -n my-index-restored ``` -------------------------------- ### Chat with Pinecone Assistant Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-quickstart/SKILL.md Initiates a chat with a Pinecone Assistant, sending a message and receiving answers with citations. Use `--env-file .env` if needed. ```bash uv run ../pinecone-assistant/scripts/chat.py --assistant my-assistant --message "What are the main topics in these documents?" ``` -------------------------------- ### Bulk ingest data using a script Source: https://context7.com/pinecone-io/skills/llms.txt Uses a bundled script for recommended bulk data loading into a Pinecone index. It handles batching, error inspection, and readiness polling. Ensure the data file is in JSONL format. ```bash # Recommended for bulk loads — handles batch_upsert + error inspection + readiness polling uv run --script scripts/ingest.py \ --data processed.jsonl \ --index my-fts-index \ --sentinel-field body \ --batch-size 50 \ --namespace __default__ ``` -------------------------------- ### Upsert Sample Records into Integrated Index Source: https://context7.com/pinecone-io/skills/llms.txt Use this script to upsert sample records into a pre-created integrated index. Ensure the index exists and the PINECONE_API_KEY environment variable is set. ```bash # Step 1 – Upsert sample records into a pre-created integrated index uv run scripts/upsert.py --index quickstart-skills # Expected output: # Upserted 9 records into 'quickstart-skills' (namespace: 'example-namespace') ``` -------------------------------- ### Create Assistant CLI Command Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-assistant/references/create.md Use this command to create a new Pinecone Assistant. Specify a unique name, optional instructions for behavior, and the desired region (us or eu). ```bash uv run scripts/create.py \ --name "assistant-name" \ --instructions "instructions" \ --region "us" ``` -------------------------------- ### List Pinecone Indexes Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/SKILL.md Command to list all available Pinecone indexes. ```bash pc index list ``` -------------------------------- ### List Namespaces in Index Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/SKILL.md View all namespaces present within a specific Pinecone index. ```bash pc index namespace list -n my-index ``` -------------------------------- ### Create Serverless Index with Integrated Embeddings Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-quickstart/SKILL.md Use the Pinecone MCP `create-index-for-model` tool to set up a serverless index. This configuration uses an integrated embedding model, automatically handling text embedding. ```yaml name: quickstart-skills cloud: aws region: us-east-1 embed: model: llama-text-embed-v2 fieldMap: text: chunk_text ``` -------------------------------- ### Manage Pinecone Target Context Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/troubleshooting.md Troubleshoot 'Project not found' or 'Organization not found' errors by showing, clearing, or setting the target context. ```bash pc target --show pc target --clear pc target -o "my-org" -p "my-project" ``` -------------------------------- ### Manage Pinecone API Key Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/troubleshooting.md Check the currently configured API key and create a new one if the existing key is not working. New keys should be stored for use. ```bash pc config get-api-key pc api-key create -n "new-key" --store ``` -------------------------------- ### Backup and Restore Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/command-reference.md Commands for managing backups of Pinecone indexes, including creating, listing, describing, restoring, and deleting backups. ```APIDOC ## Backup Operations ### Description Manages backups for Pinecone indexes, enabling data protection and disaster recovery. ### Create Backup #### Usage ```bash pc backup create -i -n -d "" ``` #### Parameters - `-i`, `--index-name` (string): The name of the index to back up. - `-n`, `--name` (string): The name for the backup. - `-d`, `--description` (string): A description for the backup. ### List Backups #### Usage ```bash pc backup list [--index-name ] ``` #### Parameters - `--index-name` (string): Optional. Filter backups by index name. ### Describe Backup #### Usage ```bash pc backup describe -i ``` #### Parameters - `-i`, `--backup-uuid` (string): The UUID of the backup to describe. ### Restore Backup #### Usage ```bash pc backup restore -i -n [--deletion-protection ] ``` #### Parameters - `-i`, `--backup-uuid` (string): The UUID of the backup to restore. - `-n`, `--name` (string): The name for the new index created from the backup. - `--deletion-protection` (string): Enable or disable deletion protection for the restored index. ### List / Describe Restore Jobs #### Usage ```bash pc backup restore list pc backup restore describe -i ``` #### Parameters - `-i`, `--restore-job-uuid` (string): The UUID of the restore job to describe. ### Delete Backup #### Usage ```bash pc backup delete -i ``` #### Parameters - `-i`, `--backup-uuid` (string): The UUID of the backup to delete. ``` -------------------------------- ### Preview file sync operations Source: https://context7.com/pinecone-io/skills/llms.txt Performs a dry run of the file synchronization process, showing what changes would be made without applying them. This helps in verifying the sync operation before execution. ```bash uv run scripts/sync.py --assistant docs-bot --source ./docs --dry-run ``` -------------------------------- ### Sync Files with Pinecone Assistant Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-assistant/SKILL.md Perform an incremental sync of files with a Pinecone Assistant. Use --delete-missing to remove files not present in the source and --dry-run to preview changes. ```bash uv run scripts/sync.py --assistant --source --delete-missing --dry-run ``` -------------------------------- ### Manage Namespaces in Pinecone Index Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/command-reference.md Commands for creating, listing, describing, and deleting namespaces within a Pinecone index. Namespaces allow for logical separation of vectors. ```bash pc index namespace create -n my-index --name tenant-a ``` ```bash pc index namespace create -n my-index --name tenant-b --schema "category,brand" ``` ```bash pc index namespace list -n my-index ``` ```bash pc index namespace list -n my-index --prefix "tenant-" ``` ```bash pc index namespace describe -n my-index --name tenant-a ``` ```bash pc index namespace delete -n my-index --name tenant-a # WARNING: deletes all vectors ``` -------------------------------- ### MCP Tool: Describe Index Configuration Source: https://context7.com/pinecone-io/skills/llms.txt Use this MCP tool to retrieve details about a specific index, including its cloud provider, region, dimension, metric, embedding model, and status. ```text # MCP tool: describe-index name: quickstart-skills # Returns cloud, region, dimension, metric, embedding model, fieldMap, status ``` -------------------------------- ### Create Integrated Index, Upsert Records, and Perform Semantic Search Source: https://context7.com/pinecone-io/skills/llms.txt This Python script demonstrates creating an integrated index, upserting records with text fields, and performing semantic search. It requires the pinecone-python client and PINECONE_API_KEY. ```python #!/usr/bin/env python3 # /// script # dependencies = ["pinecone>=8.0.0"] # /// import os from pinecone import Pinecone pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"]) # Create an integrated index (Pinecone handles embedding automatically) if not pc.has_index("quickstart"): pc.create_index_for_model( name="quickstart", cloud="aws", region="us-east-1", embed={"model": "llama-text-embed-v2", "field_map": {"text": "chunk_text"}}, ) records = [ {"_id": "rec1", "chunk_text": "I've been sneezing all day and my nose won't stop running.", "category": "health"}, {"_id": "rec4", "chunk_text": "She blocked off two hours in the morning to focus without interruptions.", "category": "productivity"}, {"_id": "rec7", "chunk_text": "A red fox darted across the trail and disappeared into the underbrush.", "category": "nature"}, ] idx = pc.Index("quickstart") idx.upsert_records("example-namespace", records) # Semantic search — query words differ completely from record words results = idx.search( namespace="example-namespace", query={"top_k": 3, "inputs": {"text": "feeling ill and run down"}}, ) for hit in results["result"]["hits"]: print(f"id={hit['_id']} score={round(hit['_score'], 2)} text={hit['fields']['chunk_text']}") # Search with reranking reranked = idx.search( namespace="example-namespace", query={"top_k": 3, "inputs": {"text": "feeling ill and run down"}}, rerank={"model": "bge-reranker-v2-m3", "top_n": 3, "rank_fields": ["chunk_text"]}, ) ``` -------------------------------- ### Chat with an assistant Source: https://context7.com/pinecone-io/skills/llms.txt Initiates a chat session with a specified assistant, sending a message and receiving a response. This is useful for querying information contained within the assistant's data. ```bash uv run scripts/chat.py \ --assistant docs-bot \ --message "What are the main features described in these documents?" ``` -------------------------------- ### Verify Pinecone Target Context Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/troubleshooting.md Ensure the CLI is targeting the correct project, especially when using service accounts that might have restricted access. ```bash pc target --show ``` -------------------------------- ### Use JSON Output with Pinecone CLI for Scripting Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/troubleshooting.md Utilize JSON output with tools like `jq` for easier parsing and scripting of Pinecone CLI commands. ```bash pc index list -j | jq -r '.[] | .name' ``` -------------------------------- ### Upload Files to Pinecone Assistant Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-assistant/SKILL.md Upload files to an existing Pinecone Assistant. Specify the assistant name, source directory, and file patterns. ```bash uv run scripts/upload.py --assistant --source --patterns "" ``` -------------------------------- ### Upload a directory with metadata tagging Source: https://context7.com/pinecone-io/skills/llms.txt Uploads files to a Pinecone assistant and tags them with custom metadata. This is useful for organizing and filtering uploaded data. ```bash uv run scripts/upload.py \ --assistant docs-bot \ --source ./docs \ --metadata '{"source":"github","repo":"owner/repo","branch":"main"}' ``` -------------------------------- ### Bulk Metadata Update with Preview Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/SKILL.md Update metadata for multiple vectors based on a filter. Includes a `--dry-run` option to preview changes before applying them. ```bash # Preview first pc index vector update -n my-index \ --filter '{"env":{"$eq":"staging"}}' \ --metadata '{"env":"production"}' \ --dry-run ``` ```bash # Apply pc index vector update -n my-index \ --filter '{"env":{"$eq":"staging"}}' \ --metadata '{"env":"production"}' ``` -------------------------------- ### Describe API Key Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/command-reference.md Displays detailed information about a specific API key using its ID. ```bash pc api-key describe -i key-abc123 ``` -------------------------------- ### List Organizations Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/command-reference.md Lists all available Pinecone organizations. ```bash pc organization list ``` -------------------------------- ### Upload Documents to Assistant Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-quickstart/SKILL.md Uploads documents from a specified source directory to a Pinecone Assistant. Pinecone automatically handles chunking, embedding, and indexing. Use `--env-file .env` if needed. ```bash uv run ../pinecone-assistant/scripts/upload.py --assistant my-assistant --source ./your-docs ``` -------------------------------- ### Create Pinecone Index Source: https://github.com/pinecone-io/skills/blob/main/skills/pinecone-cli/references/command-reference.md Use this command to create a new Pinecone index. Supports serverless and sparse vector indexes, with options for integrated embedding models, deletion protection, and creating from collections. ```bash # Serverless index pc index create -n my-index -d 1536 -m cosine -c aws -r us-east-1 ``` ```bash # With integrated embedding model pc index create -n my-index -m cosine -c aws -r us-east-1 \ --model multilingual-e5-large \ --field-map text=chunk_text ``` ```bash # Sparse vector index pc index create -n sparse-index -m dotproduct -c aws -r us-east-1 --vector-type sparse ``` ```bash # With deletion protection pc index create -n my-index -d 1536 -m cosine -c aws -r us-east-1 --deletion-protection enabled ``` ```bash # From collection pc index create -n my-index -d 1536 -m cosine -c aws -r us-east-1 --source-collection my-collection ```