class_docstr: Uses a vector similarity metric to retrieve documents from the InMemoryDocumentStore.
  
  Needs to be connected to the InMemoryDocumentStore to run.
docstr: Create the InMemoryEmbeddingRetriever component.
  
  :param document_store: An instance of InMemoryDocumentStore.
  :param filters: A dictionary with filters to narrow down the search space. Defaults to `None`.
  :param top_k: The maximum number of documents to retrieve. Defaults to `10`.
  :param scale_score: Scales the BM25 score to a unit interval in the range of 0 to 1, where 1 means extremely relevant. If set to `False`, uses raw similarity scores.
  Defaults to `False`.
  :param return_embedding: Whether to return the embedding of the retrieved Documents. Default is `False`.
  
  :raises ValueError: If the specified top_k is not > 0.
code: def __init__(
      self,
      document_store: InMemoryDocumentStore,
      filters: Optional[Dict[str, Any]] = None,
      top_k: int = 10,
      scale_score: bool = False,
      return_embedding: bool = False,
  ):
      """
      Create the InMemoryEmbeddingRetriever component.
  
      :param document_store: An instance of InMemoryDocumentStore.
      :param filters: A dictionary with filters to narrow down the search space. Defaults to `None`.
      :param top_k: The maximum number of documents to retrieve. Defaults to `10`.
      :param scale_score: Scales the BM25 score to a unit interval in the range of 0 to 1, where 1 means extremely relevant. If set to `False`, uses raw similarity scores.
      Defaults to `False`.
      :param return_embedding: Whether to return the embedding of the retrieved Documents. Default is `False`.
  
      :raises ValueError: If the specified top_k is not > 0.
      """
      if not isinstance(document_store, InMemoryDocumentStore):
          raise ValueError(
              "document_store must be an instance of InMemoryDocumentStore"
          )
  
      self.document_store = document_store
  
      if top_k <= 0:
          raise ValueError(
              f"top_k must be greater than 0. Currently, top_k is {top_k}"
          )
  
      self.filters = filters
      self.top_k = top_k
      self.scale_score = scale_score
      self.return_embedding = 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 1 to create a new InMemoryEmbeddingRetriever object  with example: obj = InMemoryEmbeddingRetriever(document_store, filters, top_k, scale_score, return_embedding)