Problem
Memory can be written via existing memory abilities, but explicit memory read abilities are missing. The model currently relies on prompt context assembly only, which is not always sufficient for targeted retrieval.
Current State
- Memory persistence is centralized in
includes/helpers/class-memory-helper.php.
- Existing abilities include add/update/delete for short/long-term memory.
- Memory files map to:
- long-term:
memory.md
- daily:
memory-ddmmyyyy.md
Implementation Plan
1) Add explicit read abilities
Create abilities in includes/abilities/:
memory_long_term_read
memory_short_term_read
2) Input schemas
memory_long_term_read: optional options (max_chars, default cap).
memory_short_term_read:
- optional
date (supports default=today)
- optional
max_chars.
3) Output schemas
Include:
filename
content
exists boolean
- optional metadata (
daily_timestamp, content_length).
4) Implementation constraints
- Route all reads through
Memory_Helper methods only.
- Apply truncation limits to avoid overlarge tool payloads.
- Mark abilities readonly + idempotent.
5) Register + map
- Register in
includes/class-abilities.php.
- Add tool mappings in
Abilities_Helper::TOOL_TO_ABILITY.
Acceptance Criteria
- Agent can read long-term and short-term memory via tools.
- Missing daily file returns deterministic
exists=false (not hard failure).
- Large memory values are safely bounded.
- No direct CPT access bypassing
Memory_Helper.
Test Plan
- Unit tests for:
- long-term read with content,
- short-term read for existing and missing day,
- truncation behavior,
- invalid input handling.
- Tool declaration tests for new abilities.
Out of Scope
- Memory search/indexing.
- Bulk reads (covered by separate issue).
Problem
Memory can be written via existing memory abilities, but explicit memory read abilities are missing. The model currently relies on prompt context assembly only, which is not always sufficient for targeted retrieval.
Current State
includes/helpers/class-memory-helper.php.memory.mdmemory-ddmmyyyy.mdImplementation Plan
1) Add explicit read abilities
Create abilities in
includes/abilities/:memory_long_term_readmemory_short_term_read2) Input schemas
memory_long_term_read: optional options (max_chars, default cap).memory_short_term_read:date(supports default=today)max_chars.3) Output schemas
Include:
filenamecontentexistsbooleandaily_timestamp,content_length).4) Implementation constraints
Memory_Helpermethods only.5) Register + map
includes/class-abilities.php.Abilities_Helper::TOOL_TO_ABILITY.Acceptance Criteria
exists=false(not hard failure).Memory_Helper.Test Plan
Out of Scope