feat(agent): add SOUL.md and USER.md to agent identity context#890
feat(agent): add SOUL.md and USER.md to agent identity context#890jayzen33 wants to merge 1 commit intosipeed:mainfrom
Conversation
- Add template variables for workspace path consistency - Document SOUL.md as agent's identity and personality file - Document USER.md as user preferences file - Update memory rules to encourage agent to proactively update these files when learning about identity/preferences
There was a problem hiding this comment.
Pull request overview
Updates the agent’s identity/system prompt so it explicitly includes and instructs upkeep of SOUL.md (agent identity) and USER.md (user preferences), improving long-term context maintenance in the workspace.
Changes:
- Extend the workspace section of the identity prompt to list
SOUL.mdandUSER.mdalongside existing context files. - Add explicit “Memory & Identity” rules that direct the agent when to update
MEMORY.md,SOUL.md, andUSER.md. - Refactor the identity prompt construction to use a single
${WORKSPACE}placeholder replaced with the absolute workspace path.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nikolasdehor
left a comment
There was a problem hiding this comment.
The feature itself is useful -- explicitly instructing the agent to update SOUL.md and USER.md will improve identity persistence across conversations.
Code quality note: The refactor from fmt.Sprintf with positional %s to strings.ReplaceAll with ${WORKSPACE} is a readability improvement. The old code had 5 positional %s args that were hard to track.
Concern: The diff adds SOUL.md and USER.md references to the system prompt, but I don't see any logic to actually load these files into the context. Looking at BuildSystemPrompt() -- does it read SOUL.md and USER.md contents and inject them into the prompt? If not, the agent can write to these files but their content will never be seen in future sessions. The instruction to update these files is only useful if there is a corresponding read path.
Could you clarify whether SOUL.md and USER.md are loaded elsewhere (e.g., in BuildSystemPrompt or a context builder)? If not, this PR should also add the read path, otherwise the agent will write files that are never consumed.
|
📝 Description
Currently, the agent rarely updates SOUL.md and USER.md files, even when users explicitly share information about themselves or their preferences. Through testing, I discovered this is because the system prompt doesn't clearly instruct the agent to do so. This PR adds explicit instructions in the agent's system prompt to update these files.
🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
📚 Technical Context (Skip for Docs)
pkg/agent/context.golacked explicit instructions for updating SOUL.md and USER.md files. Adding clear instructions ensures the agent properly maintains user and identity context across conversations.🧪 Test Environment
📸 Evidence (Optional)
Click to view Logs/Screenshots
Changes made to
pkg/agent/context.go:Before:
After:
☑️ Checklist