scann-core 0.2.1

Rust bindings for scann-core: ScaNN's approximate nearest-neighbour vector search core as a standalone library (derived from Google's ScaNN; not an official Google product)
Documentation
// Copyright 2026 The Google Research Authors.
//
// 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
//
//     http://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.

syntax = "proto2";

package research_scann;

import "scann/data_format/features.proto";

message InputOutputConfig {
  enum InMemoryTypes {
    INT8 = 0;
    UINT8 = 1;
    INT16 = 2;
    INT32 = 4;
    UINT32 = 5;
    INT64 = 6;
    FLOAT = 8;
    DOUBLE = 9;

    IN_MEMORY_DATA_TYPE_NOT_SPECIFIED = 255;

    UINT16 = 3 [deprecated = true];
    UINT64 = 7 [deprecated = true];
  }

  optional InMemoryTypes in_memory_data_type = 2
      [default = IN_MEMORY_DATA_TYPE_NOT_SPECIFIED];

  optional bool parallelize_disk_reads_on_startup = 27 [default = false];

  message TableIOConfig {
    optional string table_name = 1;

    optional string embedding_column_name = 2;

    optional string docid_column_name = 3;

    optional GenericFeatureVector.FeatureType embedding_type = 4;

    reserved 5;

    optional int32 prefix_dimensionality = 6;
  }

  oneof DatabaseInputConfig {
    string database_wildcard = 3;

    TableIOConfig database_tableio = 28;
  }

  optional bool allow_two_pass_read = 15 [default = false];

  oneof QueryInputConfig {
    string query_wildcard = 8;

    TableIOConfig query_tableio = 29;
  }

  reserved 19;
  reserved 22;

  optional string output_sstable_wildcard = 11;

  optional string preprocessed_artifacts_dir = 18;

  enum ArtifactsNamingOption {
    HASHED = 0;

    NO_HASH = 1;
  }
  optional ArtifactsNamingOption artifacts_naming_option = 23
      [default = HASHED];

  message PureDynamicConfig {
    optional int32 num_shards = 1 [default = 1];

    enum VectorType {
      UNSPECIFIED_VECTOR_TYPE = 0;

      SPARSE = 1;

      DENSE = 2;
    }

    optional VectorType vector_type = 2 [default = UNSPECIFIED_VECTOR_TYPE];

    optional uint64 dimensionality = 3;
  }

  optional PureDynamicConfig pure_dynamic_config = 21;

  enum FeatureNorm {
    NONE = 0;
    UNITL2NORM = 1;
    STDGAUSSNORM = 2;
    UNITL1NORM = 3;
  }

  optional FeatureNorm norm_type = 5 [default = NONE];

  reserved 20;
  reserved 25;

  optional bool non_negative = 6 [default = false];

  optional bool is_dense = 7;

  message PreprocessingFunction {
    optional string name = 1;

    optional string config_ascii = 2;
  }

  optional PreprocessingFunction query_preprocessing_function = 16;

  optional string hashed_database_wildcard = 12;
  optional string fixed_point_database_wildcard = 17;
  optional string tokenized_database_wildcard = 14;
  optional string memory_consumption_estimate_filename = 24;

  message GraphSearchIoConfig {
    optional string graph_wildcard = 1;

    optional string fixed_point_database_wildcard = 2;

    optional string projection_matrix_filename = 3;
  }
  optional GraphSearchIoConfig graph_search_io_config = 30;

  reserved 1;
  reserved "input_handler";
  optional bool saturate = 10 [default = false, deprecated = true];
  optional uint64 dimensionality = 4 [deprecated = true];

  reserved 13;
}