class_docstr: Uses a vector similarity metric to retrieve documents from the InMemoryDocumentStore.
  
  Needs to be connected to the InMemoryDocumentStore to run.
docstr: Deserialize this component from a dictionary.
code: def from_dict(
      cls, data: Dict[str, Any]
  ) -> "InMemoryEmbeddingRetriever":
      """
      Deserialize this component from a dictionary.
      """
      init_params = data.get("init_parameters", {})
      if "document_store" not in init_params:
          raise DeserializationError(
              "Missing 'document_store' in serialization data"
          )
      if "type" not in init_params["document_store"]:
          raise DeserializationError(
              "Missing 'type' in document store's serialization data"
          )
      data["init_parameters"][
          "document_store"
      ] = InMemoryDocumentStore.from_dict(
          data["init_parameters"]["document_store"]
      )
      return default_from_dict(cls, data)
  
file_path: haystack/haystack/components/retrievers/in_memory/embedding_retriever.py
imports: from typing import Dict, List, Any, Optional
  from haystack import component, Document, default_to_dict, default_from_dict, DeserializationError
  from haystack.document_stores.in_memory import InMemoryDocumentStore
label_desc: Use image node_id 4 for calling the InMemoryEmbeddingRetriever obj's underlying member method code with example usage: obj.from_dict(cls, data) and returns: default_from_dict