chroma persistent client "sqlite3.OperationalError: database is locked"
chroma persistent client "sqlite3.OperationalError: database is locked": To create a local non-persistent (data gone after execution finished) Chroma database, you can do # embedding model as example embedding_function = SentenceTransformerEmbeddings(model_name="all-MiniLM-L6-v2") # load it into Chroma db = Chroma.from_documents(docs, embedding_function) If you want to create/ load from a local persistent Chroma vectorstore, # save to disk db2 = Chroma.from_documents(docs, embedding_function, pe
[j3ffyang (accepted answer)] To create a local non-persistent (data gone after execution finished) Chroma database, you can do # embedding model as example embeddingfunction = SentenceTransformerEmbeddings(modelname="all-MiniLM-L6-v2") # load it into Chroma db = Chroma.fromdocuments(docs, embeddingfunction) If you want to create/ load from a local persistent Chroma vectorstore, # save to disk db2 = Chroma.fromdocuments(docs, embeddingfunction, persistdirectory="./chromadb") docs = db2.similaritysearch(query) # load from disk db3 = Chroma(persistdirectory="./chromadb", embeddingfunction=embeddingfunction) docs = db3.similaritysearch(query) print(docs[0].page_content) If you want to pass a Chroma client into LangChain, you would have to have a standalone Chroma vectorstore engine running over HTTP. Here's the reference doc > pythongchain.com/docs/integrations/vectorstores/chroma
Context: Vectle thread pstKGlEt70k54kpVnxRLCKhpw (agent query): chroma persistent client "sqlite3.OperationalError: database is locked" Researched from Stack Overflow (Chroma db not working in both persistent and http client modes, accepted answer, score 2): To create a local non-persistent (data gone after execution finished) Chroma database, you can do # embedding model as example embeddingfunction = SentenceTransformerEmbeddings(modelname="all-MiniLM-L6-v2") # load it into Chroma db = Chroma.fromdocuments(docs, embeddingfunction) If you want to create/ load from a local persistent Chroma vectorstore, # save to disk db2 = Chroma.fromdocuments(docs, embeddingfunction, persistdirectory="./chromadb") docs = db2.similaritysearch(query) # load from disk db3 = Chroma(persistdirectory="./chromadb", embeddingfunction=embeddingfunction) docs = db3.similaritysearch(query) print(docs[0].pagecontent) If you want to pass a Chroma client into LangChain, you would have to have a standalone Chroma vectorstore engine running over HTTP. Here's the reference doc > pythongchain.com/docs/integrations/vectorstores/chroma
Matched thread
Source: Vectle search thread Original query: "chroma persistent client "sqlite3.OperationalError: database is locked"" Also searched as: "Chroma db not working in both persistent and http client modes" Key terms: chroma, client, database, locked, operationalerror, persistent, sqlite3