Skip to content

Commit

Permalink
some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
honnuanand committed Dec 5, 2023
1 parent 07242fc commit 113d479
Show file tree
Hide file tree
Showing 3 changed files with 236 additions and 210 deletions.
8 changes: 4 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
remote_theme: pages-themes/hacker@v0.2.0
remote_theme: pages-themes/cayman@v0.2.0
plugins:
- jekyll-remote-theme # add this line to the plugins list if you already have one
- jekyll-remote-theme # add this line to the plugins list if you already have onee


title: [The Unofficial Java Client for Pinecone]
description: [Unofficial Java Client for Pinecone VectorDB]
title: [The Clue2solve Oss Home]
description: [The Clue2solve Oss Home]
224 changes: 18 additions & 206 deletions index.md
Original file line number Diff line number Diff line change
@@ -1,214 +1,26 @@
## Pinecone Java Client
[![Java CI with Maven](https://github.com/clue2solve/pinecone-java-client/actions/workflows/maven.yml/badge.svg)](https://github.com/clue2solve/pinecone-java-client/actions/workflows/maven.yml)
### Overview
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
- Fetch index statistics
- Vector Query operations
- Vector Upsert operations
- Vector Delete operations
- Vector Fetch operations
- Vector Update operations

### Index Operation/Management
- Create new indices
- List all indices
- Delete existing indices
- Manage collections within indices



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

```XML
<!-- https://mavenlibs.com/maven/dependency/io.clue2solve/pinecone-java-client -->
<dependency>
<groupId>io.clue2solve</groupId>
<artifactId>pinecone-java-client</artifactId>
<version>0.1</version>
</dependency>
```

### Usage
A Sample SpringBoot Web app that is built to show the usage of this client is available at [pinecone-console](https://github.com/clue2solve/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
```java
PineconeDBClient client = new PineconeDBClient("environment", "projectId", "apiKey");
```

#### Fetching Index Statistics
```java
Response statsResponse = client.describeIndexStats("indexName");
```

#### Querying
```java
QueryRequest queryRequest = new QueryRequest(/* parameters */);
List<QueryResponse> responses = client.query(queryRequest);
```
---
layout: default # This applies a default Jekyll layout. Customize as needed.
title: Clue2Solve Open Source Projects
---

# Welcome to Clue2Solve Open Source Projects

#### Performing Upsert Operations
```java
UpsertRequest upsertRequest = new UpsertRequest(/* parameters */);
String upsertResponse = client.upsert(upsertRequest);
```
## About Clue2Solve
At Clue2solve, the motto is to build better developer experience. In mission I have the tremendous pleasure to collaborate with some of the great friends I have made during my technology Journey over years.

#### Deleting
```java
DeleteRequest deleteRequest = new DeleteRequest(/* parameters */);
String deleteResponse = client.delete(deleteRequest);
```
You can look for Developer tools, Libraries, Cloud Automation tooling and even some Cloud Strategy related information here at Clue2Solve.

### 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:
[More to come soon]
## Our Open Source Projects
Here you'll find a list of our open-source projects.

#### QueryRequest
**Description**: Represents the request body for query operations.
**Fields**:
- `indexName`: Name of the index to query.
- `queryVector`: A list of doubles representing the query vector.
- `includeMetadata`: Boolean flag to include metadata in the response.
- `includeValues`: Boolean flag to include vector values in the response.
- `top_k`: Integer specifying the number of top results to return.
#### Usage
```java
QueryRequest queryRequest = QueryRequest.builder()
.indexName("myIndex")
.queryVector(Arrays.asList(1.0, 2.0, 3.0))
.includeMetadata(true)
.includeValues(true)
.top_k(5)
.build();
```
**QueryResponse**
**Description**: Represents the response from a query operation.
**Fields**:
- `id`: UUID of the vector.
- `score`: The score of the vector.
- `values`: List of doubles representing the vector values.
- `metadata`: String containing JSON metadata associated with the vector.

----
**UpsertRequest**
**Description**: Represents the request body for upsert operations.
**Fields**:
- `indexName`: Name of the index where vectors are upserted.
- `nameSpace`: Namespace of the index.
- `upsertVectorsList`: List of UpsertVector objects to be upserted.
#### Usage
```java
List<UpsertVector> upsertVectors = Arrays.asList(
new UpsertVector("vectorId1", Arrays.asList(1.0, 2.0, 3.0), "{\"key1\":\"value1\"}"),
new UpsertVector("vectorId2", Arrays.asList(4.0, 5.0, 6.0), "{\"key2\":\"value2\"}")
);
```
```java
UpsertRequest upsertRequest = UpsertRequest.builder()
.indexName("myIndex")
.nameSpace("myNamespace")
.upsertVectorsList(upsertVectors)
.build();
```

**UpsertVector**
**Description**: Represents a single vector in an upsert operation.
**Fields**:
- `id`: Unique identifier for the vector.
- `values`: List of doubles representing the vector.
- `metadata`: String containing JSON metadata associated with the vector.
----
**DeleteRequest**
**Description**: Represents the request body for delete operations.
**Fields**:
- `indexName`: Name of the index from which vectors are deleted.
- `namespace`: Namespace of the index.
- `ids`: Array of string IDs representing the vectors to be deleted.
- `deleteAll`: Boolean flag to delete all vectors (not supported in GCP Starter environments).
#### Usage
```java
DeleteRequest deleteRequest = DeleteRequest.builder()
.indexName("myIndex")
.namespace("myNamespace")
.ids(new String[]{"vectorId1", "vectorId2"})
.build();
```
----
**FetchRequest**
**Description**: Represents the request body for fetch operations.
**Fields**:
- `indexName`: Name of the index from which vectors are fetched.
- `nameSpace`: Namespace of the index.
- `ids`: Array of string IDs representing the vectorsgpg --list to be fetched.

Usage:
```java
FetchRequest fetchRequest = FetchRequest.builder()
.indexName("indexName")
.nameSpace("nameSpace")
.ids(new String[]{"id1", "id2"})
.build();
```

**FetchResponse**
**Description**: Represents the response from a fetch operation.
**Fields**:
- `id`: UUID of the fetched vector.
- `values`: List of doubles representing the vector values.
- `nameSpace`: Namespace of the index from which the vector was fetched.
- `indexName`: Name of the index from which the vector was fetched.
- `additionalProp`: Additional properties associated with the vector.
- `sparseValues`: Sparse representation of vector values, if applicable.
- `metadata`: String containing JSON metadata associated with the vector.

Usage:
```java
// 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:

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

// Create an index
indexClient.createIndex("indexName");

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

// Delete an index
indexClient.deleteIndex("indexName");

// 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");
```
### [Pinecone Unnofficial Java Client](pinecone-java-client.md)
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.

### Roadmap
The Roadmap is currently in the form of issues for this repository. Will move to more formal backlog management tools in the future.
### [Project Name 2](link-to-project-2)
Short description of Project 2.

### Contributing
Contributions to the Pinecone Java Client are welcome!
## License
This project is licensed under MIT License.
... (continue for other projects)

## Disclaimer
This is an unofficial client library for PineconeDB and is not affiliated with, maintained, authorized, endorsed, or sponsored by Pinecone Systems Inc.
## Contributing
Information on how to contribute to these projects.
Loading

0 comments on commit 113d479

Please sign in to comment.