Add file-based document store and vector store (#96)

* Modify docstore and vectorstore objects to be reconstructable
* Simplify the file docstore
* Use the simple file docstore and vector store in MVP
This commit is contained in:
Duc Nguyen (john)
2023-12-04 17:46:00 +07:00
committed by GitHub
parent 0ce3a8832f
commit 37c744b616
18 changed files with 324 additions and 149 deletions

View File

@@ -2,7 +2,8 @@ import json
from pathlib import Path
from typing import List, Optional, Union
from ...base import Document
from kotaemon.base import Document
from .base import BaseDocumentStore
@@ -74,3 +75,6 @@ class InMemoryDocumentStore(BaseDocumentStore):
with open(path) as f:
store = json.load(f)
self._store = {key: Document.from_dict(value) for key, value in store.items()}
def __persist_flow__(self):
return {}