prompt tuning

This commit is contained in:
Michael Neale
2026-04-16 07:59:07 +10:00
parent 55493ed5cb
commit d13f56dbf4
2 changed files with 32 additions and 15 deletions
@@ -276,10 +276,16 @@ impl AdaptiveMemoryClient {
let mut instructions = String::from(
"You have persistent adaptive memory across sessions.\n\
The most valuable memory prevents the user from having to repeat themselves.\n\
Save proactively — don't wait to be asked.\n\n\
TWO TARGETS:\n\
- 'user': who the user is — name, role, preferences, communication style\n\
- 'memory': your notes — environment facts, project conventions, tool quirks\n\n\
WHEN TO SAVE:\n\
- User corrects you or says 'remember this' / 'don't do that again' → save immediately\n\
- User shares a preference, habit, or personal detail (name, role, timezone, coding style) → target: user\n\
- You discover something about the environment (OS, installed tools, project structure, build commands) → target: memory\n\
- You learn a convention, API quirk, or workflow specific to this user's setup → target: memory\n\
- You identify a stable fact useful in future sessions → target: memory\n\n\
PRIORITY: User preferences and corrections > environment facts > procedural knowledge.\n\n\
Do NOT save: task progress, session outcomes, temporary state, things easily re-discovered.\n\n\
ACTIONS: add, replace (old_text identifies entry), remove (old_text identifies entry)\n\n\
Memory has hard size limits. Adds that exceed the limit are REJECTED.\n\
Replace or remove existing entries to make room first.\n",
@@ -343,13 +349,21 @@ impl McpClientTrait for AdaptiveMemoryClient {
let tool = Tool::new(
"memory",
"Save durable information to persistent memory that survives across sessions. \
Memory is injected into every turn, so keep it compact.\n\n\
WHEN TO SAVE (proactively):\n\
- User corrects you or says 'remember this'\n\
- User shares preferences, habits, personal details → target: user\n\
- You discover environment facts, tool quirks → target: memory\n\n\
Do NOT save: task progress, session outcomes, temporary state.\n\
SKIP: trivial info, things easily re-discovered."
Memory is injected into every future turn, so keep entries compact and focused on \
facts that will still matter later.\n\n\
WHEN TO SAVE (do this proactively, don't wait to be asked):\n\
- User corrects you or says 'remember this' / 'don't do that again'\n\
- User shares a preference, habit, or personal detail (name, role, timezone, coding style)\n\
- You discover something about the environment (OS, installed tools, project structure)\n\
- You learn a convention, API quirk, or workflow specific to this user's setup\n\
- You identify a stable fact that will be useful again in future sessions\n\n\
PRIORITY: User preferences and corrections > environment facts > procedural knowledge. \
The most valuable memory prevents the user from having to repeat themselves.\n\n\
TWO TARGETS:\n\
- 'user': who the user is — name, role, preferences, communication style, pet peeves\n\
- 'memory': your notes — environment facts, project conventions, tool quirks, lessons learned\n\n\
Do NOT save: task progress, session outcomes, completed-work logs, or temporary state.\n\
SKIP: trivial/obvious info, things easily re-discovered, raw data dumps."
.to_string(),
schema.as_object().unwrap().clone(),
);
+8 -5
View File
@@ -47,13 +47,16 @@ Use Markdown formatting for all responses.
When working with memory and skills extensions:
## Memory
The most valuable memory prevents the user from having to repeat themselves.
Save proactively — don't wait to be asked:
- User corrects you or says "remember this" → save immediately
- User shares a preference, habit, or personal detail → save to user_profile category
- You discover something about the environment → save to a relevant category
- Do NOT save: task progress, session outcomes, temporary state
- User corrects you or says "remember this" / "don't do that again" → save immediately
- User shares a preference, habit, or personal detail → save to target "user"
- You discover something about the environment (OS, tools, project structure, build commands) → save to target "memory"
- You learn a convention, API quirk, or workflow specific to this user's setup → save to target "memory"
- Do NOT save: task progress, session outcomes, temporary state, things easily re-discovered
When memory is at capacity, curate: replace outdated entries, remove low-value ones.
Priority: User preferences and corrections > environment facts > procedural knowledge.
When memory is at capacity, curate: replace outdated entries, remove low-value ones, consolidate related entries.
## Skills
After completing complex work (many tool calls, error recovery, or non-obvious workflows),