feat: unify agent read/write to support all files, not just MEMORY.md#1045
Merged
feat: unify agent read/write to support all files, not just MEMORY.md#1045
Conversation
…closes #1044) Generalize AgentMemory service, abilities, CLI, and AI tool to accept a file parameter. Section-level operations (read, write, search, sections) now work on any agent file — SOUL.md, USER.md, SITE.md, etc. — not just MEMORY.md. - AgentMemory: add $filename constructor param with layer-aware path resolution via MemoryFileRegistry (shared, agent, user, network) - AgentMemoryAbilities: add 'file' to all 4 ability input schemas with editability enforcement for non-MEMORY.md writes - MemoryCommand CLI: read/write use .md heuristic for disambiguation, search/sections use --file flag. Deprecation warnings on agent files read/write subcommands - AgentMemory AI tool: add 'file' parameter to tool definition Backwards compatible — file defaults to MEMORY.md everywhere.
The unified agent read/write now handles all file operations with section awareness. Remove the redundant files_read and files_write methods and their helper functions. agent files retains list and check actions.
Contributor
Homeboy Results —
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #1044. Unifies the dual
agent read/writeandagent files read/writecommand paths into a single interface that supports section-level operations on any agent file.Before:
agent read/writewas silently hardcoded to MEMORY.md. To read SOUL.md or USER.md, you had to useagent files read— which had no section awareness.After: One interface, full capability:
Changes
AgentMemoryservice — accepts$filenameparam (defaultMEMORY.md), resolves path viaMemoryFileRegistrylayer system (shared, agent, user, network)AgentMemoryAbilities— addsfileto all 4 ability input schemas, enforces editability for non-MEMORY.md writesMemoryCommandCLI —read/writeuse.mdsuffix heuristic for arg disambiguation;search/sectionsuse--fileflagAgentMemoryAI tool — addsfileparameter so AI agents can do section ops on any fileagent files read/writeemit warnings pointing to the unified commandsBackwards compatibility
Fully backwards compatible.
filedefaults toMEMORY.mdin all APIs. Existing commands, abilities, REST endpoints, and AI tool calls work unchanged.Testing
Manually verified on live site:
agent read/agent read "Section"— MEMORY.md (default, unchanged)agent read SOUL.md/agent read SOUL.md "Identity"— agent layeragent read USER.md "About"— user layer resolutionagent read SITE.md— shared layer resolutionagent sections --file=SOUL.md/agent sections --file=USER.mdagent search "Charleston" --file=USER.mdagent write "Key Facts" "..." --mode=append— backwards compatagent files read SOUL.md— deprecation warning emitted