|
| 1 | +# Pinecone API Design and Definition |
| 2 | + |
| 3 | +This repository contains the public OpenAPI specifications for Pinecone RESTful APIs and the Protobuf definitions for interacting with gRPC services. |
| 4 | +These files represent the Pinecone API services at specific points in time and are versioned according to the month and year they were released. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## Table of Contents |
| 9 | + |
| 10 | +1. [Overview](#overview) |
| 11 | +2. [What Are OpenAPI and Protobuf Files?](#what-are-openapi-and-protobuf-files) |
| 12 | +3. [Code Generation Resources](#code-generation-resources) |
| 13 | +4. [Versioned Specifications](#versioned-specifications) |
| 14 | +5. [Service-Specific Breakdown](#service-specific-breakdown) |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## Overview |
| 19 | + |
| 20 | +[Pinecone APIs](https://docs.pinecone.io/reference/api/introduction) provide a way to interact programmatically with your Pinecone account. There are several core services that work with databases (indexes and vectors), inference, and assistant. |
| 21 | + |
| 22 | +- **Database**: The [Database API](https://docs.pinecone.io/reference/api/introduction#database-api) can be used to manage index resources, and the records stored within these indexes. The database services include |
| 23 | + both REST and gRPC specifications. The relevant filenames will include "data", "control", "db_data", or "db_control" depending on the version. |
| 24 | +- **Inference**: The [Inference API](https://docs.pinecone.io/guides/inference/understanding-inference) provides access to embedding and reranking models hosted on Pinecone's infrastructure. The inference |
| 25 | + services support REST. |
| 26 | +- **Assistant**: The [Assistant API](https://docs.pinecone.io/guides/get-started/assistant-quickstart) facillitates uploading documents, asking questions, and receiving responses that reference your documents. The assistant services support REST. |
| 27 | + |
| 28 | +Support for these services is dependent on which version of the Pinecone API you are working with. For example, inference is only available in version `2024-10` and later. |
| 29 | +Read more about [Pinecone API versioning](https://docs.pinecone.io/reference/api/versioning). |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## What Are OpenAPI and Protobuf Files? |
| 34 | + |
| 35 | +### OpenAPI |
| 36 | + |
| 37 | +OpenAPI is a standardized format for describing RESTful APIs. It provides: |
| 38 | + |
| 39 | +- A human and machine-readable schema of endpoints, request/response payloads, and error codes. |
| 40 | +- Tools for generating API documentation, client SDKs, and server stubs. |
| 41 | + |
| 42 | +[OpenAPI Specification Documentation](https://swagger.io/specification/) |
| 43 | + |
| 44 | +### Protobuf |
| 45 | + |
| 46 | +Protocol Buffers (Protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. Protobuf files: |
| 47 | + |
| 48 | +- Define message structures and service contracts. |
| 49 | +- Enable strongly-typed, high-performance communication between clients and servers. |
| 50 | + |
| 51 | +[Protocol Buffers Documentation](https://protobuf.dev/) |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## Code Generation Resources |
| 56 | + |
| 57 | +You can use the following tools to generate client code, server stubs, and documentation from the specification files in this repository: |
| 58 | + |
| 59 | +### For OpenAPI |
| 60 | + |
| 61 | +- **Swagger Codegen**: [Documentation](https://swagger.io/tools/swagger-codegen/) |
| 62 | +- **OpenAPI Generator**: [Documentation](https://openapi-generator.tech/) |
| 63 | + |
| 64 | +### For Protobuf |
| 65 | + |
| 66 | +- **Protobuf Compiler (`protoc`)**: [Documentation](https://protobuf.dev/reference/protoc/) |
| 67 | +- **gRPC Code Generators**: |
| 68 | + - Python: `grpcio-tools` |
| 69 | + - Go: `protoc-gen-go` |
| 70 | + - Java: `protoc-gen-grpc-java` |
| 71 | + |
| 72 | +Refer to the tool documentation for usage instructions tailored to your preferred programming language. |
| 73 | + |
| 74 | +--- |
| 75 | + |
| 76 | +## Versioned Specifications |
| 77 | + |
| 78 | +Each subdirectory in this repository represents a specific version of the Pinecone API. New versions of the Pinecone API are released quarterly. |
| 79 | +You can find more about API versioning [here](https://docs.pinecone.io/reference/api/versioning). Directories are named using the `YYYY-MM` format, corresponding to the year and month of the release. |
| 80 | + |
| 81 | +Example: |
| 82 | + |
| 83 | +``` |
| 84 | +2024-10/ |
| 85 | + - db_control_2024-10.oas.yaml |
| 86 | + - db_data_2024-10.oas.yaml |
| 87 | + - db_data_2024-10.proto |
| 88 | + - inference_2024-10.oas.yaml |
| 89 | +``` |
| 90 | + |
| 91 | +- **OpenAPI Files**: Files with the extension `*.oas.yaml`. |
| 92 | +- **Protobuf Definitions**: Files with the extension `*.proto`. |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +## Service-Specific Breakdown |
| 97 | + |
| 98 | +The Pinecone API consists of multiple services. Below is a high-level breakdown of the services and the associated specification files. |
| 99 | + |
| 100 | +Note: The database service is split into "control" and "data" specifications. Control handles managing database resources such as indexes and collections and uses REST. Data defines interaction with a specific index resource and uses gRPC or REST. |
| 101 | + |
| 102 | +| Service | OpenAPI File | Protobuf File | Documentation Link | |
| 103 | +| ---------------------- | --------------------------------------------- | ----------------------------- | -------------------------------------------------------------------------------------------- | |
| 104 | +| Database - Control | `db_control_<API_VERSION>.oas.yaml` | N/A | [Database Documentation](https://docs.pinecone.io/reference/api/introduction#database-api) | |
| 105 | +| Database - Data | `db_data_<API_VERSION>.oas.yaml` | `db_data_<API_VERSION>.proto` | [Database Documentation](https://docs.pinecone.io/reference/api/introduction#database-api) | |
| 106 | +| Inference | `inference_<API_VERSION>.oas.yaml` | N/A | [Inference Documentation](https://docs.pinecone.io/reference/api/introduction#inference-api) | |
| 107 | +| Assistant - Control | `assistant_control_<API_VERSION>.oas.yaml` | N/A | [Assistant Documentation](https://docs.pinecone.io/reference/api/introduction#assistant-api) | |
| 108 | +| Assistant - Data | `assistant_data_<API_VERSION>.oas.yaml` | N/A | [Assistant Documentation](https://docs.pinecone.io/reference/api/introduction#assistant-api) | |
| 109 | +| Assistant - Evaluation | `assistant_evaluation_<API_VERSION>.oas.yaml` | N/A | [Assistant Documentation](https://docs.pinecone.io/reference/api/introduction#assistant-api) | |
| 110 | + |
| 111 | +You can find specific links and resources for each service in the [Pinecone API reference](https://docs.pinecone.io/reference/api/introduction). Note: The names of the files may differ across versions. |
| 112 | + |
| 113 | +--- |
0 commit comments