-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(memory): model memory as a userland extension — implements #3537 #5205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
f4f817c
test(architecture): enforce reborn dependency boundaries as a workspa…
BenKurrek 3a2c4ad
feat(memory): make the host the sole constructor of admitted memory c…
BenKurrek acc1b88
refactor(memory): route user-profile reads through the MemoryService …
BenKurrek f416967
docs(memory): document the two context-path deltas from the regressio…
BenKurrek e7b2eb0
feat(memory): host memory profile catalog, host ports, native v2 mani…
BenKurrek d9b90a3
feat(memory): add [memory] profile-binding config section (#3537)
BenKurrek 6485f57
feat(memory): wire memory binding through composition + CLI startup (…
BenKurrek 40179f5
docs(memory): add manifest-v2 + host-storage-port ADRs; update memory…
BenKurrek c8aceef
fix(memory): address review on the #3537 memory binding (scope guard,…
BenKurrek 6e34b16
refactor(memory): single MemoryServiceResolver for every memory consu…
BenKurrek 036540a
refactor(memory): collapse memory to a single always-on ironclaw.memo…
BenKurrek 84086bf
refactor(memory): load native memory from the bundled v2 TOML manifes…
BenKurrek b4f1bfe
docs(memory): document the live always-on native v2 memory surface
BenKurrek 566323d
fix(memory): keep display-preview summaries working for native memory…
BenKurrek 68ccd94
fix(memory): complete native-package test + schema updates for host_r…
BenKurrek bd3f533
fix(memory): green the Reborn e2e harness + coverage for the native p…
BenKurrek 958a8b7
feat(memory): config-driven mem0 document-store provider (#3537)
BenKurrek 3d48e87
test(memory): host drops provider-supplied cross-scope context snippets
BenKurrek 2038048
feat(memory): make the mem0 provider fully local (self-hosted OSS)
BenKurrek 2d21441
fix(memory): keep mem0 off by default (no default base URL)
BenKurrek 3dd8c83
fix(memory): apply consolidated review findings (docs, secrets, fail-…
BenKurrek ad84d34
docs(memory): document that prompt-write-safety is native-only (#5264)
BenKurrek b1da109
refactor(memory): feature-gate the mem0 provider behind `memory-mem0`…
BenKurrek 3ea70cf
fix(memory): address CodeRabbit re-review findings (mem0 correctness,…
BenKurrek bb40e02
fix(memory): address CodeRabbit re-review round 2 (target containment…
BenKurrek 4c96023
refactor(memory): forward the memory-mem0 feature from the reborn CLI
BenKurrek e58aa9e
Merge remote-tracking branch 'origin/main' into reborn/memory-lift-fo…
BenKurrek f8377b9
chore(deps): ignore RUSTSEC-2026-0187 (lopdf PDF stack-overflow, boun…
BenKurrek 502f676
feat(memory): workspace-bound local-dev mem0 isolation (fold workspac…
BenKurrek 6934436
fix(memory): make agent-facing memory surface backend-agnostic (ironc…
BenKurrek a0310d6
Merge origin/main into reborn/memory-lift-followups
BenKurrek 13825be
fix(memory): address userland extension review feedback
BenKurrek 0f0a350
Fix native memory CI harness wiring
BenKurrek 0591e47
Merge origin/main into reborn/memory-lift-followups
BenKurrek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
crates/ironclaw_host_runtime/assets/memory_native/manifest.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| schema_version = "reborn.extension_manifest.v2" | ||
| id = "ironclaw.memory" | ||
| name = "Reborn Memory" | ||
| version = "0.1.0" | ||
| description = "Host-bundled memory extension (issue #3537). The read and write tools below implement the host-defined memory.document_store.v1 profile; search and tree are provider-specific model-facing tools that implement no portable profile. Registered on the always-on first-party lane (like the builtin toolset), so the tools are unconditionally available. The backing provider is resolved by the document-store profile binding — the native filesystem provider by default, swappable without changing these tools — not by install/enable lifecycle." | ||
| # Requested trust only; the host trust policy computes effective trust. A | ||
| # `first_party` runtime + reserved `ironclaw.*` id are accepted only for the | ||
| # loader-supplied `HostBundled` source, and only when a matching host service | ||
| # (`native_memory_provider`) is registered — the bundled TOML alone is not | ||
| # authority. | ||
| trust = "first_party_requested" | ||
|
|
||
| [runtime] | ||
| kind = "first_party" | ||
| service = "native_memory_provider" | ||
|
|
||
| # memory.document_store.v1 — read operation, exposed as a model-facing tool. The | ||
| # schema refs match the document_store profile's read-operation refs so the | ||
| # conformance harness binds this capability to that operation. | ||
| [[capabilities]] | ||
| id = "ironclaw.memory.read" | ||
| implements = ["memory.document_store.v1"] | ||
| description = "Read a Reborn persistent memory document in the current tenant/user/agent/project scope." | ||
| effects = ["read_filesystem"] | ||
| default_permission = "allow" | ||
| visibility = "model" | ||
| input_schema_ref = "schemas/memory/document-read.input.v1.json" | ||
| output_schema_ref = "schemas/memory/document-read.output.v1.json" | ||
| prompt_doc_ref = "prompts/memory-native/read.md" | ||
|
|
||
| # memory.document_store.v1 — write operation, exposed as a model-facing tool. | ||
| # Host prompt-write safety runs before dispatching writes to prompt-injected | ||
| # memory files. | ||
| [[capabilities]] | ||
| id = "ironclaw.memory.write" | ||
| implements = ["memory.document_store.v1"] | ||
| description = "Write, append, or patch Reborn persistent memory documents in the current tenant/user/agent/project scope. For structured user facts (timezone, locale, location), use builtin.profile_set instead." | ||
| effects = ["read_filesystem", "write_filesystem"] | ||
| default_permission = "allow" | ||
| visibility = "model" | ||
| input_schema_ref = "schemas/memory/document-write.input.v1.json" | ||
| output_schema_ref = "schemas/memory/document-write.output.v1.json" | ||
| prompt_doc_ref = "prompts/memory-native/write.md" | ||
|
|
||
| # Native search convenience. Implements no portable profile operation — it is a | ||
| # provider-specific model tool layered on the same filesystem store. | ||
| [[capabilities]] | ||
| id = "ironclaw.memory.search" | ||
| implements = [] | ||
| description = "Search only Reborn internal persistent memory documents in the current tenant/user/agent/project scope; this does not search connected app or extension data." | ||
| effects = ["read_filesystem"] | ||
| default_permission = "allow" | ||
| visibility = "model" | ||
| input_schema_ref = "schemas/memory/search.input.v1.json" | ||
| output_schema_ref = "schemas/memory/search.output.v1.json" | ||
| prompt_doc_ref = "prompts/memory-native/search.md" | ||
|
|
||
| # Native tree/list convenience. Implements no portable profile operation. | ||
| [[capabilities]] | ||
| id = "ironclaw.memory.tree" | ||
| implements = [] | ||
| description = "List Reborn persistent memory documents as a compact tree." | ||
| effects = ["read_filesystem"] | ||
| default_permission = "allow" | ||
| visibility = "model" | ||
| input_schema_ref = "schemas/memory/tree.input.v1.json" | ||
| output_schema_ref = "schemas/memory/tree.output.v1.json" | ||
| prompt_doc_ref = "prompts/memory-native/tree.md" | ||
3 changes: 3 additions & 0 deletions
3
crates/ironclaw_host_runtime/assets/memory_native/prompts/memory-native/read.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Read a persistent memory document by relative path, scoped to the current | ||
| tenant/user/agent/project. Returns the document content and its word count. | ||
| Use it to recall previously written notes, logs, or profile facts before acting. | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
4 changes: 4 additions & 0 deletions
4
crates/ironclaw_host_runtime/assets/memory_native/prompts/memory-native/search.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Search persistent memory documents with a natural-language `query`, scoped to | ||
| the current tenant/user/agent/project. Returns the best-matching snippets with | ||
| their source path and a relevance score. Use it to find relevant notes when you | ||
| do not know the exact document path. |
4 changes: 4 additions & 0 deletions
4
crates/ironclaw_host_runtime/assets/memory_native/prompts/memory-native/tree.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| List persistent memory documents as a compact tree, scoped to the current | ||
| tenant/user/agent/project. Optionally pass a `path` to list a subdirectory and a | ||
| `depth` to bound traversal. Use it to discover what memory documents exist before | ||
| reading or writing. |
5 changes: 5 additions & 0 deletions
5
crates/ironclaw_host_runtime/assets/memory_native/prompts/memory-native/write.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Write, append, or patch a persistent memory document, scoped to the current | ||
| tenant/user/agent/project. Choose a `target` (e.g. `memory`, `daily_log`, | ||
| `heartbeat`, or a relative path); set `append` to add rather than replace; or | ||
| supply `old_string`/`new_string` to patch in place. For structured user facts | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| (timezone, locale, location) prefer builtin.profile_set instead. | ||
13 changes: 13 additions & 0 deletions
13
crates/ironclaw_host_runtime/assets/memory_native/schemas/memory/document-read.input.v1.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "type": "object", | ||
| "properties": { | ||
| "path": { | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "pattern": "^[^/]", | ||
| "description": "Relative memory document path to read; must not be absolute (no leading '/'). The host filesystem additionally rejects '..' traversal and resolves the path within the scoped /memory mount." | ||
| } | ||
| }, | ||
| "required": ["path"], | ||
| "additionalProperties": false | ||
| } |
10 changes: 10 additions & 0 deletions
10
...es/ironclaw_host_runtime/assets/memory_native/schemas/memory/document-read.output.v1.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "type": "object", | ||
| "properties": { | ||
| "path": { "type": "string", "description": "Relative memory document path that was read" }, | ||
| "content": { "type": "string", "description": "Full document content" }, | ||
| "word_count": { "type": "integer", "description": "Word count of the document content" } | ||
| }, | ||
| "required": ["path", "content", "word_count"], | ||
| "additionalProperties": false | ||
| } |
42 changes: 42 additions & 0 deletions
42
...es/ironclaw_host_runtime/assets/memory_native/schemas/memory/document-write.input.v1.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| { | ||
| "type": "object", | ||
| "properties": { | ||
| "content": { | ||
| "type": "string", | ||
| "description": "Full content to write or append" | ||
| }, | ||
| "target": { | ||
| "type": "string", | ||
| "description": "Where to write: 'memory' for MEMORY.md, 'daily_log' for today's log, 'heartbeat' for HEARTBEAT.md checklist, 'bootstrap' to clear BOOTSTRAP.md (content is ignored; the file is always cleared), or a relative memory document path. A reserved name or non-blank relative path is allowed; it must not be blank, absolute (no leading '/'), contain '..' traversal, or use backslash separators. The configured document-store provider owns final storage resolution.", | ||
| "default": "daily_log", | ||
| "not": { "pattern": "(^\\s*$)|(^/)|(\\.\\.)|(\\\\)" } | ||
| }, | ||
|
BenKurrek marked this conversation as resolved.
|
||
| "append": { | ||
| "type": "boolean", | ||
| "description": "Append to existing content when true; replace when false", | ||
| "default": true | ||
| }, | ||
| "metadata": { | ||
| "type": "object", | ||
| "description": "Optional document metadata such as skip_indexing or skip_versioning" | ||
| }, | ||
| "old_string": { | ||
| "type": "string", | ||
| "description": "Exact text to replace; switches to patch mode" | ||
| }, | ||
| "new_string": { | ||
| "type": "string", | ||
| "description": "Replacement text for patch mode" | ||
| }, | ||
| "replace_all": { | ||
| "type": "boolean", | ||
| "description": "Replace every old_string occurrence in patch mode", | ||
| "default": false | ||
| }, | ||
| "timezone": { | ||
| "type": "string", | ||
| "description": "IANA timezone used only for daily_log target date resolution" | ||
| } | ||
| }, | ||
| "additionalProperties": false | ||
|
BenKurrek marked this conversation as resolved.
|
||
| } | ||
17 changes: 17 additions & 0 deletions
17
...s/ironclaw_host_runtime/assets/memory_native/schemas/memory/document-write.output.v1.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "type": "object", | ||
| "properties": { | ||
| "status": { | ||
| "type": "string", | ||
| "enum": ["cleared", "patched", "written"], | ||
| "description": "Write outcome" | ||
| }, | ||
| "path": { "type": "string", "description": "Relative memory document path that was written" }, | ||
| "message": { "type": "string", "description": "Human-readable note (cleared status)" }, | ||
| "replacements": { "type": "integer", "description": "Number of replacements made (patched status)" }, | ||
| "content_length": { "type": "integer", "description": "Resulting content length in bytes" }, | ||
| "append": { "type": "boolean", "description": "Whether the write appended (written status)" } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| }, | ||
| "required": ["status", "path"], | ||
| "additionalProperties": false | ||
|
BenKurrek marked this conversation as resolved.
|
||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.