from langchain_community.vectorstores import Chroma from langchain_community.embeddings import OllamaEmbeddings from langchain_community.embeddings.huggingface import HuggingFaceEmbeddings import pickle def create_store(): docs=pickle.load(open("docs.pkl","rb")) embeds=HuggingFaceEmbeddings(model_name="BAAI/bge-base-en-v1.5") store=Chroma.from_documents(documents=docs,embedding=embeds) return store def get_retreiver(store:Chroma): return store.as_retriever() def save_retreiver(store:Chroma): pickle.dump(store.as_retriever(),open("retreiver.pkl","wb"))