Collections are a key integration aspect with models to create smart, searchable text. The collections object in the project manifest allows you to define groupings of text and functions to embed inserted text with.

hypermode.json
{
  "collections": {
    // This defines a collection of products, having two search methods.
    "myProducts": {
      "searchMethods": {
        "searchMethod1": {
          // The embedder is the name of the function that will be used to generate vector embeddings.
          // By default, it uses a sequential index.
          "embedder": "embed"
        },

        // This is an example of a second search method.
        // It could use a different embedder or index type, if desired.
        "searchMethod2": {
          "embedder": "embed",
          "index": {
            "type": "sequential"
          }
        }
      }
    }
  }
}

Each collection requires a unique name, specified as a key, containing only alphanumeric characters and hyphens.

Properties

searchMethods
object

If provided, adds an index on top of the collection. Each key-value pair is a search method and values.

  • embedder: An exported function name used by the search method to embed text in the collection. Function must have a call signature with input string[] and return type f32[][].
  • index: If provided, describes the index mechanism used by the search method. By default, set to sequential indexing.
    • type: Specifies the type of the index. For example, “sequential”.