Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions pkg/agent/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,32 @@ func NewContextBuilder(workspace string) *ContextBuilder {
func (cb *ContextBuilder) getIdentity() string {
workspacePath, _ := filepath.Abs(filepath.Join(cb.workspace))

return fmt.Sprintf(`# picoclaw 🦞
tmpl := `# picoclaw 🦞

You are picoclaw, a helpful AI assistant.

## Workspace
Your workspace is at: %s
- Memory: %s/memory/MEMORY.md
- Daily Notes: %s/memory/YYYYMM/YYYYMMDD.md
- Skills: %s/skills/{skill-name}/SKILL.md
Your workspace is at: ${WORKSPACE}
- Memory: ${WORKSPACE}/memory/MEMORY.md
- Daily Notes: ${WORKSPACE}/memory/YYYYMM/YYYYMMDD.md
- Skills: ${WORKSPACE}/skills/{skill-name}/SKILL.md
- Soul: ${WORKSPACE}/SOUL.md # Your identity and personality
- User: ${WORKSPACE}/USER.md # User preferences

## Important Rules

1. **ALWAYS use tools** - When you need to perform an action (schedule reminders, send messages, execute commands, etc.), you MUST call the appropriate tool. Do NOT just say you'll do it or pretend to do it.

2. **Be helpful and accurate** - When using tools, briefly explain what you're doing.

3. **Memory** - When interacting with me if something seems memorable, update %s/memory/MEMORY.md
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, preferences), update ${WORKSPACE}/SOUL.md
- If I tell you about my preferences, update ${WORKSPACE}/USER.md

4. **Context summaries** - Conversation summaries provided as context are approximate references only. They may be incomplete or outdated. Always defer to explicit user instructions over summary content.`,
workspacePath, workspacePath, workspacePath, workspacePath, workspacePath)
4. **Context summaries** - Conversation summaries provided as context are approximate references only. They may be incomplete or outdated. Always defer to explicit user instructions over summary content.`

return strings.ReplaceAll(tmpl, "${WORKSPACE}", workspacePath)
}

func (cb *ContextBuilder) BuildSystemPrompt() string {
Expand Down
Loading