# RetrievalRecord

    struct RetrievalRecord: Sendable, Equatable, Hashable

A stored entry persisted in or returned from a `VectorStore`.
- `
  ### [init(id:content:embeddings:similarityScore:metadata:parentId:childIds:)](https://developers.google.com/edge/api/mediapipe/swift/retrieval/Structs/RetrievalRecord.md.txt#/s:23MediaPipeTasksRetrieval0D6RecordV2id7content10embeddings15similarityScore8metadata8parentId8childIdsACSS_Say0abC6Common8TaskPartOGSaySfGSfSgSDyS2SGSSSgSaySSGtcfc)

  ` Creates a vector store record.

  #### Declaration

  Swift

      init(id: String, content: [TaskPart], embeddings: [Float], similarityScore: Float? = nil, metadata: [String: String] = [:], parentId: String? = nil, childIds: [String] = [])

- `
  ### [childIds](https://developers.google.com/edge/api/mediapipe/swift/retrieval/Structs/RetrievalRecord.md.txt#/s:23MediaPipeTasksRetrieval0D6RecordV8childIdsSaySSGvp)

  ` Identifiers of child chunk entries belonging to this parent document, or empty when unchunked.

  #### Declaration

  Swift

      let childIds: [String]

- `
  ### [content](https://developers.google.com/edge/api/mediapipe/swift/retrieval/Structs/RetrievalRecord.md.txt#/s:23MediaPipeTasksRetrieval0D6RecordV7contentSay0abC6Common8TaskPartOGvp)

  ` Ordered multimodal segments associated with this entry.

  #### Declaration

  Swift

      let content: [TaskPart]

- `
  ### [embeddings](https://developers.google.com/edge/api/mediapipe/swift/retrieval/Structs/RetrievalRecord.md.txt#/s:23MediaPipeTasksRetrieval0D6RecordV10embeddingsSaySfGvp)

  ` Dense embedding vector persisted for similarity search.

  #### Declaration

  Swift

      let embeddings: [Float]

- `
  ### [hashValue](https://developers.google.com/edge/api/mediapipe/swift/retrieval/Structs/RetrievalRecord.md.txt#/s:23MediaPipeTasksRetrieval0D6RecordV9hashValueSivp)

  ` The hash value.

  Hash values are not guaranteed to be equal across different executions of your program. Do not save hash values to use during a future execution.

  - Important: `hashValue` is deprecated as a `Hashable` requirement. To conform to `Hashable`, implement the `hash(into:)` requirement instead. The compiler provides an implementation for `hashValue` for you.

  #### Declaration

  Swift

      var hashValue: Int { get }

- `
  ### [id](https://developers.google.com/edge/api/mediapipe/swift/retrieval/Structs/RetrievalRecord.md.txt#/s:23MediaPipeTasksRetrieval0D6RecordV2idSSvp)

  ` Unique identifier of this entry within the store.

  #### Declaration

  Swift

      let id: String

- `
  ### [metadata](https://developers.google.com/edge/api/mediapipe/swift/retrieval/Structs/RetrievalRecord.md.txt#/s:23MediaPipeTasksRetrieval0D6RecordV8metadataSDyS2SGvp)

  ` Arbitrary key-value attributes used for scoped filtering and caller context.

  #### Declaration

  Swift

      let metadata: [String: String]

- `
  ### [parentId](https://developers.google.com/edge/api/mediapipe/swift/retrieval/Structs/RetrievalRecord.md.txt#/s:23MediaPipeTasksRetrieval0D6RecordV8parentIdSSSgvp)

  ` Identifier of the parent document when this entry represents a sub-document chunk.

  #### Declaration

  Swift

      let parentId: String?

- `
  ### [similarityScore](https://developers.google.com/edge/api/mediapipe/swift/retrieval/Structs/RetrievalRecord.md.txt#/s:23MediaPipeTasksRetrieval0D6RecordV15similarityScoreSfSgvp)

  ` Cosine similarity score populated during nearest-neighbor search, if computed by the store.

  #### Declaration

  Swift

      let similarityScore: Float?

- `
  ### [hash(into:)](https://developers.google.com/edge/api/mediapipe/swift/retrieval/Structs/RetrievalRecord.md.txt#/s:23MediaPipeTasksRetrieval0D6RecordV4hash4intoys6HasherVz_tF)

  ` Hashes the essential components of this value by feeding them into the given hasher.

  Implement this method to conform to the `Hashable` protocol. The components used for hashing must be the same as the components compared in your type's `==` operator implementation. Call `hasher.combine(_:)` with each of these components.

  - Important: In your implementation of `hash(into:)`, don't call `finalize()` on the `hasher` instance provided, or replace it with a different instance. Doing so may become a compile-time error in the future.

  #### Declaration

  Swift

      func hash(into hasher: inout Hasher)

  #### Parameters

  |---|---|
  | `hasher` | The hasher to use when combining the components of this instance. |