{"skill":{"slug":"secondmind","displayName":"SecondMind","summary":"Autonomous three-tier memory with proactive initiative, project tracking, and social intelligence. Ingests OpenClaw conversations, extracts knowledge + emoti...","description":"---\nname: secondmind\nemoji: 🧠\nversion: 1.4.0\ndescription: >\n  Autonomous three-tier memory with proactive initiative, project tracking, and social intelligence.\n  Ingests OpenClaw conversations, extracts knowledge + emotions,\n  and proactively suggests automations, fixes, and project ideas.\n  v1.4.0: Project tracking, semantic dedup, bulk feedback, archive retrieval, gentle reminders.\n  All models via OpenRouter Cloud. Cross-platform: Linux + Windows.\nmetadata:\n  openclaw:\n    requires:\n      bins: [\"node\"]\n    install:\n      - id: npm\n        kind: shell\n        command: \"cd {baseDir} && npm install --production\"\n        label: \"Install SecondMind dependencies\"\n    config:\n      stateDirs: [\"data\"]\n---\n\n# SecondMind – Autonomous AI Memory, Initiative & Social Intelligence\n\n## When To Use\nActivate this skill when the user:\n- Asks to set up, configure, or check SecondMind status\n- Wants to search their knowledge base or recall past conversations\n- Asks for proactive suggestions or project ideas\n- Mentions memory, remembering, or context from past sessions\n- Sends /new or /reset (trigger pre-reset flush!)\n- Asks about their mood/emotional patterns or upcoming events\n- Sends any SecondMind Telegram command (see below)\n\n## First-Run Setup\nIf the database does not exist at `{baseDir}/data/secondmind.db`:\n```bash\nnode {baseDir}/setup.js\n```\nThen guide the user through editing `{baseDir}/config.json`:\n1. Set `openrouter.apiKey` (required – get one at https://openrouter.ai/keys)\n2. Check `openclaw.sessionsDir` matches their agent's session path\n3. Optional: Enable Telegram notifications\n\n## CRITICAL: Pre-Reset Memory Capture\nWhen the user sends /new or /reset:\n1. BEFORE the reset takes effect, run:\n   ```bash\n   node {baseDir}/scripts/flush.js\n   ```\n2. Respond with the script's output (e.g. \"💾 Session archived.\")\n3. THEN allow the reset to proceed normally\n\n## Telegram Commands (Integrated Mode)\nWhen `telegramMode` is `\"integrated\"` in config.json, the OpenClaw agent handles\nthese commands directly. Execute the corresponding script and format the response.\n\n### /smstatus or /es\n```bash\nnode {baseDir}/scripts/status.js\n```\n\n### /proposals or /ep [filter]\n```bash\nnode {baseDir}/scripts/proposals.js [proposed|accepted|rejected|all]\n```\n\n### /accept <ID...> [comment] or /ea <ID...> [comment]\n```bash\nnode {baseDir}/scripts/feedback.js accept <ID...> [comment]\n```\nSupports multiple IDs: `/accept 1 3 5` or `/accept all`\nAfter accepting, a **project is automatically created** to track progress.\n1. Read the proposal's `follow_up` field from the database:\n   `sqlite3 {baseDir}/data/secondmind.db \"SELECT follow_up, description FROM proposals WHERE id=<ID>\"`\n2. If there's a follow_up question, ask the user that question\n3. If the user agrees, start working on the task immediately\n4. Example flow:\n   - User: `/accept 5`\n   - Agent: \"✅ #5 akzeptiert. Soll ich dir die Guide-Liste direkt zusammenstellen?\"\n   - User: \"Ja mach\"\n   - Agent: *starts working on the task*\n\n### /reject <ID...> [comment] or /er <ID...> [comment]\n```bash\nnode {baseDir}/scripts/feedback.js reject <ID...> [comment]\n```\nSupports multiple IDs: `/reject 2 4` or `/reject all`\nAcknowledge briefly. Don't make a big deal out of it.\n\n### /defer <ID...> [comment] or /ed <ID...> [comment]\n```bash\nnode {baseDir}/scripts/feedback.js defer <ID...> [comment]\n```\n\n### /drop <ID...> or /drop all older_than <duration>\n```bash\nnode {baseDir}/scripts/feedback.js drop <ID...>\nnode {baseDir}/scripts/feedback.js drop all older_than 14d\n```\nPermanently kills proposals – they will never be suggested again, not even reformulated.\nSupports: `/drop 2 4`, `/drop all`, `/drop all older_than 14d`\n\n### /projects or /pj [filter]\n```bash\nnode {baseDir}/scripts/proposals.js  # (projects are shown in status)\n```\nLists tracked projects. Filter: `active` (default), `completed`, `all`.\nProjects are auto-created when proposals are accepted.\n\n### /complete <ID...> or /done <ID...>\n```bash\nnode {baseDir}/scripts/feedback.js complete <ID...>\n```\nMarks a project as completed. Completed projects are **permanently excluded** from future suggestions.\nThe ID refers to the original proposal ID.\n\n### /mute <duration> or /unmute\n```bash\nnode {baseDir}/scripts/feedback.js mute 1d\nnode {baseDir}/scripts/feedback.js mute 1w\nnode {baseDir}/scripts/feedback.js unmute\n```\nPauses all notifications and initiative runs for the given duration.\nDurations: `1h`, `1d`, `1w`, `2w`\n\n### Natural Language Feedback\nThe bot understands natural language feedback on the most recently shown proposals:\n- \"Nimm die ersten zwei, den Rest ignorieren\"\n- \"1 und 3 sind gut, Rest weg\"\n- \"Alle droppen bis auf die Security-Sachen\"\n\n### /smsearch <query> or /smsr <query>\n```bash\nnode {baseDir}/scripts/search.js \"<query>\" --no-rerank\n```\n\n### /mood or /em\nQuery the database at `{baseDir}/data/secondmind.db`:\n```sql\nSELECT mood, COUNT(*) as count FROM social_context\nWHERE detected_at > datetime('now', '-7 days')\nGROUP BY mood ORDER BY count DESC;\n```\nFormat with emoji: 😤frustration 🎉excitement 😰worry 🥳celebration 😫stress 🤔curiosity 😴boredom 🙏gratitude\n\n### /smrun or /smrun\n```bash\ncd {baseDir} && node scripts/ingest.js && node scripts/consolidate.js && node scripts/initiative.js\n```\n\n## Standalone Telegram Bot (Alternative Mode)\nWhen `telegramMode` is `\"standalone\"`, the user runs a separate bot daemon:\n```bash\nnode {baseDir}/scripts/telegram-bot.js\n```\nThis requires a **dedicated** Telegram bot token (different from the OpenClaw agent's bot).\nThe standalone bot handles all the same commands listed above via its own polling loop.\n\n## Background Jobs (installed by setup.js)\n- **Ingest**: Every 30 min – imports JSONL session transcripts\n- **Consolidate**: Every 6h – LLM extracts knowledge + emotions + events\n- **Archive**: Daily 3:00 AM – promotes mature knowledge to long-term FTS5 index\n- **Initiative**: Every 6h – generates proposals and sends Telegram notifications\n\n## Configuration\nEdit `{baseDir}/config.json`:\n- `openrouter.apiKey`: OpenRouter API key (REQUIRED)\n- `openclaw.sessionsDir`: Path to your agent's sessions directory\n- `telegramMode`: `\"integrated\"` (via OpenClaw) or `\"standalone\"` (separate daemon)\n- `notifications.enabled`: `true` to push proposals to Telegram\n- `notifications.telegram.botToken`: Your Telegram bot token\n- `notifications.telegram.chatId`: Your Telegram chat ID\n- `models.*`: LLM model assignments (pre-optimized, change only if needed)\n- `initiative.reminderCooldownDays`: Days before reminding about deferred proposals (default: 7)\n- `initiative.maxNudgesPerProposal`: Max reminders before auto-archiving (default: 2)\n- `initiative.dedupThreshold`: Semantic similarity threshold for dedup (default: 0.85)\n\n## Troubleshooting\n- **\"Database locked\"**: Cron job running. Wait 30s.\n- **\"OpenRouter error\"**: Check API key + credit balance at openrouter.ai\n- **\"No new data\"**: Check `openclaw.sessionsDir` in config.json\n- **Telegram conflict**: Two bots polling same token → use integrated mode or create second bot\n- **Reset**: `node {baseDir}/setup.js --reset`\n\n## Cost\n~$0.60-1.65/month via OpenRouter Cloud. See https://openrouter.ai/models for current prices.\n","tags":{"latest":"1.4.0","autonomous":"1.3.0","initiative":"1.3.0","memory":"1.3.0","openrouter":"1.3.0","social-intelligence":"1.3.0","telegram":"1.3.0"},"stats":{"comments":0,"downloads":1736,"installsAllTime":1,"installsCurrent":1,"stars":0,"versions":2},"createdAt":1770829349296,"updatedAt":1779076890769},"latestVersion":{"version":"1.4.0","createdAt":1771186812709,"changelog":"## SecondMind v1.4.0 – \"Project Tracker\"\n\n### New Features\n- **Project Tracking**: `/accept` automatically creates tracked projects\n- `/projects` command to view active/completed projects\n- `/complete` marks projects as done – permanently excluded from future suggestions\n- Initiative engine checks project state before suggesting (no duplicates)\n- Project count in `/status` output\n\n### Fixes\n- **Initiative dedup overhaul**: Blacklist now covers ALL rejected/dead/completed proposals (was 7 days)\n- **Hard blacklist safety net**: Fuzzy keyword matching blocks reformulated duplicates even when LLM ignores instructions\n- **Explicit blacklist section in LLM prompt** with examples and strict rules\n- `/drop` now archives related knowledge entries to longterm (source dries up, not just the proposal)\n\n### Breaking Changes\n- None. Migration runs automatically on first start.","license":null},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"emphaiser","userId":"s171k5cvwsxs5bvp553e23k4cx884wjw","displayName":"Emphaiser","image":"https://avatars.githubusercontent.com/u/187911931?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1779971119853}}