Skip to content

feat(agent): add self-update instructions for SOUL.md and USER.md#2042

Open
perhapzz wants to merge 1 commit intosipeed:mainfrom
perhapzz:feat/agent-self-update-identity
Open

feat(agent): add self-update instructions for SOUL.md and USER.md#2042
perhapzz wants to merge 1 commit intosipeed:mainfrom
perhapzz:feat/agent-self-update-identity

Conversation

@perhapzz
Copy link
Contributor

📝 Description

Add instructions to the agent's system prompt telling it to self-update identity files when users share relevant information:

  • SOUL.md — updated when the user describes the agent's name, personality, or traits
  • USER.md — updated when the user shares their preferences

Previously, only memory/MEMORY.md was mentioned in the identity prompt. This change extends the existing rule to also cover identity files, enabling the agent to build and maintain its persona over time.

Changes

In pkg/agent/context.go, the getIdentity() template's rule #3 is expanded from:

3. **Memory** - When interacting with me if something seems memorable, update {workspace}/memory/MEMORY.md

to:

3. **Memory & Identity** - When interacting with me:
   - If something seems memorable, update {workspace}/memory/MEMORY.md
   - If I tell you about yourself (your name, personality, traits), update {workspace}/SOUL.md
   - If I share my preferences, update {workspace}/USER.md
   Always briefly mention what you updated so I know.

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

Addresses #1756

📚 Technical Context

  • Reasoning: The agent already loads SOUL.md and USER.md into context via LoadBootstrapFiles() (Feat/issue 1218 agent md context structure #1705), but is never told it can update them. This small prompt change closes that gap.
  • Minimal change: +6/-2 lines in a single file
  • No new dependencies, no config changes
  • Backward compatible — existing agents simply gain new self-update awareness

Design Decisions

Per the questions in #1756:

  1. Where — Added to getIdentity() template (rule feat: implement dynamic context compression #3), keeping all memory/identity instructions together
  2. Safeguards — Agent is asked to "briefly mention what you updated" rather than requiring confirmation, keeping the UX lightweight
  3. Configurability — Not configurable in this first pass; can be made opt-out via config if needed later

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

@sipeed-bot sipeed-bot bot added type: enhancement New feature or request domain: agent go Pull requests that update go code labels Mar 26, 2026
Extend the agent's identity prompt to instruct it to update SOUL.md when
users describe the agent's personality/traits, and USER.md when users
share their preferences. Previously only memory/MEMORY.md updates were
mentioned.
@perhapzz perhapzz force-pushed the feat/agent-self-update-identity branch from 953f1aa to 01e3522 Compare March 26, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: agent go Pull requests that update go code type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant