Skip to content

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

feat(memory): restore network source kinds for links, GitHub, RSS and Composio

Steven Enamakele9fa82d2734f
diff --git a/crates/openhuman-core/Cargo.toml b/crates/openhuman-core/Cargo.toml
index 6d4b7a016d..bef4275f5e 100644
--- a/crates/openhuman-core/Cargo.toml
+++ b/crates/openhuman-core/Cargo.toml
@@ -212,7 +212,7 @@ tinyruntime-pyserver = { path = "../../vendor/tinyruntime/crates/tinyruntime-pys
# `memory::` is the only module that names the engine side.
tinymemory-api = { path = "../../vendor/tinymemory/crates/tinymemory-api" }
tinymemory-tools = { path = "../../vendor/tinymemory/crates/tinymemory-tools" }
-tinymemory-integrations = { path = "../../vendor/tinymemory/crates/tinymemory-integrations", default-features = false, features = ["cortex", "brain", "sources", "safety", "legacy-import"] }
+tinymemory-integrations = { path = "../../vendor/tinymemory/crates/tinymemory-integrations", default-features = false, features = ["cortex", "brain", "sources-network", "safety", "legacy-import"] }
# tinyconnectors-bus — the OAuth connector wire contract
# (https://github.com/tinyhumansai/tinyconnectors). Payload types and member
# names for the connector surface, with no transport and no behaviour: this
diff --git a/crates/openhuman-core/src/config/schema/load/migrate.rs b/crates/openhuman-core/src/config/schema/load/migrate.rs
index 3405142000..b6c58abc12 100644
--- a/crates/openhuman-core/src/config/schema/load/migrate.rs
+++ b/crates/openhuman-core/src/config/schema/load/migrate.rs
@@ -215,7 +215,7 @@ pub(crate) fn migrate_search_settings(config: &mut Config) {
/// Migrates legacy v1 `[[memory_sources]]` into `[[memory.sources]]`, once:
/// only when no v2 source exists yet. Kinds without a v2 equivalent
-/// (everything but `folder` and `file`, including the removed `web_page`, `github_repo`, `rss_feed` and `composio`) and disabled entries are dropped. The
+/// (`twitter_query`, `conversation`) and disabled entries are dropped. The
/// legacy list is cleared either way, so it is never written back.
pub(crate) fn migrate_legacy_memory_sources(config: &mut Config) {
let legacy = std::mem::take(&mut config.legacy_memory_sources);
diff --git a/crates/openhuman-core/src/config/schema/memory.rs b/crates/openhuman-core/src/config/schema/memory.rs
index ee0eb9f4e9..d6382eb0c5 100644
--- a/crates/openhuman-core/src/config/schema/memory.rs
+++ b/crates/openhuman-core/src/config/schema/memory.rs
@@ -328,9 +328,7 @@ impl Default for MemoryRecallConfig {
}
}
-/// What a document source reads. Only local kinds exist: the network kinds
-/// (`link`, `github`, `rss`, `composio`) were removed, and a saved entry of
-/// one is dropped at load.
+/// What a document source reads.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum MemorySourceKind {
@@ -338,11 +336,26 @@ pub enum MemorySourceKind {
Folder,
/// One local file.
File,
+ /// One web page.
+ Link,
+ /// A GitHub repository (`owner/repo` or URL).
+ Github,
+ /// An RSS or Atom feed.
+ Rss,
+ /// A connected Composio toolkit.
+ Composio,
}
impl MemorySourceKind {
/// Every kind, in display order.
- pub const ALL: [Self; 2] = [Self::Folder, Self::File];
+ pub const ALL: [Self; 6] = [
+ Self::Folder,
+ Self::File,
+ Self::Link,
+ Self::Github,
+ Self::Rss,
+ Self::Composio,
+ ];
/// Wire name.
#[must_use]
@@ -350,6 +363,10 @@ impl MemorySourceKind {
match self {
Self::Folder => "folder",
Self::File => "file",
+ Self::Link => "link",
+ Self::Github => "github",
+ Self::Rss => "rss",
+ Self::Composio => "composio",
}
}
@@ -371,7 +388,7 @@ pub struct MemorySourceConfig {
pub id: String,
/// What the source reads.
pub kind: MemorySourceKind,
- /// The folder or file path.
+ /// Path, URL, `owner/repo`, feed URL or Composio toolkit.
pub target: String,
/// Display label.
#[serde(default)]
@@ -397,9 +414,7 @@ where
}
/// Decodes source entries leniently: an entry that does not parse is dropped
-/// with a warning naming only its index and reason (never its contents). This
-/// is also how a saved source of a removed kind (`composio`, `link`, `github`,
-/// `rss`) disappears: its `kind` no longer parses, and the warning says so.
+/// with a warning naming only its index and reason (never its contents).
pub(crate) fn decode_sources_lenient(raw: Vec<serde_json::Value>) -> Vec<MemorySourceConfig> {
raw.into_iter()
.enumerate()
@@ -410,7 +425,7 @@ pub(crate) fn decode_sources_lenient(raw: Vec<serde_json::Value>) -> Vec<MemoryS
tracing::warn!(
index,
error = %error,
- "[memory:config] dropping unreadable or removed-kind memory source entry"
+ "[memory:config] dropping unreadable memory source entry"
);
None
}
@@ -421,10 +436,10 @@ pub(crate) fn decode_sources_lenient(raw: Vec<serde_json::Value>) -> Vec<MemoryS
/// Maps one legacy v1 `[[memory_sources]]` entry onto a v2 source.
///
-/// Only `folder`→`folder` and `file`→`file` survive. Every other v1 kind
-/// (`web_page`, `github_repo`, `rss_feed`, `composio`, `twitter_query`,
-/// `conversation`) has no equivalent and is dropped with a warning, as is
-/// anything else unrecognised or missing its target.
+/// v1 kinds map as `folder`→`folder`, `file`→`file`, `web_page`→`link`,
+/// `github_repo`→`github`, `rss_feed`→`rss`, `composio`→`composio`. The v1
+/// `twitter_query` and `conversation` kinds have no v2 equivalent and are
+/// dropped, as is anything else unrecognised or missing its target.
#[must_use]
pub fn migrate_legacy_source(value: &serde_json::Value) -> Option<MemorySourceConfig> {
let object = value.as_object()?;
@@ -439,15 +454,17 @@ pub fn migrate_legacy_source(value: &serde_json::Value) -> Option<MemorySourceCo
let kind = match text("kind")?.as_str() {
"folder" => MemorySourceKind::Folder,
"file" => MemorySourceKind::File,
- other => {
- tracing::warn!(
- kind = other,
- "[memory:config] dropping legacy memory source of a removed kind"
- );
- return None;
- }
+ "web_page" => MemorySourceKind::Link,
+ "github_repo" => MemorySourceKind::Github,
+ "rss_feed" => MemorySourceKind::Rss,
+ "composio" => MemorySourceKind::Composio,
+ _ => return None,
+ };
+ let target = match kind {
+ MemorySourceKind::Folder | MemorySourceKind::File => text("path")?,
+ MemorySourceKind::Link | MemorySourceKind::Github | MemorySourceKind::Rss => text("url")?,
+ MemorySourceKind::Composio => text("toolkit")?,
};
- let target = text("path")?;
if object.get("enabled").and_then(serde_json::Value::as_bool) == Some(false) {
return None;
}
diff --git a/crates/openhuman-core/src/config/schema/memory_tests.rs b/crates/openhuman-core/src/config/schema/memory_tests.rs
index 3931421a8c..63b8fc7add 100644
--- a/crates/openhuman-core/src/config/schema/memory_tests.rs
+++ b/crates/openhuman-core/src/config/schema/memory_tests.rs
@@ -140,8 +140,8 @@ target = "rust"
[[sources]]
id = "good"
-kind = "folder"
-target = "/notes"
+kind = "rss"
+target = "https://example.com/feed.xml"
"#,
)
.expect("one bad entry does not fail the section");
@@ -150,57 +150,6 @@ target = "/notes"
assert_eq!(config.sources[0].label, "", "label defaults to empty");
}
-#[test]
-fn drops_sources_of_removed_network_kinds_and_keeps_local_ones() {
- let config: MemoryConfig = toml::from_str(
- r#"
-[[sources]]
-id = "src-composio"
-kind = "composio"
-target = "gmail"
-
-[[sources]]
-id = "src-link"
-kind = "link"
-target = "https://example.com"
-
-[[sources]]
-id = "src-github"
-kind = "github"
-target = "o/r"
-
-[[sources]]
-id = "src-rss"
-kind = "rss"
-target = "https://example.com/feed.xml"
-
-[[sources]]
-id = "src-folder"
-kind = "folder"
-target = "/notes"
-
-[[sources]]
-id = "src-file"
-kind = "file"
-target = "/notes/a.md"
-"#,
- )
- .expect("removed kinds must not fail the section");
- let ids: Vec<&str> = config.sources.iter().map(|s| s.id.as_str()).collect();
- assert_eq!(ids, ["src-folder", "src-file"]);
-}
-
-#[test]
-fn only_folder_and_file_remain_as_source_kinds() {
- assert_eq!(
- MemorySourceKind::ALL,
- [MemorySourceKind::Folder, MemorySourceKind::File]
- );
- for removed in ["composio", "link", "github", "rss"] {
- assert_eq!(MemorySourceKind::parse(removed), None, "{removed}");
- }
-}
-
#[test]
fn endpoint_for_ignores_blank_and_missing_endpoints() {
let mut config = MemoryConfig::default();
@@ -241,7 +190,7 @@ fn source_kind_round_trips_its_wire_names() {
}
#[test]
-fn migrates_the_local_legacy_kinds() {
+fn migrates_every_mappable_legacy_kind() {
let cases = [
(
json!({"id":"a","kind":"folder","path":"/p"}),
@@ -253,6 +202,26 @@ fn migrates_the_local_legacy_kinds() {
MemorySourceKind::File,
"/f.md",
),
+ (
+ json!({"id":"c","kind":"web_page","url":"https://w"}),
+ MemorySourceKind::Link,
+ "https://w",
+ ),
+ (
+ json!({"id":"d","kind":"github_repo","url":"o/r"}),
+ MemorySourceKind::Github,
+ "o/r",
+ ),
+ (
+ json!({"id":"e","kind":"rss_feed","url":"https://f"}),
+ MemorySourceKind::Rss,
+ "https://f",
+ ),
+ (
+ json!({"id":"f","kind":"composio","toolkit":"gmail"}),
+ MemorySourceKind::Composio,
+ "gmail",
+ ),
];
for (legacy, kind, target) in cases {
let migrated = migrate_legacy_source(&legacy).expect("mappable kind migrates");
@@ -277,10 +246,6 @@ fn migration_drops_unmappable_disabled_and_incomplete_entries() {
for legacy in [
json!({"id":"t","kind":"twitter_query","query":"rust"}),
json!({"id":"c","kind":"conversation"}),
- json!({"id":"w","kind":"web_page","url":"https://w"}),
- json!({"id":"g","kind":"github_repo","url":"o/r"}),
- json!({"id":"r","kind":"rss_feed","url":"https://f"}),
- json!({"id":"k","kind":"composio","toolkit":"gmail"}),
json!({"id":"x","kind":"folder","path":"/p","enabled":false}),
json!({"id":"y","kind":"folder"}),
json!({"kind":"folder","path":"/p"}),
diff --git a/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs b/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs
index 0e41283654..3c0a9652ad 100644
--- a/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/memory_adapter_tests.rs
@@ -314,7 +314,7 @@ fn plain_agent_learnings_are_trusted_and_everything_else_is_not() {
assert!(!is_untrusted(&MemoryMeta::default()));
assert!(is_untrusted(&crate::flows::flow_meta("f", &[])));
assert!(is_untrusted(&MemoryMeta::from_source(
- SourceKind::Import,
+ SourceKind::Composio,
None
)));
}
diff --git a/crates/openhuman-core/src/memory/brain.rs b/crates/openhuman-core/src/memory/brain.rs
index 2452313641..c0da42e150 100644
--- a/crates/openhuman-core/src/memory/brain.rs
+++ b/crates/openhuman-core/src/memory/brain.rs
@@ -34,29 +34,25 @@ pub fn files_source() -> BrainSource {
BrainSource::Other("files".to_string())
}
-/// The brain source a synced item belongs to. Only local folders and files
-/// are synced, so every source files under `files`, whatever the format.
+/// The brain source a synced item belongs to: the connector it came from,
+/// so disconnecting or removing it erases one source. GitHub (the reader
+/// and the Composio toolkit alike) to `github`, links and feeds to `web`, a
+/// Composio toolkit to its canonical slug (`gmail`, `googledrive`), and
+/// local files, whatever their format, to `files`.
#[must_use]
-pub fn brain_source(kind: MemorySourceKind) -> BrainSource {
+pub fn brain_source(kind: MemorySourceKind, target: &str) -> BrainSource {
match kind {
+ MemorySourceKind::Github => BrainSource::Github,
+ MemorySourceKind::Link | MemorySourceKind::Rss => BrainSource::Web,
+ MemorySourceKind::Composio => {
+ crate::integrations::composio::tools::canonicalize_toolkit_slug(target)
+ .parse()
+ .unwrap_or_else(|_| BrainSource::Other("composio".to_string()))
+ }
MemorySourceKind::Folder | MemorySourceKind::File => files_source(),
}
}
-/// Canonical form of a connector slug found on a legacy brain node
-/// (`google_drive` becomes `googledrive`), kept so documents filed by the
-/// removed Composio sync still migrate to the node they were filed under.
-fn legacy_connector_slug(slug: &str) -> String {
- let key = slug.trim().to_ascii_lowercase();
- match key.as_str() {
- "feishu" | "lark" => "larksuite".to_string(),
- "google_calendar" => "googlecalendar".to_string(),
- "google_drive" => "googledrive".to_string(),
- "google_sheets" => "googlesheets".to_string(),
- _ => key,
- }
-}
-
/// The brain source a document filed under the old per-type layout belongs
/// to now, for the migration that moves it: `old_source_id` is the id of
/// the `source:<id>` node it sits at, `item` the document itself.
@@ -69,7 +65,7 @@ fn legacy_connector_slug(slug: &str) -> String {
/// becomes `googledrive`), so `notion`, `github` and `gmail` stay put.
#[must_use]
pub fn legacy_brain_node(old_source_id: &str, item: &StoreItem) -> BrainSource {
- let id = legacy_connector_slug(old_source_id);
+ let id = crate::integrations::composio::tools::canonicalize_toolkit_slug(old_source_id);
match id.as_str() {
"files" | "pdf" | "markdown" | "md" | "docx" | "xlsx" | "pptx" | "code" | "other" => {
files_source()
diff --git a/crates/openhuman-core/src/memory/brain_tests.rs b/crates/openhuman-core/src/memory/brain_tests.rs
index d40aa72afc..0c4713a4ee 100644
--- a/crates/openhuman-core/src/memory/brain_tests.rs
+++ b/crates/openhuman-core/src/memory/brain_tests.rs
@@ -17,9 +17,30 @@ fn document(mime: Option<&str>, path: Option<&str>) -> StoreItem {
}
#[test]
-fn synced_items_are_filed_under_files() {
- for kind in MemorySourceKind::ALL {
- assert_eq!(brain_source(kind), files_source(), "{kind:?}");
+fn synced_items_are_filed_by_their_connector() {
+ for (kind, target, want) in [
+ (MemorySourceKind::Github, "o/r", BrainSource::Github),
+ (MemorySourceKind::Link, "https://x", BrainSource::Web),
+ (MemorySourceKind::Rss, "https://x/feed", BrainSource::Web),
+ (MemorySourceKind::Composio, "Notion", BrainSource::Notion),
+ // The Composio toolkit and the GitHub reader share one source.
+ (MemorySourceKind::Composio, "github", BrainSource::Github),
+ (
+ MemorySourceKind::Composio,
+ "gmail",
+ BrainSource::Other("gmail".into()),
+ ),
+ // An alias files under the slug Composio itself uses.
+ (
+ MemorySourceKind::Composio,
+ "google_drive",
+ BrainSource::Other("googledrive".into()),
+ ),
+ // Local files, whatever their format, share one source.
+ (MemorySourceKind::Folder, "/n", files_source()),
+ (MemorySourceKind::File, "/n/deck/Q3.PDF", files_source()),
+ ] {
+ assert_eq!(brain_source(kind, target), want, "{kind:?} {target}");
}
assert_eq!(files_source().to_string(), "files");
}
@@ -289,7 +310,7 @@ fn legacy_nodes_map_to_their_connector() {
item.meta_mut().source = SourceRef { kind, id: None };
item
};
- let link = item(SourceKind::Import, None);
+ let link = item(SourceKind::Link, None);
for old in [
"pdf", "markdown", "md", "docx", "xlsx", "pptx", "code", "other", "files",
] {
@@ -298,7 +319,7 @@ fn legacy_nodes_map_to_their_connector() {
// `web` held links and feeds, and HTML files that were filed beside them.
assert_eq!(legacy_brain_node("web", &link), BrainSource::Web);
assert_eq!(
- legacy_brain_node("web", &item(SourceKind::Import, None)),
+ legacy_brain_node("web", &item(SourceKind::Rss, None)),
BrainSource::Web
);
assert_eq!(
@@ -311,7 +332,7 @@ fn legacy_nodes_map_to_their_connector() {
);
// An upload carried the `Link` kind `web` implies, but kept its path.
assert_eq!(
- legacy_brain_node("web", &item(SourceKind::Import, Some("/u/pricing.html"))),
+ legacy_brain_node("web", &item(SourceKind::Link, Some("/u/pricing.html"))),
files_source()
);
// Connectors keep their node, under the slug Composio uses.
diff --git a/crates/openhuman-core/src/memory/layout_migration/copy_tests.rs b/crates/openhuman-core/src/memory/layout_migration/copy_tests.rs
index 7f3f4cacd5..632670729f 100644
--- a/crates/openhuman-core/src/memory/layout_migration/copy_tests.rs
+++ b/crates/openhuman-core/src/memory/layout_migration/copy_tests.rs
@@ -245,20 +245,20 @@ async fn old_brain_nodes_are_refiled_by_connector() {
for item in [
doc("a pdf", "source:pdf", SourceKind::File, Some("a.pdf")),
doc("a note", "source:markdown", SourceKind::File, Some("a.md")),
- doc("a link", "source:web", SourceKind::Import, None),
+ doc("a link", "source:web", SourceKind::Link, None),
doc(
"an upload",
"source:web",
- SourceKind::Import,
+ SourceKind::Link,
Some("page.html"),
),
doc(
"a drive doc",
"source:google_drive",
- SourceKind::Import,
+ SourceKind::Composio,
None,
),
- doc("a notion page", "source:notion", SourceKind::Import, None),
+ doc("a notion page", "source:notion", SourceKind::Composio, None),
] {
legacy.store(item).await.unwrap();
}
diff --git a/crates/openhuman-core/src/memory/layout_migration/map_tests.rs b/crates/openhuman-core/src/memory/layout_migration/map_tests.rs
index 78a4cc19cf..18d0bb01a0 100644
--- a/crates/openhuman-core/src/memory/layout_migration/map_tests.rs
+++ b/crates/openhuman-core/src/memory/layout_migration/map_tests.rs
@@ -71,18 +71,14 @@ fn a_per_format_document_moves_to_the_files_node() {
fn a_web_link_stays_web_and_an_uploaded_page_is_a_file() {
let placement = placement("root");
let link = placement
- .place(document("source:web", SourceKind::Import, None))
+ .place(document("source:web", SourceKind::Link, None))
.unwrap();
assert_eq!(
link.meta().namespace,
placement.layout.brain(&BrainSource::Web).unwrap()
);
let page = placement
- .place(document(
- "source:web",
- SourceKind::Import,
- Some("page.html"),
- ))
+ .place(document("source:web", SourceKind::Link, Some("page.html")))
.unwrap();
assert_eq!(
page.meta().namespace,
@@ -94,14 +90,14 @@ fn a_web_link_stays_web_and_an_uploaded_page_is_a_file() {
fn a_connector_document_keeps_its_node() {
let placement = placement("root");
let placed = placement
- .place(document("source:gmail", SourceKind::Import, None))
+ .place(document("source:gmail", SourceKind::Composio, None))
.unwrap();
assert_eq!(placed.meta().namespace, ns("source:gmail"));
}
#[test]
fn a_github_document_goes_to_its_repository_when_the_setting_splits_them() {
- let mut item = document("source:github", SourceKind::Import, None);
+ let mut item = document("source:github", SourceKind::Composio, None);
item.meta_mut().repo = Some("Acme/Widgets".into());
let mut placement = placement("root");
assert_eq!(
diff --git a/crates/openhuman-core/src/memory/sources/mod.rs b/crates/openhuman-core/src/memory/sources/mod.rs
index d1dc86ab43..8168e1d6fb 100644
--- a/crates/openhuman-core/src/memory/sources/mod.rs
+++ b/crates/openhuman-core/src/memory/sources/mod.rs
@@ -1,14 +1,18 @@
//! Document sources: the registry persisted in `[[memory.sources]]`, and sync.
//!
-//! A source names something to read — a local folder or a single file — and
-//! how often. Sync reads it through `tinymemory-integrations`' readers and
-//! stores each item as a `Document` whose `meta.source` is
+//! A source names something to read — a folder, a file, a web page, a GitHub
+//! repository, an RSS feed or a connected Composio toolkit — and how often.
+//! Sync reads it through `tinymemory-sources` (or, for Composio, the connector
+//! module) and stores each item as a `Document` whose `meta.source` is
//! `{kind, id: <source id>}`, so removing a source can forget exactly its
//! items. Sync runs on demand ([`start_sync`]) and from the
//! `memory_sources_sync` cron job ([`sync_due`]).
+pub mod composio;
+pub mod roots;
pub mod state;
mod sync;
+pub mod versions;
use chrono::{DateTime, Utc};
use tinymemory_api::{ForgetTarget, MetaFilter};
@@ -55,7 +59,8 @@ pub fn list(config: &Config) -> Vec<SourceView> {
.collect()
}
-/// Normalises a target for `kind`: a folder or file path, trimmed.
+/// Normalises a target for `kind`: GitHub accepts `owner/repo` or a URL;
+/// network kinds must be http(s) URLs; a Composio target is a toolkit slug.
pub fn normalize_target(kind: MemorySourceKind, target: &str) -> MemoryResult<String> {
let target = target.trim();
if target.is_empty() {
@@ -63,9 +68,42 @@ pub fn normalize_target(kind: MemorySourceKind, target: &str) -> MemoryResult<St
}
match kind {
MemorySourceKind::Folder | MemorySourceKind::File => Ok(target.to_string()),
+ MemorySourceKind::Github => {
+ if target.starts_with("http://") || target.starts_with("https://") {
+ return http_url(target);
+ }
+ let mut parts = target.split('/');
+ match (parts.next(), parts.next(), parts.next()) {
+ (Some(owner), Some(repo), None) if !owner.is_empty() && !repo.is_empty() => {
+ Ok(format!("https://github.com/{owner}/{repo}"))
+ }
+ _ => Err(MemoryError::invalid(
+ "a GitHub target is `owner/repo` or a repository URL",
+ )),
+ }
+ }
+ MemorySourceKind::Link | MemorySourceKind::Rss => http_url(target),
+ MemorySourceKind::Composio => {
+ if target
+ .chars()
+ .all(|c| c.is_ascii_alphanumeric() || c == '_' || c == '-')
+ {
+ Ok(crate::integrations::composio::tools::canonicalize_toolkit_slug(target))
+ } else {
+ Err(MemoryError::invalid("a Composio target is a toolkit slug"))
+ }
+ }
}
}
+fn http_url(target: &str) -> MemoryResult<String> {
+ let url = url::Url::parse(target).map_err(|_| MemoryError::invalid("target is not a URL"))?;
+ if !matches!(url.scheme(), "http" | "https") || url.host_str().is_none() {
+ return Err(MemoryError::invalid("target must be an http(s) URL"));
+ }
+ Ok(url.to_string())
+}
+
/// Builds a new source from `memory_sources_add` params and appends it to
/// `config`; the caller persists `config`.
pub fn apply_add(
@@ -74,7 +112,7 @@ pub fn apply_add(
) -> MemoryResult<MemorySourceConfig> {
let kind = MemorySourceKind::parse(&params.kind).ok_or_else(|| {
MemoryError::invalid(format!(
- "unknown source kind `{}`: only folder and file sources are supported",
+ "unknown source kind `{}` (folder, file, link, github, rss, composio)",
params.kind.trim()
))
})?;
@@ -86,11 +124,19 @@ pub fn apply_add(
)));
}
}
+ // A Composio target saved before targets were canonicalized
+ // (`google_drive`) is the same toolkit as its canonical slug.
+ let same_target = |saved: &str| match kind {
+ MemorySourceKind::Composio => {
+ crate::integrations::composio::tools::canonicalize_toolkit_slug(saved) == target
+ }
+ _ => saved == target,
+ };
if config
.memory
.sources
.iter()
- .any(|source| source.kind == kind && source.target == target)
+ .any(|source| source.kind == kind && same_target(&source.target))
{
return Err(MemoryError::invalid("that source is already added"));
}
diff --git a/crates/openhuman-core/src/memory/sources/mod_tests.rs b/crates/openhuman-core/src/memory/sources/mod_tests.rs
index cbe1f45306..5cb7e6465a 100644
--- a/crates/openhuman-core/src/memory/sources/mod_tests.rs
+++ b/crates/openhuman-core/src/memory/sources/mod_tests.rs
@@ -35,12 +35,44 @@ fn normalize_target_accepts_each_kinds_shape() {
normalize_target(MemorySourceKind::File, "notes.md").unwrap(),
"notes.md"
);
+ assert_eq!(
+ normalize_target(MemorySourceKind::Github, "owner/repo").unwrap(),
+ "https://github.com/owner/repo"
+ );
+ assert_eq!(
+ normalize_target(MemorySourceKind::Github, "https://github.com/o/r").unwrap(),
+ "https://github.com/o/r"
+ );
+ assert_eq!(
+ normalize_target(MemorySourceKind::Rss, "https://example.com/feed.xml").unwrap(),
+ "https://example.com/feed.xml"
+ );
+ assert_eq!(
+ normalize_target(MemorySourceKind::Link, "https://example.com").unwrap(),
+ "https://example.com/"
+ );
+ assert_eq!(
+ normalize_target(MemorySourceKind::Composio, "GMail").unwrap(),
+ "gmail"
+ );
+ assert_eq!(
+ normalize_target(MemorySourceKind::Composio, "Google_Drive").unwrap(),
+ "googledrive"
+ );
}
#[test]
fn normalize_target_rejects_malformed_targets() {
for (kind, target) in [
(MemorySourceKind::Folder, " "),
+ (MemorySourceKind::Github, "just-one-part"),
+ (MemorySourceKind::Github, "a/b/c"),
+ (MemorySourceKind::Github, "/repo"),
+ (MemorySourceKind::Link, "not a url"),
+ (MemorySourceKind::Link, "ftp://example.com/x"),
+ (MemorySourceKind::Rss, "file:///etc/passwd"),
+ (MemorySourceKind::Composio, "has space"),
+ (MemorySourceKind::Composio, "a/b"),
] {
assert_eq!(
normalize_target(kind, target).unwrap_err().code(),
@@ -70,9 +102,9 @@ fn add_list_and_remove_round_trip_through_config() {
assert_eq!(added.label, "My notes");
assert_eq!(added.schedule_mins, Some(60));
- let unlabeled = apply_add(&mut config, &add_params("file", "notes/plan.md")).unwrap();
+ let unlabeled = apply_add(&mut config, &add_params("github", "owner/repo")).unwrap();
assert_eq!(
- unlabeled.label, "notes/plan.md",
+ unlabeled.label, "https://github.com/owner/repo",
"label defaults to the target"
);
@@ -116,31 +148,34 @@ fn add_validates_kind_schedule_and_target() {
.code(),
INVALID_REQUEST
);
+ assert_eq!(
+ apply_add(&mut config, &add_params("link", "nope"))
+ .unwrap_err()
+ .code(),
+ INVALID_REQUEST
+ );
assert!(
config.memory.sources.is_empty(),
"a refused add changes nothing"
);
-}
+ // A Composio source needs no reader.
+ apply_add(&mut config, &add_params("composio", "Gmail")).unwrap();
+ assert_eq!(config.memory.sources[0].target, "gmail");
-#[test]
-fn removed_network_kinds_are_rejected_with_a_clear_error() {
- let mut config = Config::default();
- for (kind, target) in [
- ("composio", "gmail"),
- ("link", "https://example.com"),
- ("github", "owner/repo"),
- ("rss", "https://example.com/feed.xml"),
- ] {
- let error = apply_add(&mut config, &add_params(kind, target)).unwrap_err();
- assert_eq!(error.code(), INVALID_REQUEST, "{kind}");
- assert!(
- String::from(error).contains("only folder and file"),
- "{kind}"
- );
- }
- assert!(config.memory.sources.is_empty());
- assert!(apply_add(&mut config, &add_params("folder", "/notes")).is_ok());
- assert!(apply_add(&mut config, &add_params("file", "/notes/a.md")).is_ok());
+ // A source saved under an alias before canonicalization is still the
+ // same toolkit.
+ config.memory.sources.push(MemorySourceConfig {
+ kind: MemorySourceKind::Composio,
+ target: "google_drive".into(),
+ ..source("src-drive", None)
+ });
+ assert_eq!(
+ apply_add(&mut config, &add_params("composio", "googledrive"))
+ .unwrap_err()
+ .code(),
+ INVALID_REQUEST
+ );
+ assert_eq!(config.memory.sources.len(), 2, "no duplicate was added");
}
#[test]
@@ -250,7 +285,7 @@ async fn forget_items_with_memory_off_is_not_an_error() {
#[test]
fn a_source_can_store_at_an_agent_node() {
let mut config = Config::default();
- let mut params = add_params("folder", "/team/a");
+ let mut params = add_params("link", "https://example.com/a");
params.namespace = Some("team:acme".into());
let added = apply_add(&mut config, &params).unwrap();
assert_eq!(added.namespace.as_deref(), Some("team:acme"));
@@ -260,7 +295,7 @@ fn a_source_can_store_at_an_agent_node() {
);
assert!(layout_of(&config, "unknown").root().is_root());
- let mut bad = add_params("folder", "/team/b");
+ let mut bad = add_params("link", "https://example.com/b");
bad.namespace = Some("nope".into());
assert_eq!(
apply_add(&mut config, &bad).unwrap_err().code(),
diff --git a/crates/openhuman-core/src/memory/sources/sync.rs b/crates/openhuman-core/src/memory/sources/sync.rs
index fc83a0a4a3..a1929d1fdf 100644
--- a/crates/openhuman-core/src/memory/sources/sync.rs
+++ b/crates/openhuman-core/src/memory/sources/sync.rs
@@ -1,17 +1,17 @@
//! Syncing sources into memory.
//!
-//! Sources are read through `tinymemory-integrations`' readers
-//! (`collect_items`), which turn each file under a folder, or the one file,
-//! into a `Document` with its metadata filled. Every item is scrubbed and
-//! stored on the bound engine; per-item failures are logged and skipped, not
-//! fatal.
+//! Non-Composio sources are read through `tinymemory-sources`' readers
+//! (`collect_items`), which turn each file, page, commit or feed entry into a
+//! `Document` with its metadata filled. Every item is scrubbed and stored on
+//! the bound engine; per-item failures are logged and skipped, not fatal.
+//! Composio sources go through [`super::composio`].
use std::collections::HashSet;
use std::path::PathBuf;
use std::sync::{LazyLock, Mutex};
use chrono::{DateTime, Utc};
-use tinymemory_integrations::sources::readers::reader_for;
+use tinymemory_integrations::sources::readers::reader_for_request;
use tinymemory_integrations::sources::{collect_items, MemorySourceEntry, SourceKind};
use crate::config::schema::{MemorySourceConfig, MemorySourceKind};
@@ -28,26 +28,55 @@ use super::state;
static RUNNING: LazyLock<Mutex<HashSet<(PathBuf, String)>>> =
LazyLock::new(|| Mutex::new(HashSet::new()));
-/// The `tinymemory-integrations` entry that reads `source`.
-pub(super) fn reader_entry(source: &MemorySourceConfig) -> MemoryResult<MemorySourceEntry> {
+/// The `tinymemory-sources` entry that reads `source`; `None` for Composio,
+/// which syncs through the connector module instead.
+pub(super) fn reader_entry(source: &MemorySourceConfig) -> MemoryResult<Option<MemorySourceEntry>> {
let kind = match source.kind {
MemorySourceKind::Folder => SourceKind::Folder,
MemorySourceKind::File => SourceKind::File,
+ MemorySourceKind::Link => SourceKind::WebPage,
+ MemorySourceKind::Github => SourceKind::GithubRepo,
+ MemorySourceKind::Rss => SourceKind::RssFeed,
+ MemorySourceKind::Composio => return Ok(None),
};
let mut entry = MemorySourceEntry::new(source.id.clone(), kind, source.label.clone());
- entry.path = Some(source.target.clone());
+ match source.kind {
+ MemorySourceKind::Folder | MemorySourceKind::File => {
+ entry.path = Some(source.target.clone())
+ }
+ _ => entry.url = Some(source.target.clone()),
+ }
+ apply_kind_defaults(&mut entry);
entry
.validate()
.map_err(|error| MemoryError::invalid(error.to_string()))?;
- Ok(entry)
+ Ok(Some(entry))
+}
+
+/// Fills the per-kind read caps the user did not set: a GitHub repo reads at
+/// most 10 PRs, 10 issues and 50 commits, a feed at most 20 items. How much a
+/// sync pulls is host policy, so it lives here rather than in the readers.
+fn apply_kind_defaults(entry: &mut MemorySourceEntry) {
+ match entry.kind {
+ SourceKind::GithubRepo => {
+ entry.max_prs.get_or_insert(10);
+ entry.max_issues.get_or_insert(10);
+ entry.max_commits.get_or_insert(50);
+ }
+ SourceKind::RssFeed => {
+ entry.max_items.get_or_insert(20);
+ }
+ _ => {}
+ }
}
/// Reads `source` and stores what it yields. Returns the number stored.
pub async fn sync_one(config: &Config, source: &MemorySourceConfig) -> MemoryResult<u64> {
let bound = engine::resolve(config).engine()?;
- let entry = reader_entry(source)?;
- let reader = reader_for(&entry.kind)
- .ok_or_else(|| MemoryError::invalid("no reader for this source kind"))?;
+ let Some(entry) = reader_entry(source)? else {
+ return super::composio::sync_toolkit(config, &bound, source).await;
+ };
+ let reader = reader_for_request(&entry.kind);
let collected = collect_items(
reader.as_ref(),
&entry,
@@ -67,7 +96,7 @@ pub async fn sync_one(config: &Config, source: &MemorySourceConfig) -> MemoryRes
config,
&bound,
collected.items,
- (source.kind, &source.id),
+ (source.kind, &source.target, &source.id),
&super::layout_of_source(config, source),
)
.await
@@ -80,20 +109,32 @@ pub(crate) async fn store_all(
config: &Config,
bound: &BoundEngine,
items: Vec<tinymemory_api::StoreItem>,
- (kind, source_id): (crate::config::schema::MemorySourceKind, &str),
+ source: (crate::config::schema::MemorySourceKind, &str, &str),
layout: &tinymemory_tools::MemoryLayout,
) -> MemoryResult<u64> {
- let mut stored = 0u64;
- let mut failed = 0u64;
+ let ids = store_all_ids(config, bound, items, source, layout).await?;
+ Ok(ids.iter().flatten().count() as u64)
+}
+
+/// [`store_all`], returning the id each item was stored under, in order
+/// (`None` for an item that failed).
+pub(crate) async fn store_all_ids(
+ config: &Config,
+ bound: &BoundEngine,
+ items: Vec<tinymemory_api::StoreItem>,
+ (kind, target, source_id): (crate::config::schema::MemorySourceKind, &str, &str),
+ layout: &tinymemory_tools::MemoryLayout,
+) -> MemoryResult<Vec<Option<String>>> {
+ let mut ids = Vec::with_capacity(items.len());
let mut last_error = None;
let mut touched = std::collections::BTreeSet::new();
for item in items {
- let brain_source = crate::memory::brain::brain_source(kind);
+ let brain_source = crate::memory::brain::brain_source(kind, target);
let node = crate::memory::brain::brain_node(config, layout, &brain_source, &item)?;
let item = crate::memory::brain::file_into(node.clone(), item);
match store_on(bound, item).await {
- Ok(_) => {
- stored += 1;
+ Ok(receipt) => {
+ ids.push(Some(receipt.id.to_string()));
touched.insert(node);
}
// Out of credits or unreachable refuses every item, so stop
@@ -101,7 +142,7 @@ pub(crate) async fn store_all(
Err(error) if error.is_account_wide() => return Err(error),
Err(error) => {
tracing::debug!(id = %source_id, code = error.code(), "[memory:sources] item store failed");
- failed += 1;
+ ids.push(None);
last_error = Some(error);
}
}
@@ -120,8 +161,8 @@ pub(crate) async fn store_all(
.collect();
crate::memory::lifecycle::jobs::enqueue(config, layout.root(), jobs).await;
match last_error {
- Some(error) if stored == 0 && failed > 0 => Err(error),
- _ => Ok(stored),
+ Some(error) if ids.iter().all(Option::is_none) => Err(error),
+ _ => Ok(ids),
}
}
diff --git a/crates/openhuman-core/src/memory/sources/sync_tests.rs b/crates/openhuman-core/src/memory/sources/sync_tests.rs
index 0c0d8faf84..a2dc8fcb3d 100644
--- a/crates/openhuman-core/src/memory/sources/sync_tests.rs
+++ b/crates/openhuman-core/src/memory/sources/sync_tests.rs
@@ -51,10 +51,25 @@ fn reader_entry_maps_every_kind() {
schedule_mins: None,
namespace: None,
};
- let folder = reader_entry(&mk(MemorySourceKind::Folder, "/p")).unwrap();
+ let folder = reader_entry(&mk(MemorySourceKind::Folder, "/p"))
+ .unwrap()
+ .unwrap();
assert_eq!(folder.path.as_deref(), Some("/p"));
- let file = reader_entry(&mk(MemorySourceKind::File, "/p/a.md")).unwrap();
+ let file = reader_entry(&mk(MemorySourceKind::File, "/p/a.md"))
+ .unwrap()
+ .unwrap();
assert_eq!(file.path.as_deref(), Some("/p/a.md"));
+ for (kind, target) in [
+ (MemorySourceKind::Link, "https://example.com/"),
+ (MemorySourceKind::Github, "https://github.com/o/r"),
+ (MemorySourceKind::Rss, "https://example.com/feed"),
+ ] {
+ let entry = reader_entry(&mk(kind, target)).unwrap().unwrap();
+ assert_eq!(entry.url.as_deref(), Some(target));
+ }
+ assert!(reader_entry(&mk(MemorySourceKind::Composio, "gmail"))
+ .unwrap()
+ .is_none());
}
#[tokio::test]
@@ -246,7 +261,7 @@ async fn store_all_skips_a_bad_item_but_fails_when_nothing_stored() {
&config,
&bound,
vec![bad.clone(), good],
- (MemorySourceKind::Folder, "src"),
+ (MemorySourceKind::Folder, "/n", "src"),
&tinymemory_tools::MemoryLayout::default()
)
.await
@@ -257,7 +272,7 @@ async fn store_all_skips_a_bad_item_but_fails_when_nothing_stored() {
&config,
&bound,
vec![bad],
- (MemorySourceKind::Folder, "src"),
+ (MemorySourceKind::Folder, "/n", "src"),
&tinymemory_tools::MemoryLayout::default()
)
.await
@@ -267,7 +282,7 @@ async fn store_all_skips_a_bad_item_but_fails_when_nothing_stored() {
&config,
&bound,
Vec::new(),
- (MemorySourceKind::Folder, "src"),
+ (MemorySourceKind::Folder, "/n", "src"),
&tinymemory_tools::MemoryLayout::default()
)
.await
@@ -319,7 +334,7 @@ async fn a_sync_queues_a_belief_build_only_for_an_engine_that_waits_for_one() {
&config,
&bound,
vec![note()],
- (MemorySourceKind::Folder, "src"),
+ (MemorySourceKind::Folder, "/n", "src"),
&tinymemory_tools::MemoryLayout::default(),
)
.await
@@ -333,20 +348,70 @@ async fn a_sync_queues_a_belief_build_only_for_an_engine_that_waits_for_one() {
}
}
-#[test]
-fn orphaned_connector_files_are_removed_and_missing_ones_ignored() {
+#[tokio::test]
+async fn github_files_per_repository_only_when_switched_on() {
let tmp = tempfile::tempdir().unwrap();
- let dir = tmp.path().join("memory");
- std::fs::create_dir_all(&dir).unwrap();
- std::fs::write(dir.join("connector_items.json"), "{}").unwrap();
- std::fs::write(dir.join("connection_roots.json"), "{}").unwrap();
- std::fs::write(dir.join("sources_state.json"), "{}").unwrap();
- state::remove_orphaned_connector_files(tmp.path());
- assert!(!dir.join("connector_items.json").exists());
- assert!(!dir.join("connection_roots.json").exists());
- assert!(
- dir.join("sources_state.json").exists(),
- "live state is kept"
+ let mut config = config_in(&tmp);
+ let engine = bind_reference(&config);
+ let bound = engine::resolve(&config).engine().unwrap();
+ let issue = |repo: &str, text: &str| {
+ let mut meta = tinymemory_api::MemoryMeta::default();
+ meta.repo = Some(repo.to_string());
+ tinymemory_api::StoreItem::document(text, meta)
+ };
+ let sync = |config: Config, items| {
+ let bound = bound.clone();
+ async move {
+ store_all(
+ &config,
+ &bound,
+ items,
+ (
+ MemorySourceKind::Github,
+ "https://github.com/acme/api",
+ "src",
+ ),
+ &tinymemory_tools::MemoryLayout::default(),
+ )
+ .await
+ .unwrap()
+ }
+ };
+ let nodes = || async {
+ let mut nodes: Vec<String> = stored(&engine, MetaFilter::kinds([ItemKind::Document]))
+ .await
+ .into_iter()
+ .map(|hit| hit.meta.namespace.to_string())
+ .collect();
+ nodes.sort();
+ nodes
+ };
+
+ // Off: one GitHub source.
+ config.memory.split_github_by_repo = false;
+ sync(config.clone(), vec![issue("acme/api", "off")]).await;
+ assert_eq!(nodes().await, ["source:github"]);
+
+ config.memory.split_github_by_repo = true;
+ sync(
+ config.clone(),
+ vec![issue("Acme/API", "one"), issue("acme/web", "two")],
+ )
+ .await;
+ assert_eq!(
+ nodes().await,
+ [
+ "source:github",
+ "source:github/project:acme--api",
+ "source:github/project:acme--web"
+ ]
+ );
+ assert_eq!(
+ crate::memory::lifecycle::jobs::snapshot(&config)
+ .await
+ .pending
+ .len(),
+ 3,
+ "one belief build per node written"
);
- state::remove_orphaned_connector_files(tmp.path());
}
diff --git a/crates/openhuman-core/src/platform/about_app/catalog_conversation_intelligence.rs b/crates/openhuman-core/src/platform/about_app/catalog_conversation_intelligence.rs
index 55646292d0..e95a3a8f2b 100644
--- a/crates/openhuman-core/src/platform/about_app/catalog_conversation_intelligence.rs
+++ b/crates/openhuman-core/src/platform/about_app/catalog_conversation_intelligence.rs
@@ -299,7 +299,7 @@ Capability {
domain: "memory",
category: CapabilityCategory::Intelligence,
description: "Ask a question and get an answer synthesised by the memory engine with citations to the documents, conversations and learnings it came from, or switch to raw search to see the ranked hits (keyword, vector or hybrid, with metadata filters). The agent does the same through the `memory` tool's `recall` and `fetch` actions.",
- how_to: "Ask in chat. The Memory page (/connections?tab=brain&brain=conversations) shows what was logged. Programmatic: openhuman.memory_recall and openhuman.memory_fetch (RPC).",
+ how_to: "Connections > Memory > Ask (/connections?tab=brain&brain=ask), or ask in chat. Programmatic: openhuman.memory_recall and openhuman.memory_fetch (RPC).",
status: CapabilityStatus::Beta,
privacy: MEMORY_TO_REMOTE_ENGINE,
},
@@ -309,7 +309,7 @@ Capability {
domain: "memory",
category: CapabilityCategory::Intelligence,
description: "Browse everything memory holds by a standard set of facets (type, source, source id, workspace, folder, file, language, repository, link, thread, agent, tool, tag, memory node): see how many items carry each value, drill down step by step, list the items there, and open one to read it whole with all its metadata or forget it. The facets are part of the memory contract, so the explorer works the same on every engine.",
- how_to: "Agents browse it with the memory tools. Programmatic: openhuman.memory_explore, memory_items_list with `path`, memory_items_get (RPC).",
+ how_to: "Connections > Memory > Explorer (/connections?tab=brain&brain=explorer). Programmatic: openhuman.memory_explore, memory_items_list with `path`, memory_items_get (RPC).",
status: CapabilityStatus::Beta,
privacy: MEMORY_TO_REMOTE_ENGINE,
},
@@ -329,7 +329,7 @@ Capability {
domain: "memory",
category: CapabilityCategory::Intelligence,
description: "Short durable facts, preferences and decisions the assistant keeps about you and your work. The agent stores one with the `memory` tool's `learn` action (tagged with the workspace, thread and agent it came from) and can `forget` it again; you can browse, add and delete them yourself.",
- how_to: "Tell the assistant to remember something. Programmatic: openhuman.memory_learn, memory_forget, memory_items_list (RPC).",
+ how_to: "Connections > Memory > Learnings (/connections?tab=brain&brain=learnings), or tell the assistant to remember something. Programmatic: openhuman.memory_learn, memory_forget, memory_items_list (RPC).",
status: CapabilityStatus::Beta,
privacy: MEMORY_TO_REMOTE_ENGINE,
},
@@ -348,8 +348,8 @@ Capability {
name: "Brain",
domain: "memory",
category: CapabilityCategory::Intelligence,
- description: "Documents every agent shares, filed by source type (files, and one per other source). Add a document from text or a file (text, markdown, HTML, code, PDF, Word, PowerPoint or Excel; images are not read yet), search it, forget a whole source, or keep it synced from a folder or a single file, on demand and on a schedule.",
- how_to: "Connections > Memory > Files (/connections?tab=brain&brain=brain). Programmatic: openhuman.memory_brain_sources, memory_brain_search, memory_brain_ingest, memory_brain_forget, memory_sources_add, memory_sources_sync (RPC).",
+ description: "Documents every agent shares, filed by source type (pdf, markdown, notion, github, web, and one per other source). Add a document from text or a file (text, markdown, HTML, code, PDF, Word, PowerPoint or Excel; images are not read yet), search it, forget a whole source, or keep it synced from a folder, a single file, a link, a GitHub repository, an RSS feed or a connected Composio toolkit, on demand and on a schedule.",
+ how_to: "Connections > Memory > Brain (/connections?tab=brain&brain=brain). Programmatic: openhuman.memory_brain_sources, memory_brain_search, memory_brain_ingest, memory_brain_forget, memory_sources_add, memory_sources_sync (RPC).",
status: CapabilityStatus::Beta,
privacy: MEMORY_TO_REMOTE_ENGINE,
},
@@ -359,7 +359,7 @@ Capability {
domain: "memory",
category: CapabilityCategory::Intelligence,
description: "Before the model answers, a short memory pack is recalled for the turn (relevant learnings and built beliefs, brain documents, this agent's history, briefly other agents') and added to that turn's request inside <memory-context>. It is never written into the chat, so the conversation and the prompt cache stay as they were. Long chats keep what they discussed through compaction, and beliefs are built from what was stored in the background. Size and sections are adjustable.",
- how_to: "Automatic for every chat turn. Tune it under Connections > Memory (/connections?tab=brain&brain=conversations). Programmatic: openhuman.memory_pack_preview, memory_policy_get, memory_policy_set, memory_jobs_list, memory_jobs_run (RPC).",
+ how_to: "Automatic for every chat turn. Preview it in Connections > Memory > Ask > Pack preview; tune it in Settings (/connections?tab=brain&brain=settings); watch belief builds in Background (/connections?tab=brain&brain=background). Programmatic: openhuman.memory_pack_preview, memory_policy_get, memory_policy_set, memory_jobs_list, memory_jobs_run (RPC).",
status: CapabilityStatus::Beta,
privacy: MEMORY_TO_REMOTE_ENGINE,
},
diff --git a/crates/openhuman-core/src/platform/about_app/catalog_tests.rs b/crates/openhuman-core/src/platform/about_app/catalog_tests.rs
index ff4bf6972b..e35b8c259a 100644
--- a/crates/openhuman-core/src/platform/about_app/catalog_tests.rs
+++ b/crates/openhuman-core/src/platform/about_app/catalog_tests.rs
@@ -493,11 +493,11 @@ fn local_ai_domain_is_populated_so_the_breadcrumb_check_is_not_vacuous() {
fn memory_v2_capabilities_cite_live_surface_and_rpcs() {
for (id, chip, rpc) in [
("memory.engine", "engine", "memory_engine_set"),
- ("memory.ask", "conversations", "memory_recall"),
- ("memory.learnings", "conversations", "memory_learn"),
+ ("memory.ask", "ask", "memory_recall"),
+ ("memory.learnings", "learnings", "memory_learn"),
("memory.conversations", "conversations", "memory_policy_set"),
("memory.documents", "brain", "memory_brain_ingest"),
- ("memory.turn_pack", "conversations", "memory_pack_preview"),
+ ("memory.turn_pack", "settings", "memory_pack_preview"),
] {
let cap = lookup(id).unwrap_or_else(|| panic!("missing `{id}`"));
assert!(