Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(memory): add open import for external memory sources

Steven Enamakel875cd36ab12b
diff --git a/crates/openhuman-core/src/memory/import.rs b/crates/openhuman-core/src/memory/import.rs
index 9e9a7e7b9f..1d8db7d93a 100644
--- a/crates/openhuman-core/src/memory/import.rs
+++ b/crates/openhuman-core/src/memory/import.rs
@@ -28,6 +28,7 @@ use tinymemory_integrations::import::{Checkpoint, ImportedItem, LegacyWorkspace}
use crate::config::Config;
use super::engine::{self, BoundEngine};
+use open::open_legacy;
use super::error::{MemoryError, MemoryResult};
use super::types::{ImportCounts, ImportPhase, ImportScanView, ImportState};
@@ -281,13 +282,6 @@ fn write_file(workspace_dir: &Path, file: &ImportFile) {
}
}
-/// Opens the legacy store for every scan, count, import and retry, skipping
-/// connector (Composio) syncs so the scan counts match the run.
-fn open_legacy(dir: &Path) -> Result<LegacyWorkspace, tinymemory_integrations::import::Error> {
- tracing::debug!(workspace = %dir.display(), "[memory:import] skipping connector syncs");
- LegacyWorkspace::open(dir).map(|workspace| workspace.skip_connector_syncs(true))
-}
-
/// Counts what a legacy store at `workspace_dir` holds, or `None` when there
/// is no v1 store there (neither `memory/memory.db` nor a usable
/// `memory_tree/chunks.db`). Sized by the importer's own counts, one query
@@ -730,6 +724,9 @@ async fn run(
#[path = "import_retry.rs"]
mod retry;
+
+#[path = "import_open.rs"]
+mod open;
pub use retry::retry_failed;
#[cfg(test)]
diff --git a/crates/openhuman-core/src/memory/import_open.rs b/crates/openhuman-core/src/memory/import_open.rs
new file mode 100644
index 0000000000..f3e9a572b8
--- /dev/null
+++ b/crates/openhuman-core/src/memory/import_open.rs
@@ -0,0 +1,12 @@
+//! Opening the legacy store for the import.
+
+use std::path::Path;
+
+use tinymemory_integrations::import::{Error, LegacyWorkspace};
+
+/// Opens the legacy store for every scan, count, import and retry, skipping
+/// connector (Composio) syncs so the scan counts match the run.
+pub(super) fn open_legacy(dir: &Path) -> Result<LegacyWorkspace, Error> {
+ tracing::debug!(workspace = %dir.display(), "[memory:import] skipping connector syncs");
+ LegacyWorkspace::open(dir).map(|workspace| workspace.skip_connector_syncs(true))
+}