Pinecone Assistant Plugin
The `pinecone-plugin-assistant` library provides an interface for interacting with Pinecone's Assistant APIs, enabling users to create, manage, and chat with AI assistants. As of Pinecone Python SDK v7.0.0, the functionalities provided by this plugin are bundled directly within the main `pinecone` package. It is currently at version 3.0.3 and is actively maintained as part of the broader Pinecone ecosystem, with its release cadence tied to the main Pinecone SDK releases.
Warnings
- breaking As of Pinecone Python SDK v7.0.0, the functionality of `pinecone-plugin-assistant` is bundled directly into the main `pinecone` package. Installing `pinecone-plugin-assistant` separately is no longer required and may be redundant or cause conflicts if using `pinecone` v7.0.0 or newer.
- gotcha When using `pinecone-plugin-assistant` (especially when bundled with the main `pinecone` SDK), IDE autocomplete and intellisense tools may have difficulty recognizing the dynamically attached functionality, such as `pc.assistant.<method>`. This can lead to warnings about modules not existing or untyped elements in your IDE.
- breaking The main `pinecone` SDK (which now bundles assistant functionality) requires Python 3.10 or later. Python 3.9 is no longer supported as of the Pinecone SDK release on November 18, 2025.
- gotcha Version 0.1.2 of `pinecone-plugin-assistant` had a critical bug where the API key was not correctly set on requests, resulting in `UnauthorizedException` (HTTP 401) errors.
- gotcha Version 2.0.0 of `pinecone-plugin-assistant` had a strict dependency pin on `packaging` (`>=24.2,<25.0`), which could cause dependency resolution conflicts with other libraries (e.g., `xai-sdk`) requiring `packaging >=25.0`.
Install
-
pip install pinecone -
pip install pinecone-plugin-assistant
Imports
- Pinecone
from pinecone import Pinecone
- Message
from pinecone_plugins.assistant.models.chat import Message
Quickstart
import os
from pinecone import Pinecone
from pinecone_plugins.assistant.models.chat import Message
# Ensure PINECONE_API_KEY is set as an environment variable
api_key = os.environ.get('PINECONE_API_KEY', '')
if not api_key:
raise ValueError("PINECONE_API_KEY environment variable not set.")
pc = Pinecone(api_key=api_key)
assistant_name = "my-test-assistant"
try:
# Create an assistant
assistant = pc.assistant.create_assistant(
assistant_name=assistant_name,
instructions="Answer questions concisely."
)
print(f"Assistant '{assistant.name}' created.")
# Example chat interaction
user_message = Message(content="What is the capital of France?")
response = assistant.chat_completions(messages=[user_message])
print("Assistant's response:")
for choice in response.choices:
print(choice.message.content)
except Exception as e:
print(f"An error occurred: {e}")
finally:
# Clean up (optional): delete the assistant
try:
pc.assistant.delete_assistant(assistant_name=assistant_name)
print(f"Assistant '{assistant_name}' deleted.")
except Exception as e:
print(f"Failed to delete assistant: {e}")