Because this quickstart relies on AI coding agents, the exact implementation may vary each time. If you run into issues, please give us feedback.
1. Choose a use case
- Search
- RAG/agents
- Recommendations
Build a semantic search system that returns ranked results from your knowledge base. This pattern is ideal for search interfaces where users need a list of relevant documents with confidence scores.In production, semantic search typically involves a single large dataset (or small number of datasets) with medium-to-high query throughput. For high-traffic applications, you may need dedicated read nodes to handle the query load efficiently.Your coding agent will:Claude Code will demonstrate:Your coding agent will implement:Your coding agent will demonstrate:This transforms your development code into production-ready code by adding resilience and observability.
2. Set up the Pinecone CLI
The Pinecone CLI handles administrative tasks like creating and managing indexes, while Pinecone SDKs are used for application code and data operations. You’ll use both in this quickstart.The CLI is in public preview.
-
Install the Pinecone CLI:
-
Log in to your Pinecone account:
If you don’t have a Pinecone account, the CLI will help you sign up.
3. Set up a coding agent
AI coding agents like Claude Code and Cursor learn from web searches and training data, which can include outdated patterns. To ensure your assistant uses current Pinecone APIs and best practices, you’ll create aCLAUDE.md
or AGENTS.md
reference file that provides authoritative, up-to-date information about Pinecone’s 2025 APIs and CLI commands.- Claude Code
- Cursor
- Open a terminal or command prompt.
-
Create a new project folder for your Pinecone application:
-
Download the reference file with authoritative Pinecone information and save it as
CLAUDE.md
in your project root:Python-only: The reference file currently features only the Pinecone Python SDK, so all generated code will be in Python. Support for other SDKs (TypeScript, Go, Java, .NET) is coming soon. -
Start Claude Code:
If you don’t have Claude Code installed, see the Claude Code quickstart.
-
Verify that Claude Code has access to the
CLAUDE.md
file: -
Ask Claude Code to set up your environment and install the Pinecone SDK:
Your coding agent will:
- Create the proper directory structure
- Set up a virtual environment
- Install required dependencies
- Create configuration files
-
Ask Claude Code to configure a Pinecone API key for your application:
Your coding agent will:
- Create an API key using CLI command
pc api-key create
- Save the API key as an env variable for the project
- Create an API key using CLI command
4. Create an index
Now that your coding agent has access to up-to-date Pinecone reference information, let’s create your first index:- Create an index using CLI command
pc index create
- Select
llama-text-embed-v2
(recommended embedding model) - Set up proper cloud/region configuration
- Verify successful creation with CLI command
pc index describe
5. Build a knowledge base
Now ask your coding agent to help you populate your index:- Proper namespace isolation
- Flat metadata only (no nested objects)
- Batch size of 96 (text records limit)
- Integrated embeddings (Pinecone handles vectorization)
6. Implement semantic search
Ask your coding agent to build a search system:- The proper search pattern (fetch 2x candidates for reranking, return
top_k
) - The
bge-reranker-v2-m3
reranking model - Correct metadata filtering with supported operators
- Proper namespace handling
7. Add error handling
Now harden your search implementation with production-ready error handling:- Wrapping search operations with
exponential_backoff_retry
- Using
PineconeException
with status code checking - Implementing the
monitored_operation
pattern for logging - Proper handling of rate limits (429) vs server errors (5xx) vs client errors (4xx)
- How retry logic recovers from transient failures automatically
- Tracking and logging failed operations
8. Clean up
When you’re done, ask your coding agent to clean up your resources:9. Give us feedback
We’d love to hear your feedback on this quickstart. Please fill out this short survey.Next steps
Index data
Learn more about storing data in Pinecone
Search
Explore different forms of vector search.
Optimize
Find out how to improve performance
Continue with a coding agent: For your next Pinecone projects, start by asking your coding agent to help you plan and implement your specific requirements. Be sure to use the Pinecone reference information in CLAUDE.md or AGENTS.md and the Pinecone documentation to ensure you’re using current best practices.