diff --git a/README.md b/README.md index 404ccbc6f7..2bc71d7874 100644 --- a/README.md +++ b/README.md @@ -119,11 +119,11 @@ MemGPT supports pre-loading data into archival memory, so your agent can referen #### Loading Data We currently support loading from a directory and database dumps. We highly encourage contributions for new data sources, which can be added as a new [CLI data load command](https://github.com/cpacker/MemGPT/blob/main/memgpt/cli/cli_load.py). -Loading from a directorsy: +Loading from a directory: ``` # loading a directory memgpt load directory --name \ - [--input_dir ] [--input-files ...] [--recursive] + [--input-dir ] [--input-files ...] [--recursive] ``` Loading from a database dump: ```sh diff --git a/memgpt/cli/cli_load.py b/memgpt/cli/cli_load.py index 9bbb112f1f..a7227cd6a9 100644 --- a/memgpt/cli/cli_load.py +++ b/memgpt/cli/cli_load.py @@ -26,9 +26,12 @@ def load_directory( if recursive: assert input_dir is not None, "Must provide input directory if recursive is True." + + if input_dir is not None: + assert len(input_files) == 0, "Either load in a list of files OR a directory." reader = SimpleDirectoryReader( input_dir=input_dir, - recursive=True, + recursive=recursive, ) else: reader = SimpleDirectoryReader(input_files=input_files)