You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add persistent memory system for cross-session context
- Add data/memory.md for storing user profile, projects, and preferences
- Create src/utils/memory.js with load/save/update helpers
- Inject memory into system prompt on every session
- Update bot instructions to maintain memory when user shares info
- Gitignore data/ to protect personal data from cloud exposure
exportconstDEFAULT_SYSTEM_PROMPT=`You are "El Coleto", a high-energy, vibrant, and brazenly honest personal assistant from the Colombian Caribbean coast. 🇨🇴🥥
10
11
Your voice is informal but sharp, energetic, and completely "sin vergüenza" (shameless) when it comes to the truth.
@@ -42,6 +43,7 @@ Your primary goal is to be a **Direct Strategic Partner**. You don't just agree;
42
43
5. **Safety Guard**: NEVER delete repositories or close issues without explicit confirmation.
43
44
6. **File System**: "rm" is blocked. Use it to organize the project responsibly.
44
45
7. **Accuracy**: If writing code, provide complete, working examples.
46
+
8. **Memory**: When the user shares personal info, preferences, or context worth remembering, update \`data/memory.md\` using bash tools to persist it. Keep it light.
@@ -67,6 +69,9 @@ export async function handleMessage(ctx) {
67
69
constchatId=ctx.chat.id;
68
70
constuserMessage=ctx.message.text;
69
71
72
+
constmemory=loadMemory();
73
+
constmemoryContext=memory ? `\n\n## 📝 PERSISTENT MEMORY\nThe following is stored memory from previous sessions:\n${memory}\n\nUse this memory to maintain context across conversations. Update it when the user shares new information about themselves, their preferences, projects, or anything worth remembering long-term.` : '';
74
+
70
75
// Validate input
71
76
if(!isValidMessage(userMessage))return;
72
77
@@ -139,8 +144,8 @@ export async function handleMessage(ctx) {
? `${DEFAULT_SYSTEM_PROMPT} \n\n⚠️ ** DEVELOPER MODE ACTIVE **: You have explicit permission to modify source code in \`src/\`. Use bash and file_edit tools responsibly.`
143
-
: `${DEFAULT_SYSTEM_PROMPT}\n\n🔒 **DEVELOPER MODE DISABLED**: You are FORBIDDEN from modifying files in \`src/\`. If requested, explain that /dev mode must be enabled. You CAN still edit \`todos.md\`, \`output/\`, and \`notes/\`.`;
147
+
? `${DEFAULT_SYSTEM_PROMPT}${memoryContext} \n\n⚠️ ** DEVELOPER MODE ACTIVE **: You have explicit permission to modify source code in \`src/\`. Use bash and file_edit tools responsibly.`
148
+
: `${DEFAULT_SYSTEM_PROMPT}${memoryContext}\n\n🔒 **DEVELOPER MODE DISABLED**: You are FORBIDDEN from modifying files in \`src/\`. If requested, explain that /dev mode must be enabled. You CAN still edit \`todos.md\`, \`output/\`, and \`notes/\`.`;
0 commit comments