Skip to content

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

feat(memory): no team section and a scope per GitHub repository by default

M3gA-Mindf49115284514
diff --git a/crates/openhuman-core/src/config/schema/memory.rs b/crates/openhuman-core/src/config/schema/memory.rs
index 1d883ba335..2a68b7431b 100644
--- a/crates/openhuman-core/src/config/schema/memory.rs
+++ b/crates/openhuman-core/src/config/schema/memory.rs
@@ -18,7 +18,7 @@
//! learnings_limit = 8
//! brain_limit = 6
//! history_limit = 6
-//! team_limit = 3
+//! team_limit = 0 # other agents' turns; 0 leaves the section out
//! build_beliefs_every = 10 # turns between belief builds; 0 turns them off
//! pre_turn_timeout_ms = 1500
//! date_hint = false # a model call works out which days a turn is about
@@ -79,6 +79,12 @@ impl fmt::Debug for LegacyBackend {
}
}
+/// Whether `value` is set (serde's skip test for a field that defaults to
+/// on).
+fn is_true(value: &bool) -> bool {
+ *value
+}
+
/// The `[memory]` section.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(default)]
@@ -136,9 +142,11 @@ pub struct MemoryConfig {
pub agents: BTreeMap<String, MemoryAgentConfig>,
/// File GitHub documents one scope per repository
/// (`source:github/project:<owner>--<repo>`) rather than all in
- /// `source:github`. Off by default: every turn reads each brain scope,
- /// so each repository adds a recall to every turn.
- #[serde(skip_serializing_if = "std::ops::Not::not")]
+ /// `source:github`. On by default: a turn reads at most four brain
+ /// scopes (the ones its query names, then the most recently written), so
+ /// a scope per repository keeps each one small without adding reads.
+ /// Written only when off, since on is the default.
+ #[serde(skip_serializing_if = "is_true")]
pub split_github_by_repo: bool,
}
@@ -209,7 +217,7 @@ impl Default for MemoryConfig {
embedding_dimensions: DEFAULT_EMBEDDING_DIMENSIONS,
embedding_rate_limit_per_min: DEFAULT_EMBEDDING_RATE_LIMIT_PER_MIN,
agents: BTreeMap::new(),
- split_github_by_repo: false,
+ split_github_by_repo: true,
}
}
}
@@ -274,7 +282,8 @@ pub struct MemoryRecallConfig {
pub brain_limit: u32,
/// This agent's earlier turns.
pub history_limit: u32,
- /// Other agents' turns under the same root; `0` leaves the section out.
+ /// Other agents' turns under the same root; `0`, the default, leaves the
+ /// section out (with pooled chats there is no such section either way).
pub team_limit: u32,
/// Turns between belief builds of an agent's conversations; `0` turns
/// them off.
@@ -301,7 +310,7 @@ impl Default for MemoryRecallConfig {
learnings_limit: 8,
brain_limit: 6,
history_limit: 6,
- team_limit: 3,
+ team_limit: 0,
build_beliefs_every: 10,
pre_turn_timeout_ms: DEFAULT_PRE_TURN_TIMEOUT_MS,
date_hint: false,
diff --git a/crates/openhuman-core/src/config/schema/memory_tests.rs b/crates/openhuman-core/src/config/schema/memory_tests.rs
index a09928e781..e0da4af3a4 100644
--- a/crates/openhuman-core/src/config/schema/memory_tests.rs
+++ b/crates/openhuman-core/src/config/schema/memory_tests.rs
@@ -17,6 +17,26 @@ fn defaults_select_tinyhumans_with_logging_and_recall_on() {
assert_eq!(config.recall.build_delay_secs, DEFAULT_BUILD_DELAY_SECS);
assert_eq!(config.agent_id, None);
assert_eq!(config.root, None);
+ assert_eq!(config.recall.team_limit, 0, "no team section by default");
+ assert!(
+ config.split_github_by_repo,
+ "one scope per repository by default"
+ );
+}
+
+#[test]
+fn turning_the_github_split_off_survives_a_save() {
+ // On is the default and is not written; off is, so it reads back off.
+ let on = toml::to_string(&MemoryConfig::default()).unwrap();
+ assert!(!on.contains("split_github_by_repo"), "{on}");
+ let off = MemoryConfig {
+ split_github_by_repo: false,
+ ..MemoryConfig::default()
+ };
+ let saved = toml::to_string(&off).unwrap();
+ assert!(saved.contains("split_github_by_repo = false"), "{saved}");
+ let read: MemoryConfig = toml::from_str(&saved).unwrap();
+ assert!(!read.split_github_by_repo);
}
#[test]