Skip to content

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

feat(memory): one-shot doctor runner example\n\nThe doctor is an agent tool with no CLI or RPC surface, which leaves an\noperator (or a support session) no way to run it against a real workspace\nwithout driving a chat turn. The example loads config the same way the\ntree-summarizer CLI does -- env overrides, event sink, module policy --\nruns the report, and prints the typed JSON verbatim:\n\n OPENHUMAN_WORKSPACE=<workspace> cargo run --example run_memory_doctor\n

Shanu00c9806e1545
diff --git a/examples/run_memory_doctor.rs b/examples/run_memory_doctor.rs
new file mode 100644
index 0000000000..66943d60ad
--- /dev/null
+++ b/examples/run_memory_doctor.rs
@@ -0,0 +1,20 @@
+//! One-shot memory doctor over a real workspace, for operator use:
+//! OPENHUMAN_WORKSPACE=<workspace> cargo run --example run_memory_doctor
+
+#[tokio::main(flavor = "multi_thread")]
+async fn main() -> anyhow::Result<()> {
+ let mut config = openhuman_core::openhuman::config::Config::load_or_init()
+ .await
+ .unwrap_or_default();
+ config.apply_env_overrides();
+
+ openhuman_core::openhuman::memory::host::install_memory_event_sink();
+ #[cfg(feature = "modules")]
+ openhuman_core::openhuman::modules::memory::set_modules_policy(std::sync::Arc::new(
+ config.clone(),
+ ));
+
+ let report = openhuman_core::openhuman::memory::tree::health::report::run_doctor(&config).await;
+ println!("{}", serde_json::to_string_pretty(&report)?);
+ Ok(())
+}