Documents don't show up in Chroma database after adding them

268 views Asked by At

When I'm trying to add texts to a chromadb database I do get ID:s that are supposed to have been added to the database, but when I later check for them they are not there.

# Load database from persist_directory.
vectordb = Chroma(
    persist_directory=persist_directory, embedding_function=embedding
)
# Add new documents.
vectordb.add_texts(text_splitted, metadatas)

The database was created with

embedding = HuggingFaceEmbeddings()
vectordb = Chroma.from_texts(
            texts=texts_splitted,
            metadatas=metadatas,
            embedding=embedding,
            persist_directory=persist_directory,
        )
vectordb.persist()

I have tried to call vectordb.persist() after adding new documents but same result. Do I need to do something else? And if it's not possible to add documents to an already created database and have them saved there, is there a way of creating a new database from the old + the new documents?

0

There are 0 answers