Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ We are happy to announce the following GA libraries. Unless specifically noted,
the APIs in these libraries are stable, and are ready for production use.

- [Gemini Enterprise for Customer Experience API](google/cloud/ces/README.md)
- [Vector Search API](google/cloud/vectorsearch/README.md)
- [Vision AI API](/google/cloud/visionai/README.md)
- [Workload Manager](/google/cloud/workloadmanager/README.md)

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,9 @@ See each library's `README.md` file for more information about:
- [Cloud Translation API](google/cloud/translate/README.md)
[[quickstart]](google/cloud/translate/quickstart/README.md)
[[reference]](https://cloud.google.com/cpp/docs/reference/translate/latest)
- [Vector Search API](google/cloud/vectorsearch/README.md)
[[quickstart]](google/cloud/vectorsearch/quickstart/README.md)
[[reference]](https://cloud.google.com/cpp/docs/reference/vectorsearch/latest)
- [Video Services](google/cloud/video/README.md)
[[quickstart]](google/cloud/video/quickstart/README.md)
[[reference]](https://cloud.google.com/cpp/docs/reference/video/latest)
Expand Down
Binary file not shown.
6 changes: 6 additions & 0 deletions ci/etc/expected_install_directories
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,10 @@
./include/google/cloud/translate/v3
./include/google/cloud/translate/v3/internal
./include/google/cloud/translate/v3/mocks
./include/google/cloud/vectorsearch
./include/google/cloud/vectorsearch/v1
./include/google/cloud/vectorsearch/v1/internal
./include/google/cloud/vectorsearch/v1/mocks
./include/google/cloud/video
./include/google/cloud/video/livestream
./include/google/cloud/video/livestream/v1
Expand Down Expand Up @@ -1570,6 +1574,8 @@
./lib64/cmake/google_cloud_cpp_trace_mocks
./lib64/cmake/google_cloud_cpp_translate
./lib64/cmake/google_cloud_cpp_translate_mocks
./lib64/cmake/google_cloud_cpp_vectorsearch
./lib64/cmake/google_cloud_cpp_vectorsearch_mocks
./lib64/cmake/google_cloud_cpp_video
./lib64/cmake/google_cloud_cpp_video_mocks
./lib64/cmake/google_cloud_cpp_videointelligence
Expand Down
1 change: 1 addition & 0 deletions cmake/GoogleCloudCppFeatures.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ set(GOOGLE_CLOUD_CPP_GA_LIBRARIES
"tpu"
"trace"
"translate"
"vectorsearch"
"video"
"videointelligence"
"vision"
Expand Down
9 changes: 9 additions & 0 deletions external/googleapis/protodeps/vectorsearch.deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@googleapis//google/api:annotations_proto
@googleapis//google/api:client_proto
@googleapis//google/api:field_behavior_proto
@googleapis//google/api:field_info_proto
@googleapis//google/api:http_proto
@googleapis//google/api:launch_stage_proto
@googleapis//google/api:resource_proto
@googleapis//google/longrunning:operations_proto
@googleapis//google/rpc:status_proto
6 changes: 6 additions & 0 deletions external/googleapis/protolists/vectorsearch.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@googleapis//google/cloud/vectorsearch/v1:common.proto
@googleapis//google/cloud/vectorsearch/v1:data_object.proto
@googleapis//google/cloud/vectorsearch/v1:data_object_search_service.proto
@googleapis//google/cloud/vectorsearch/v1:data_object_service.proto
@googleapis//google/cloud/vectorsearch/v1:embedding_config.proto
@googleapis//google/cloud/vectorsearch/v1:vectorsearch_service.proto
1 change: 1 addition & 0 deletions external/googleapis/update_libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ declare -A -r LIBRARIES=(
"@googleapis//google/devtools/cloudtrace/v2:cloudtrace_cc_grpc"
)"
["translate"]="@googleapis//google/cloud/translate/v3:translation_cc_grpc"
["vectorsearch"]="@googleapis//google/cloud/vectorsearch/v1:vectorsearch_cc_grpc"
["video"]="$(
printf ",%s" \
"@googleapis//google/cloud/video/livestream/v1:livestream_cc_grpc" \
Expand Down
22 changes: 22 additions & 0 deletions generator/generator_config.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -4022,6 +4022,28 @@ service {
retryable_status_codes: ["kUnavailable"]
}

# Vector Search
service {
service_proto_path: "google/cloud/vectorsearch/v1/data_object_service.proto"
product_path: "google/cloud/vectorsearch/v1"
initial_copyright_year: "2026"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The initial_copyright_year is set to 2026, which is in the future. This is likely a mistake and should be updated to the current year (e.g., 2024). This setting appears to be the root cause for the incorrect copyright year in all newly generated files in this pull request.

retryable_status_codes: ["kUnavailable"]
}

service {
service_proto_path: "google/cloud/vectorsearch/v1/vectorsearch_service.proto"
product_path: "google/cloud/vectorsearch/v1"
initial_copyright_year: "2026"
retryable_status_codes: ["kUnavailable"]
}

service {
service_proto_path: "google/cloud/vectorsearch/v1/data_object_search_service.proto"
product_path: "google/cloud/vectorsearch/v1"
initial_copyright_year: "2026"
retryable_status_codes: ["kUnavailable"]
}

# Video
service {
service_proto_path: "google/cloud/video/livestream/v1/service.proto"
Expand Down
31 changes: 31 additions & 0 deletions google/cloud/vectorsearch/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("//bazel:gapic.bzl", "cc_gapic_library")

package(default_visibility = ["//visibility:private"])

licenses(["notice"]) # Apache 2.0

service_dirs = ["v1/"]

googleapis_deps = [
"@googleapis//google/cloud/vectorsearch/v1:vectorsearch_cc_grpc",
]

cc_gapic_library(
name = "vectorsearch",
googleapis_deps = googleapis_deps,
service_dirs = service_dirs,
)
35 changes: 35 additions & 0 deletions google/cloud/vectorsearch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# ~~~
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ~~~

include(GoogleCloudCppLibrary)

google_cloud_cpp_add_gapic_library(vectorsearch "Vector Search API"
SERVICE_DIRS "v1/")

if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS)
add_executable(vectorsearch_quickstart "quickstart/quickstart.cc")
target_link_libraries(vectorsearch_quickstart
PRIVATE google-cloud-cpp::vectorsearch)
google_cloud_cpp_add_common_options(vectorsearch_quickstart)
add_test(
NAME vectorsearch_quickstart
COMMAND
cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake"
$<TARGET_FILE:vectorsearch_quickstart> GOOGLE_CLOUD_PROJECT
GOOGLE_CLOUD_CPP_TEST_REGION)
set_tests_properties(vectorsearch_quickstart
PROPERTIES LABELS "integration-test;quickstart")
endif ()
68 changes: 68 additions & 0 deletions google/cloud/vectorsearch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Vector Search API C++ Client Library

This directory contains an idiomatic C++ client library for the
[Vector Search API][cloud-service-docs].

The Vector Search API provides a fully-managed, highly performant, and scalable
vector database designed to power next-generation search, recommendation, and
generative AI applications. It allows you to store, index, and query your data
and its corresponding vector embeddings through a simple, intuitive interface.
With Vector Search, you can define custom schemas for your data, insert objects
with associated metadata, automatically generate embeddings from your data, and
perform fast approximate nearest neighbor (ANN) searches to find semantically
similar items at scale.

While this library is **GA**, please note that the Google Cloud C++ client
libraries do **not** follow [Semantic Versioning](https://semver.org/).

## Quickstart

The [quickstart/](quickstart/README.md) directory contains a minimal environment
to get started using this client library in a larger project. The following
"Hello World" program is used in this quickstart, and should give you a taste of
this library.

<!-- inject-quickstart-start -->

```cc
#include "google/cloud/vectorsearch/v1/vector_search_client.h"
#include "google/cloud/location.h"
#include <iostream>

int main(int argc, char* argv[]) try {
if (argc != 3) {
std::cerr << "Usage: " << argv[0] << " project-id location-id\n";
return 1;
}

auto const location = google::cloud::Location(argv[1], argv[2]);

namespace vectorsearch = ::google::cloud::vectorsearch_v1;
auto client = vectorsearch::VectorSearchServiceClient(
vectorsearch::MakeVectorSearchServiceConnection());

for (auto r : client.ListCollections(location.FullName())) {
if (!r) throw std::move(r).status();
std::cout << r->DebugString() << "\n";
}

return 0;
} catch (google::cloud::Status const& status) {
std::cerr << "google::cloud::Status thrown: " << status << "\n";
return 1;
}
```

<!-- inject-quickstart-end -->

## More Information

- Official documentation about the [Vector Search API][cloud-service-docs]
service
- [Reference doxygen documentation][doxygen-link] for each release of this
client library
- Detailed header comments in our [public `.h`][source-link] files

[cloud-service-docs]: https://docs.cloud.google.com/vertex-ai/docs/vector-search-2/overview
[doxygen-link]: https://cloud.google.com/cpp/docs/reference/vectorsearch/latest/
[source-link]: https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/vectorsearch
57 changes: 57 additions & 0 deletions google/cloud/vectorsearch/doc/environment-variables.dox
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*!
@page vectorsearch-env Environment Variables

A number of environment variables can be used to configure the behavior of
the library. There are also functions to configure this behavior in code. The
environment variables are convenient when troubleshooting problems.

@section vectorsearch-env-endpoint Endpoint Overrides

<!-- inject-endpoint-env-vars-start -->

- `GOOGLE_CLOUD_CPP_DATA_OBJECT_SEARCH_SERVICE_ENDPOINT=...` overrides the
`EndpointOption` (which defaults to "vectorsearch.googleapis.com")
used by `MakeDataObjectSearchServiceConnection()`.

- `GOOGLE_CLOUD_CPP_DATA_OBJECT_SERVICE_ENDPOINT=...` overrides the
`EndpointOption` (which defaults to "vectorsearch.googleapis.com")
used by `MakeDataObjectServiceConnection()`.

- `GOOGLE_CLOUD_CPP_VECTOR_SEARCH_SERVICE_ENDPOINT=...` overrides the
`EndpointOption` (which defaults to "vectorsearch.googleapis.com")
used by `MakeVectorSearchServiceConnection()`.

<!-- inject-endpoint-env-vars-end -->

@see google::cloud::EndpointOption

@section vectorsearch-env-logging Logging

`GOOGLE_CLOUD_CPP_ENABLE_TRACING=rpc`: turns on tracing for most gRPC
calls. The library injects an additional Stub decorator that prints each gRPC
request and response. Unless you have configured your own logging backend,
you should also set `GOOGLE_CLOUD_CPP_ENABLE_CLOG` to produce any output on
the program's console.

@see google::cloud::LoggingComponentsOption

`GOOGLE_CLOUD_CPP_TRACING_OPTIONS=...`: modifies the behavior of gRPC tracing,
including whether messages will be output on multiple lines, or whether
string/bytes fields will be truncated.

@see google::cloud::GrpcTracingOptionsOption

`GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes`: turns on logging in the library, basically
the library always "logs" but the logging infrastructure has no backend to
actually print anything until the application sets a backend or they set this
environment variable.

@see google::cloud::LogBackend
@see google::cloud::LogSink

@section vectorsearch-env-project Setting the Default Project

`GOOGLE_CLOUD_PROJECT=...`: is used in examples and integration tests to
configure the GCP project. This has no effect in the library.

*/
63 changes: 63 additions & 0 deletions google/cloud/vectorsearch/doc/main.dox
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*!

@mainpage Vector Search API C++ Client Library

An idiomatic C++ client library for the [Vector Search API][cloud-service-docs].

The Vector Search API provides a fully-managed, highly performant, and
scalable vector database designed to power next-generation search,
recommendation, and generative AI applications. It allows you to store,
index, and query your data and its corresponding vector embeddings through
a simple, intuitive interface. With Vector Search, you can define custom
schemas for your data, insert objects with associated metadata,
automatically generate embeddings from your data, and perform fast
approximate nearest neighbor (ANN) searches to find semantically similar
items at scale.

While this library is **GA**, please note that the Google Cloud C++ client libraries do **not** follow
[Semantic Versioning](https://semver.org/).

@tableofcontents{HTML:2}

## Quickstart

The following shows the code that you'll run in the
`google/cloud/vectorsearch/quickstart/` directory,
which should give you a taste of the Vector Search API C++ client library API.

@snippet quickstart.cc all

## Main classes

<!-- inject-client-list-start -->
This library offers multiple `*Client` classes, which are listed below. Each one
of these classes exposes all the RPCs for a service as member functions of the
class. This library groups multiple services because they are part of the same
product or are often used together. A typical example may be the administrative
and data plane operations for a single product.

The library also has other classes that provide helpers, configuration
parameters, and infrastructure to mock the `*Client` classes when testing your
application.

- [\c vectorsearch_v1::DataObjectServiceClient](@ref google::cloud::vectorsearch_v1::DataObjectServiceClient)
- [\c vectorsearch_v1::DataObjectSearchServiceClient](@ref google::cloud::vectorsearch_v1::DataObjectSearchServiceClient)
- [\c vectorsearch_v1::VectorSearchServiceClient](@ref google::cloud::vectorsearch_v1::VectorSearchServiceClient)
<!-- inject-client-list-end -->

## More Information

- @ref common-error-handling - describes how the library reports errors.
- @ref vectorsearch-override-endpoint - describes how to override the default
endpoint.
- @ref vectorsearch-override-authentication - describes how to change the
authentication credentials used by the library.
- @ref vectorsearch-override-retry - describes how to change the default retry
policies.
- @ref vectorsearch-env - describes environment variables that can configure the
behavior of the library.
- @ref vectorsearch-override-universe-domain - describes how to override the default universe domain.

[cloud-service-docs]: https://docs.cloud.google.com/vertex-ai/docs/vector-search-2/overview

*/
10 changes: 10 additions & 0 deletions google/cloud/vectorsearch/doc/options.dox
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*!
@defgroup google-cloud-vectorsearch-options Vector Search API Configuration Options

This library uses the same mechanism (`google::cloud::Options`) and the common
[options](@ref options) as all other C++ client libraries for its configuration.
Some `*Option` classes, which are only used in this library, are documented in
this page.

@see @ref options - for an overview of client library configuration.
*/
Loading