From 26344152fa219c7c9fa7e559e8f3d023ab2aafbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=B4=D0=B5=D0=BB=D0=B8=D0=BD=D0=B0=20=D0=A1=D0=B0?= =?UTF-8?q?=D1=82=D1=82=D0=B0=D1=80=D0=BE=D0=B2=D0=B0?= Date: Sun, 31 May 2026 16:22:56 +0000 Subject: [PATCH] Add init_db.py --- init_db.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 init_db.py diff --git a/init_db.py b/init_db.py new file mode 100644 index 0000000..838ca84 --- /dev/null +++ b/init_db.py @@ -0,0 +1,12 @@ +""" +Script to initialise the ChromaDB with documents from ./documents. +""" +import os +from vectorstore import create_vectorstore, load_documents + +if __name__ == "__main__": + db_dir = os.getenv("CHROMA_DB_DIR", "./chroma_db") + store = create_vectorstore(db_dir) + docs_path = os.getenv("DOCS_PATH", "./documents") + load_documents(docs_path, store) + print("Initialisation complete.") \ No newline at end of file