Skip to content

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

Avoid personal-memory recall for find-me research

Steven Enamakel6d88f7c688c9
diff --git a/crates/openhuman-core/src/memory/auto_recall/gate.rs b/crates/openhuman-core/src/memory/auto_recall/gate.rs
index 4e8da06281..5c692ff59a 100644
--- a/crates/openhuman-core/src/memory/auto_recall/gate.rs
+++ b/crates/openhuman-core/src/memory/auto_recall/gate.rs
@@ -2,11 +2,12 @@
//!
//! Deciding that with words costs nothing — no embedding, no store — which is
//! what lets the lane run on every turn without paying on every turn. The rule
-//! is deliberately narrow: a message must **own** something (`my`, `me`, `I`,
+//! is deliberately narrow: a message must **own** something (`my`, `I`, `about me`,
//! …) **and** ask or request (`who … ?`, `what's …`, `tell me …`, `remind me
//! …`). "Fix my code" owns but does not ask; "what's the weather" asks but owns
-//! nothing; neither reaches the store. A false positive costs one bounded tree
-//! lookup that injects nothing; a false negative is covered by the standing
+//! nothing; neither reaches the store. A false positive can inject an unrelated
+//! source hit, so indirect-object phrases such as "find me information" do not
+//! count as ownership. A false negative is covered by the standing
//! memory-access instruction, which tells the model to retrieve before it
//! claims something is not stored.
//!
@@ -21,9 +22,10 @@
/// about the user. They never reach the store.
const MAX_MESSAGE_CHARS: usize = 600;
-/// First-person ownership or self-reference. Apostrophes are stripped before
-/// matching, so `i've` and `ive` both land on the same entry.
-const FIRST_PERSON: &[&str] = &["my", "me", "mine", "myself", "i", "im", "ive", "id", "ill"];
+/// First-person ownership or self-reference. Bare `me` is excluded: "find me
+/// information about Jev" asks about Jev, not the user. Apostrophes are
+/// stripped before matching, so `i've` and `ive` both land on the same entry.
+const FIRST_PERSON: &[&str] = &["my", "mine", "myself", "i", "im", "ive", "id", "ill"];
/// Words a message may open with before it gets to the point — politeness,
/// greetings, fillers. Skipped before the lead word is read, so "please remind
@@ -80,10 +82,13 @@ pub fn gate_decision(message: &str) -> GateDecision {
}
let words = words_of(trimmed);
- if !words
+ let owns_user_fact = words
.iter()
.any(|word| FIRST_PERSON.contains(&word.as_str()))
- {
+ || words.windows(2).any(|pair| {
+ pair[1] == "me" && matches!(pair[0].as_str(), "about" | "know" | "remember")
+ });
+ if !owns_user_fact {
return GateDecision::Closed("no_first_person");
}
let lead = words.iter().find(|word| !PREAMBLE.contains(&word.as_str()));
diff --git a/crates/openhuman-core/src/memory/auto_recall/gate_tests.rs b/crates/openhuman-core/src/memory/auto_recall/gate_tests.rs
index f4bf5fe0ff..f37f3c8e57 100644
--- a/crates/openhuman-core/src/memory/auto_recall/gate_tests.rs
+++ b/crates/openhuman-core/src/memory/auto_recall/gate_tests.rs
@@ -40,6 +40,8 @@ const OPENS: &[&str] = &[
"ok so what do I usually order at cafés",
"yo bro, can you tell me what my timezone is",
"quick question, do I have any allergies",
+ "what do you know about me?",
+ "do you remember me?",
];
/// Messages that are not about the user: the gate must stay closed.
@@ -63,7 +65,7 @@ const CLOSES: &[(&str, &str)] = &[
("generate an image of a cat", "no_first_person"),
("convert 10 miles to km", "no_first_person"),
("what time is it in tokyo?", "no_first_person"),
- ("give me a summary of the meeting notes", "not_a_question"),
+ ("give me a summary of the meeting notes", "no_first_person"),
("send my email to the team", "not_a_question"),
("open my calendar", "not_a_question"),
("search the web for rust async patterns", "no_first_person"),
@@ -78,6 +80,14 @@ const CLOSES: &[(&str, &str)] = &[
("deploy my branch to staging", "not_a_question"),
("please fix my code", "not_a_question"),
("hey, please summarise this thread", "no_first_person"),
+ (
+ "can you find me more infomration about JEV the model form typesafe?",
+ "no_first_person",
+ ),
+ (
+ "could you show me information about Jev?",
+ "no_first_person",
+ ),
("", "empty"),
(" \n ", "empty"),
];