Skip to content

@inferedge/moss v1.0.0-beta.1


@inferedge/moss / SerializedIndex

Interface: SerializedIndex

Complete serialized representation of an index for backup and transfer purposes.

Contains all data necessary to recreate an index, including configuration, items, and pre-computed embeddings. Used by export/import operations.

Properties

dimension

dimension: number

The dimensionality of the embedding vectors.

All vectors in the index will have this many dimensions. Higher dimensions can capture more semantic nuance but require more storage and computation.


embeddings

embeddings: number[][]

Pre-computed embedding vectors for all items in the index.

Each vector corresponds to an item at the same array position. These vectors enable fast similarity search without needing to recompute embeddings at query time.

The vectors are arrays of floating-point numbers with length equal to dimension.


id

id: string

The unique identifier of the index.


items

items: Item[]

All items currently stored in the index.

This array contains the original item data that was added to the index.


metric

metric: string

The distance metric used for similarity calculations.

Common values:

  • "cosine": Measures angular similarity (most common for text)
  • "euclidean": Measures straight-line distance
  • "manhattan": Measures grid-based distance

modelId

modelId: MossModel

The embedding model used to generate vector representations.

This determines how text is converted to numerical vectors for similarity search.


textFieldId

textFieldId: string

The field identifier used for text content processing.

Specifies which field of items contains the text content to be embedded.