from langchain_huggingface import HuggingFaceEmbeddings from langchain_community.vectorstores import FAISS ,Chroma model_name = "intfloat/multilingual-e5-large" load_from_dir = "Hadith_Chroma_db" embedding_llm = HuggingFaceEmbeddings(model_name=model_name) loaded_vector_db = Chroma( persist_directory=load_from_dir, embedding_function=embedding_llm ) def get_similar_docs(query): similar_docs = loaded_vector_db.similarity_search(query ,k =2) return similar_docs