Repository navigation
feat(core): add file-based memory, persona, and tools (ENG-381) - #4
Merged
Merged
Conversation
added 2 commits
October 18, 2026 01:11
Add memory/profile.md and memory/notes/YYYY-MM-DD.md handling with fcntl.flock locking, persona.md read/write with y/n approval, RememberTool, RecallTool, SetPersonaTool, context integration, and client inspection helpers.
…h check (ENG-381)
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
Adds Aldwin's local file-based memory (
memory/profile.mdandmemory/notes/YYYY-MM-DD.md) and user-controlled persona (persona.md), along with theremember,recall, andset_personaAgentling tools. Anything that sits permanently in the prompt (profile.mdandpersona.md) is written or explicitly approved by the user (y/n), while agent-written daily notes are sanitized, locked withfcntl.flock, and fade from the system prompt after 7 days.Ticket
ENG-381 (Dev plan: ENG-392, Test plan: ENG-395).
Closes ENG-381.
Changes
src/aldwin/core/memory.py):sanitize_note_text,_notes_lock(fcntl.flockonmemory/.lock),remember_note, andrecall_notes(1–300 chars, marker/comment stripping, 7-day normalised duplicate detection, and word search across up to 92 days).read_profile,pop_profile_truncation_warning,memory_block(<memory>wrapper,## Profilecapped at 4,000 chars,## Recent notescapped at 4,000 chars keeping whole lines newest-first), andmemory_summary.src/aldwin/core/persona.py):read_persona(shipped default fallback, 2,000-char prompt cap with one-time log warning),write_persona,persona_text, andpersona_summary.src/aldwin/core/tools/):RememberTool(remember),RecallTool(recall), andSetPersonaTool(set_persona, gated byask("Update persona?", detail=...)).src/aldwin/core/context.py,src/aldwin/core/agent.py,src/aldwin/host/in_process.py,src/aldwin/client/):read_personaandmemory_blockintobuild_contextand default tools intobuild_agent.get_memory_summary,get_persona_text,get_persona_summary, andpop_profile_truncation_warningthroughaldwin.hostandaldwin.clientsoaldwin.clinever importsaldwin.core.tests/test_memory.py,tests/test_persona.py):TC-01–TC-12andTC-14–TC-21.How it was tested
uv run pytest --cov=aldwin— 138 passed (95% total coverage; 95% oncore/memory.py, 96% oncore/persona.py, 100% oncore/tools/*,< 10 mson 30 days of notes).uv run ruff check src tests,uv run ruff format --check src tests, anduv run mypy --stricton new modules — all passed with 0 errors.Notes for reviewers
/memory,/persona, and the approval panel is scoped toENG-383.