class_docstr: Uses a vector similarity metric to retrieve documents from the InMemoryDocumentStore.
  
  Needs to be connected to the InMemoryDocumentStore to run.
docstr: Serialize this component to a dictionary.
code: def to_dict(self) -> Dict[str, Any]:
      """
      Serialize this component to a dictionary.
      """
      docstore = self.document_store.to_dict()
      return default_to_dict(
          self,
          document_store=docstore,
          filters=self.filters,
          top_k=self.top_k,
          scale_score=self.scale_score,
          return_embedding=self.return_embedding,
      )
  
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 3 for calling the InMemoryEmbeddingRetriever obj's underlying member method code with example usage: obj.to_dict() and returns: default_to_dict