Skip to main content
Pinecone Assistant answers questions about documents you upload, and cites the parts of each document it used. This is known as retrieval-augmented generation (RAG). In this quickstart, you use a Pinecone SDK to create an assistant, upload a sample financial filing, and ask the assistant a question about it.
To get started in your browser, use the Assistant Quickstart colab notebook.
1

Install an SDK

The Pinecone Python SDK and Node.js SDK provide programmatic access to the Assistant API. The Python SDK requires Python 3.10 or later, and the Node.js SDK requires Node.js 22 or later.
2

Get an API key

You need an API key to make calls to your assistant. Create a new API key in the Pinecone console, or use the widget below to generate one. If you don’t have a Pinecone account, the widget signs you up for the free Starter plan.
Your generated API key:
If you generate a key with the widget, the code samples on this page include it. Otherwise, replace YOUR_API_KEY in the samples with your key.
3

Create an assistant

Create an assistant named example-assistant. The instructions apply to every response the assistant gives, and region sets where the assistant is deployed (us or eu).The Python SDK waits until the assistant is ready before it returns. The Node.js SDK returns right away, so the example checks the assistant’s status until it’s no longer Initializing.
4

Upload a file

Download the sample file, a Netflix 10-K filing, to your local device. Then upload it to your assistant, replacing /path/to/ with the folder you saved it in. The metadata is optional. It’s returned with each citation, and you can use it to filter which files the assistant uses.The assistant has to process the file before it can answer questions about it, which can take a few minutes. The Python SDK waits until processing finishes. The Node.js SDK returns an operation, so the example checks the operation’s status until it’s Completed.
5

Chat with the assistant

Chat with the assistant by asking it a question about the file:
The assistant answers from the uploaded file:
Output
The response also includes citations. Each citation marks a position in the answer and lists the file and pages that support it. The full API response looks like the following:
Response
signed_url provides temporary, read-only access to the relevant file. Anyone with the link can access the file, so treat it as sensitive data. Expires in one hour.
6

Clean up

When you no longer need example-assistant, delete it:
Deleting an assistant also deletes all files uploaded to the assistant.

Next steps