Skip to the content.

Pinecone Java Client

Java CI with Maven


The Pinecone Java Client is an unofficial Java library for interacting with PineconeDB, a vector database ideal for building vector search applications. This client library facilitates operations such as fetching index statistics, querying, and performing upsert and delete operations in PineconeDB.

In addition to these vector operations, the Pinecone Java Client also provides an Index Client for managing indices in PineconeDB. The Index Client allows you to create, delete, and list indices, as well as manage collections within those indices. This makes it easy to organize your data in PineconeDB and perform operations on specific subsets of your data.

Vector Operation Features

Index Operation/Management



The Pinecone Java Client is now hosted on Maven Central. Include the following dependency in your project’s build file:

<!-- -->


A Sample SpringBoot Web app that is built to show the usage of this client is available at pinecone-console, which can be used as a reference to build your own application. This project is still a WIP, and will be updated with more features and examples.

Initializing the Client

PineconeDBClient client = new PineconeDBClient("environment", "projectId", "apiKey");

Fetching Index Statistics

Response statsResponse = client.describeIndexStats("indexName");


QueryRequest queryRequest = new QueryRequest(/* parameters */);
List<QueryResponse> responses = client.query(queryRequest);

Performing Upsert Operations

UpsertRequest upsertRequest = new UpsertRequest(/* parameters */);
String upsertResponse = client.upsert(upsertRequest);


DeleteRequest deleteRequest = new DeleteRequest(/* parameters */);
String deleteResponse = client.delete(deleteRequest);

Model Classes

The client library uses several model classes to structure the data for requests and responses. Below is a brief overview of these classes:


Description: Represents the request body for query operations. Fields:

UpsertRequest Description: Represents the request body for upsert operations. Fields:

UpsertVector Description: Represents a single vector in an upsert operation. Fields:


FetchRequest fetchRequest = FetchRequest.builder()
.ids(new String[]{"id1", "id2"})

FetchResponse Description: Represents the response from a fetch operation. Fields:


// Typically used to capture and process the response from a fetch operation
FetchResponse fetchResponse = /* response from fetch operation */;

Index Client Usage

The Index Client is a part of the Pinecone Java Client that provides methods for managing indices in PineconeDB. It allows you to create, delete, and list indices, as well as manage collections within those indices.

Here’s an example of how to use it:

IndexClient indexClient = new IndexClient("environment", "projectId", "apiKey");

// Create an index

// List all indices
List<String> indices = indexClient.listIndexes();

// Delete an index

// Create a collection within an index
indexClient.createCollection("indexName", "collectionName");

// List all collections within an index
List<String> collections = indexClient.listCollections("indexName");

// Delete a collection within an index
indexClient.deleteCollection("indexName", "collectionName");


The Roadmap is currently in the form of issues for this repository. Will move to more formal backlog management tools in the future.


Contributions to the Pinecone Java Client are welcome!


This project is licensed under MIT License.


This is an unofficial client library for PineconeDB and is not affiliated with, maintained, authorized, endorsed, or sponsored by Pinecone Systems Inc.