langchain_community.retrievers.knn.create_index¶

langchain_community.retrievers.knn.create_index(contexts: List[str], embeddings: Embeddings) ndarray[source]¶

Create an index of embeddings for a list of contexts.

Parameters
  • contexts – List of contexts to embed.

  • embeddings – Embeddings model to use.

Returns

Index of embeddings.