Skip to main content
One document index handles both kinds of search: by meaning, and by exact terms like IDs, error codes, and phrases. You upsert plain text, and Pinecone embeds it for you with integrated embedding.

Prerequisites

Let your agent set it up

The quickest way to start is to let your AI coding agent do the setup: it designs your schema, ingests your data, and runs your first query, all conversationally. The steps below cover Claude Code and Codex, which share the same Pinecone skills. Using Cursor or another agent? See all supported AI coding tools for the equivalent setup.
1

Set your API key and install the plugin

The plugin needs Node.js and uv installed. The quickstart skill uses uv to run its bundled Python scripts.
Terminal
Installing the plugin requires access to the official Anthropic marketplace. Claude Code adds this access automatically the first time you start it. If the install fails with a Marketplace "claude-plugins-official" not found error, your network or your organization’s Claude Code setup is probably blocking it.
Restart Claude Code to activate the plugin.
2

Run the quickstart command

Claude Code

Set it up yourself

Build the index with an SDK or the REST API. Its chunk_text field is set up the same way as the default chunk_text field in the Pinecone console’s create index form. The steps run on sample documents, so you can finish first and then use your own files.
If you already generate your own embeddings, store them in a dense_vector field instead of declaring embed. For the steps, see Bring your own vectors.
1

Install an SDK

Install the Pinecone SDK for your language. Integrated embedding needs Python SDK 10.1.0 or later (Python 3.10+), Node.js SDK 9.1.0 or later (Node.js 22+), or Go SDK 7.1.0 or later (Go 1.25+, or Go 1.26+ for SDK 7.2.0 and later). The curl examples need no SDK, but they use jq to read the index host.
The JavaScript examples use top-level await, so run them as an ES module, such as a .mjs file. The Go examples build one main function: the first block is the full program, and each later block adds to it.
2

Set your API key

Set your API key as an environment variable. The SDKs read it automatically, and the curl examples pass it in a header.
Terminal
3

Create an index

Declare one string field with both full_text_search and embed. Pinecone indexes the field’s text for keyword (BM25) search and embeds it for semantic search, so one field supports both. An empty embed config uses the default model, llama-text-embed-v2, at 1,024 dimensions. Only searchable fields go in the schema; other fields are stored on the documents as metadata (capped at 40 KB per document).
4

Load sample documents

Each document has a required _id, plain text on the chunk_text field, and any metadata you want to filter on, like category here. Pinecone embeds the text on write, so you don’t send vectors. Documents are indexed asynchronously, so the code waits 10 seconds before you search. If a search returns no results, wait a few seconds and run it again.
5

Search by meaning

Score by embed and pass the query as text. Pinecone embeds the query with the same model it used for the documents and ranks them by semantic similarity, so a question finds the right passage even when it shares no words with it. The filter limits the search to documents whose category metadata is policy.
Only the two policy documents are searched, and the refund policy ranks first:
Output
6

Search by exact terms

Score by text to rank the same field by BM25 keyword relevance, so an exact identifier like E1042 surfaces the document that contains it.
Only the document that contains the term matches:
Output
Either search accepts a filter. For phrase matching and boolean queries, see the query syntax reference.
Each search returns its own ranking, and the scores are on different scales, so don’t compare them across searches. To merge the two rankings into one list, use reciprocal rank fusion in your client.

Use your own files

To search your own documents, upsert text from your files the same way. Pinecone doesn’t extract or chunk files, so do those steps in your code before you upsert. If you already have embeddings for your files, see Bring your own vectors instead.
1

Extract text from your files

Convert each file (PDF, DOCX, HTML, and so on) to plain text using a parser of your choice. The result should be a list of records, each with an ID and text, like the docs list below.
If you’re searching images instead of text, embed them with a multimodal embedding model and store the vectors in a dense_vector field, as in Bring your own vectors.
2

Chunk the text

Split your text into smaller pieces so each one is a focused, searchable passage. The embedding model reads only the first 2,048 tokens of a value and truncates the rest, so keep chunks well under that. The function below is a simple length-based split. For smarter approaches (by sentence, token, or document structure), see chunking strategies. Each chunk ID starts with its source document’s ID, so you can later fetch, replace, or delete all of a document’s chunks at once.
3

Upsert the chunks

An index with an embed field accepts up to 96 documents per upsert, so send the chunks in batches. Then search them with the same calls as above.
For a large dataset in Python, use batch_upsert, which sends batches in parallel and returns any failed batches so you can retry them. You can’t bulk import into an index with an embed field.

Next steps