Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["6618"],{4176(e,n,s){s.r(n),s.d(n,{metadata:()=>r,default:()=>h,frontMatter:()=>o,contentTitle:()=>d,toc:()=>c,assets:()=>a});var r=JSON.parse('{"id":"reference/second-brain","title":"Second Brain","description":"Mercury has a persistent, structured memory that grows with every conversation. When enabled, it learns what is true about you \u2014 and how you like to work \u2014 as beliefs with evidence, retrieves what is relevant to each message, and tells you when it learned something that changes how it behaves.","source":"@site/docs/reference/second-brain.mdx","sourceDirName":"reference","slug":"/reference/second-brain","permalink":"/docs/reference/second-brain","draft":false,"unlisted":false,"editUrl":"https://github.com/cosmicstack-labs/mercury-agent/tree/main/website/docs/reference/second-brain.mdx","tags":[],"version":"current","frontMatter":{"id":"second-brain","title":"Second Brain"},"sidebar":"docsSidebar","previous":{"title":"Writing plugins","permalink":"/docs/reference/plugins"},"next":{"title":"Provider Fallback","permalink":"/docs/reference/provider-fallback"}}'),i=s(74848),t=s(28453);let o={id:"second-brain",title:"Second Brain"},d,a={},c=[{value:"Reading past conversations",id:"reading-past-conversations",level:2},{value:"The Owner Model: beliefs, not just facts",id:"the-owner-model-beliefs-not-just-facts",level:2},{value:"How it works",id:"how-it-works",level:2},{value:"Memory Tiers",id:"memory-tiers",level:2},{value:"Subconscious mechanics",id:"subconscious-mechanics",level:3},{value:"Memory Types",id:"memory-types",level:2},{value:"Conflict Resolution",id:"conflict-resolution",level:2},{value:"Evidence Kinds",id:"evidence-kinds",level:2},{value:"Web Dashboard Views",id:"web-dashboard-views",level:2},{value:"Memory (<code>/second-brain/memory</code>)",id:"memory-second-brainmemory",level:3},{value:"Persons (<code>/second-brain/persons</code>, <code>/second-brain/persons/:id</code>)",id:"persons-second-brainpersons-second-brainpersonsid",level:3},{value:"Goals (<code>/second-brain/goals</code>)",id:"goals-second-braingoals",level:3},{value:"Graph (<code>/second-brain/graph</code>)",id:"graph-second-braingraph",level:3},{value:"Managing Memory from chat channels",id:"managing-memory-from-chat-channels",level:2},{value:"API Endpoints",id:"api-endpoints",level:2},{value:"Which model learns",id:"which-model-learns",level:2},{value:"Enable / Disable",id:"enable--disable",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2},{value:"Native module version mismatch",id:"native-module-version-mismatch",level:3}];function l(e){let n={code:"code",em:"em",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"Mercury has a persistent, structured memory that grows with every conversation. When enabled, it learns what is true about you \u2014 and how you like to work \u2014 as beliefs with evidence, retrieves what is relevant to each message, and tells you when it learned something that changes how it behaves."}),"\n",(0,i.jsx)(n.h2,{id:"reading-past-conversations",children:"Reading past conversations"}),"\n",(0,i.jsxs)(n.p,{children:["Saved conversations and extracted memories are different. Ask Mercury to find a previous chat or check what you said: ",(0,i.jsx)(n.code,{children:"search_sessions"})," searches saved titles and dialogue, and ",(0,i.jsx)(n.code,{children:"read_session"})," reads a matching transcript with its date and message references. This works even when Second Brain is disabled or the detail was never extracted into a memory. It reads the same canonical sessions shown in web and desktop chat history, including conversations imported by the existing legacy migration."]}),"\n",(0,i.jsx)(n.p,{children:"Recall is available in owner CLI, web, desktop and internal turns, or remote channels that supply an explicit admin role. Channel members, remote callers without a verified role, general-access chats and workers whose tool allowlist excludes recall cannot use it. Archived chats require an explicit request; deleted sessions are never returned. Reasoning, tool traces, permission prompts and internal metadata are omitted."}),"\n",(0,i.jsx)(n.p,{children:"Results are paginated and limited to 16,000 serialized characters per call. Search scans at most 100 sessions and 32 MiB per call; individual transcript files over 8 MiB are reported as unavailable. Mercury must follow the returned offset/cursor for more results and disclose skipped records. Read cursors expire if the session changes. There is no new index, background job or model call for retrieval. Clearing a Second Brain belief does not erase its original conversation; delete that conversation separately if you want its transcript removed."}),"\n",(0,i.jsx)(n.h2,{id:"the-owner-model-beliefs-not-just-facts",children:"The Owner Model: beliefs, not just facts"}),"\n",(0,i.jsxs)(n.p,{children:["Since 1.4.1 Mercury holds ",(0,i.jsx)(n.strong,{children:"beliefs"}),' about you rather than a pile of facts. A belief is a claim ("prefers one command over many manual steps") with evidence for and against it, a confidence that fades unless it is seen again, the context it applies in (everywhere, one project, one channel, one domain), and a status: ',(0,i.jsx)(n.strong,{children:"candidate"})," (seen once) \u2192 ",(0,i.jsx)(n.strong,{children:"held"})," (seen in two sessions) \u2192 ",(0,i.jsx)(n.strong,{children:"confirmed"})," (you said so). Two beliefs that cannot both be true are ",(0,i.jsx)(n.strong,{children:"contested"})," and Mercury asks you once. What you state outright never fades; what Mercury inferred does, unless it keeps being true."]}),"\n",(0,i.jsxs)(n.p,{children:["What it learns are ",(0,i.jsx)(n.em,{children:"working traits"})," that change how Mercury behaves: reply length, when to ask before acting (per project or domain), options vs a recommendation, tone, your expertise and risk appetite per domain, when you are usually around, and how you give feedback. It never infers personality types, health, religion, politics or sexuality, never stores passwords or keys, and never generalises about other people beyond what you said."]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"How it learns."})," After each turn, a small model call turns the turn into belief operations \u2014 or nothing, which is the usual outcome. Mercury's own replies are never evidence about you. Every hour of activity (and at shutdown) a reflection pass reads your messages across sessions, infers traits, merges duplicates, flags contradictions and rewrites the owner brief. The brief \u2014 ",(0,i.jsx)(n.em,{children:"About you"})," and ",(0,i.jsx)(n.em,{children:"How to work with you"})," \u2014 is in every prompt, together with the beliefs relevant to the current message."]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"What you see."})," When something behaviour-changing is learned, the reply ends with one line: ",(0,i.jsx)(n.code,{children:'\u263F Noted: you\'d rather I just run things here without asking. Say "forget that" to undo.'})," From any chat:"]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Command"}),(0,i.jsx)(n.th,{children:"What it does"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"/memory learned [days]"})}),(0,i.jsx)(n.td,{children:"What Mercury learned recently, numbered"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"/memory beliefs"})}),(0,i.jsx)(n.td,{children:"Traits by dimension, then confirmed preferences"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"/memory contested"})}),(0,i.jsxs)(n.td,{children:["Pairs Mercury can't settle; ",(0,i.jsx)(n.code,{children:"/memory settle <n> a|b"})]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.code,{children:"/memory confirm <n>"})," \xb7 ",(0,i.jsx)(n.code,{children:"/memory forget <n>"})," \xb7 ",(0,i.jsx)(n.code,{children:"/memory correct <n> <what is true>"})]}),(0,i.jsx)(n.td,{children:"Act on a numbered item"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.code,{children:"/forget <text>"}),' \xb7 "forget that"']}),(0,i.jsxs)(n.td,{children:["Forget the best match, or the last ",(0,i.jsx)(n.code,{children:"\u263F Noted"})," line"]})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"~/.mercury/soul/owner.md"})," holds the same brief in plain text; anything you write under ",(0,i.jsx)(n.strong,{children:"My notes"})," is read back as something you stated. The dashboard's Memory page shows what was learned with Confirm / Forget, and a ",(0,i.jsx)(n.strong,{children:"Quarantined"})," list: rows the old extractor saved by mistake (Mercury's own replies stored as your preferences), hidden but restorable."]}),"\n",(0,i.jsx)(n.h2,{id:"how-it-works",children:"How it works"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Extraction"})," \u2014 After each turn, a strict extractor turns what you said and did into belief operations: create, support, contradict, or nothing at all. Mercury's own replies are never evidence about you."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Retrieval"}),' \u2014 Before each message, up to 5 beliefs relevant to it (with their confidence and context) go into the prompt, and the "About you" / "How to work with you" brief sits in every prompt.']}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Reflection"})," \u2014 After every hour of activity and at shutdown, one model pass reads your messages across sessions: it infers working traits, merges duplicates, flags contradictions, rewrites the brief, and lets faded beliefs retire."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Decay"})," \u2014 Confidence fades per kind (a fact over a year, a preference over months, a trait over weeks) unless the belief is seen again; what you stated outright never fades. A belief retires only when it faded ",(0,i.jsx)(n.em,{children:"and"})," was contradicted or went stale for two half-lives."]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"One source."})," Every view of your memory \u2014 ",(0,i.jsx)(n.code,{children:"/memory"}),", the dashboard, the ",(0,i.jsx)(n.code,{children:"search_memory"})," and ",(0,i.jsx)(n.code,{children:"save_memory"})," tools, the bots, cloud sync \u2014 reads and writes the same belief store. Who you are (your name, email, handles) lives in ",(0,i.jsx)(n.code,{children:"identity.owner"})," in ",(0,i.jsx)(n.code,{children:"mercury.yaml"}),", the one place it is set; Mercury never stores it as a belief."]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Upgrading from an older Mercury."})," The first boot after the upgrade copies ",(0,i.jsx)(n.code,{children:"second-brain.db"})," to ",(0,i.jsx)(n.code,{children:"second-brain.pre-owner-model.db"})," next to it, then moves your memories into beliefs: real ones become candidates (or held, when they had been seen more than once); rows that were Mercury's own replies, credentials or templated filler are quarantined, never deleted, and wait in the dashboard under ",(0,i.jsx)(n.em,{children:"Quarantined"})," with a Restore button. Nothing you could see before disappears, ",(0,i.jsx)(n.code,{children:"/memory"})," and the dashboard keep working, and a reflection pass two minutes after that boot judges the migrated candidates against your real sessions."]}),"\n",(0,i.jsx)(n.h2,{id:"memory-tiers",children:"Memory Tiers"}),"\n",(0,i.jsx)(n.p,{children:"Mercury models memory in two tiers, mirroring how human memory works:"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Tier"}),(0,i.jsx)(n.th,{children:"Scope values"}),(0,i.jsx)(n.th,{children:"Behavior"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"Conscious"})}),(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.code,{children:"durable"}),", ",(0,i.jsx)(n.code,{children:"active"})]}),(0,i.jsx)(n.td,{children:"Always available for retrieval. Top-of-mind."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.strong,{children:"Subconscious"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"subconscious"})}),(0,i.jsxs)(n.td,{children:["Out of active recall. Confidence does ",(0,i.jsx)(n.strong,{children:"not"})," decay here. Recalled automatically when relevant to the current conversation."]})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"subconscious-mechanics",children:"Subconscious mechanics"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["After ",(0,i.jsx)(n.strong,{children:"30 days"})," without being referenced, an active memory is moved to the subconscious instead of being deleted."]}),"\n",(0,i.jsx)(n.li,{children:"Subconscious memories are preserved with their original confidence \u2014 no further decay applies while they sit there."}),"\n",(0,i.jsxs)(n.li,{children:["During retrieval, if conscious results are weak, Mercury also searches the subconscious and surfaces the strongest matches. When a subconscious memory is recalled into a relevant conversation, it is ",(0,i.jsx)(n.strong,{children:"promoted back to the conscious tier"}),"."]}),"\n",(0,i.jsx)(n.li,{children:"Subconscious memories are only hard-deleted if explicitly dismissed. Otherwise they remain available forever."}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:'This is why Mercury can resurface "I told you that two years ago" facts without polluting day-to-day reasoning.'}),"\n",(0,i.jsx)(n.h2,{id:"memory-types",children:"Memory Types"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Default scope"}),(0,i.jsx)(n.th,{children:"What it stores"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"identity"})}),(0,i.jsx)(n.td,{children:"durable"}),(0,i.jsx)(n.td,{children:"Who you are \u2014 name, role, background"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"preference"})}),(0,i.jsx)(n.td,{children:"durable"}),(0,i.jsx)(n.td,{children:"What you like and dislike"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"goal"})}),(0,i.jsx)(n.td,{children:"active"}),(0,i.jsx)(n.td,{children:"What you're working toward"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"project"})}),(0,i.jsx)(n.td,{children:"active"}),(0,i.jsx)(n.td,{children:"What you're building"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"habit"})}),(0,i.jsx)(n.td,{children:"durable"}),(0,i.jsx)(n.td,{children:"Behavioral patterns and routines"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"decision"})}),(0,i.jsx)(n.td,{children:"active"}),(0,i.jsx)(n.td,{children:"Decisions and choices you've made"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"constraint"})}),(0,i.jsx)(n.td,{children:"durable"}),(0,i.jsx)(n.td,{children:"Rules and constraints you follow"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"relationship"})}),(0,i.jsx)(n.td,{children:"durable"}),(0,i.jsx)(n.td,{children:"People and connections"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"episode"})}),(0,i.jsx)(n.td,{children:"active"}),(0,i.jsx)(n.td,{children:"Specific events and experiences"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"reflection"})}),(0,i.jsx)(n.td,{children:"durable"}),(0,i.jsx)(n.td,{children:"System-generated insights from patterns"})]})]})]}),"\n",(0,i.jsx)(n.h2,{id:"conflict-resolution",children:"Conflict Resolution"}),"\n",(0,i.jsx)(n.p,{children:'When Mercury detects opposing memories (e.g. "prefers TypeScript" vs "prefers Python"), the higher-confidence one wins. If equal, the newer one wins. Negation mismatches ("likes X" vs "does not like X") are detected and resolved automatically.'}),"\n",(0,i.jsx)(n.h2,{id:"evidence-kinds",children:"Evidence Kinds"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"direct"})," \u2014 Explicitly stated by you (highest confidence)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"inferred"})," \u2014 Pattern Mercury detected (decays over time)"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"manual"})," \u2014 Added via ",(0,i.jsx)(n.code,{children:"/memory"})," command or the web UI"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"system"})," \u2014 Auto-generated reflections from consolidation"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"web-dashboard-views",children:"Web Dashboard Views"}),"\n",(0,i.jsx)(n.p,{children:"The Second Brain is exposed through four interconnected pages in the web dashboard."}),"\n",(0,i.jsxs)(n.h3,{id:"memory-second-brainmemory",children:["Memory (",(0,i.jsx)(n.code,{children:"/second-brain/memory"}),")"]}),"\n",(0,i.jsx)(n.p,{children:"A full browser for every memory item."}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Scope filter"})," \u2014 toggle between ",(0,i.jsx)(n.code,{children:"conscious"})," and ",(0,i.jsx)(n.code,{children:"subconscious"})," views. A \u{1F4A4} badge marks subconscious entries."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Search"})," \u2014 full-text search across memory summaries; results merge conscious and subconscious matches."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Inline edit"})," \u2014 change summary, type, importance, confidence, or scope."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Add memory"})," \u2014 manually create a memory with type, summary, and evidence."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Delete"})," \u2014 soft-dismiss a memory (only explicit dismissal hard-deletes; otherwise items just move to subconscious)."]}),"\n"]}),"\n",(0,i.jsxs)(n.h3,{id:"persons-second-brainpersons-second-brainpersonsid",children:["Persons (",(0,i.jsx)(n.code,{children:"/second-brain/persons"}),", ",(0,i.jsx)(n.code,{children:"/second-brain/persons/:id"}),")"]}),"\n",(0,i.jsx)(n.p,{children:"People Mercury has encountered are extracted into a structured table."}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"The listing shows each person's name, last-seen timestamp, and the number of memories associated with them."}),"\n",(0,i.jsxs)(n.li,{children:["Click a person to open their detail page with their facts, related memories, and links to other persons (via ",(0,i.jsx)(n.code,{children:"relationship"})," memories)."]}),"\n"]}),"\n",(0,i.jsxs)(n.h3,{id:"goals-second-braingoals",children:["Goals (",(0,i.jsx)(n.code,{children:"/second-brain/goals"}),")"]}),"\n",(0,i.jsx)(n.p,{children:"A tabbed view that filters memories by type:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Goals tab"})," \u2014 every memory with ",(0,i.jsx)(n.code,{children:"type: goal"})]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Projects tab"})," \u2014 every memory with ",(0,i.jsx)(n.code,{children:"type: project"})]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"You can add new goals/projects directly from this page \u2014 they are stored as standard memories so the agent can reason over them."}),"\n",(0,i.jsxs)(n.h3,{id:"graph-second-braingraph",children:["Graph (",(0,i.jsx)(n.code,{children:"/second-brain/graph"}),")"]}),"\n",(0,i.jsx)(n.p,{children:"A force-directed graph visualization that draws nodes for memories, persons, and goals, and edges for their relationships. Useful for spotting clusters (e.g. all goals connected to a particular project, or all persons connected to a company)."}),"\n",(0,i.jsx)(n.h2,{id:"managing-memory-from-chat-channels",children:"Managing Memory from chat channels"}),"\n",(0,i.jsxs)(n.p,{children:["Use ",(0,i.jsx)(n.code,{children:"/memory"})," in any channel:"]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Action"}),(0,i.jsx)(n.th,{children:"CLI"}),(0,i.jsx)(n.th,{children:"Telegram"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Overview"}),(0,i.jsx)(n.td,{children:"Arrow-key menu \u2192 Overview"}),(0,i.jsx)(n.td,{children:"Inline button: \u{1F4CB} Overview"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Recent memories"}),(0,i.jsx)(n.td,{children:"Arrow-key menu \u2192 Recent"}),(0,i.jsx)(n.td,{children:"Inline button: \u{1F50D} Recent"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Subconscious"}),(0,i.jsx)(n.td,{children:"Arrow-key menu \u2192 Subconscious"}),(0,i.jsx)(n.td,{children:"Inline button: \u{1F4A4} Subconscious"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Search"}),(0,i.jsx)(n.td,{children:"Arrow-key menu \u2192 Search"}),(0,i.jsx)(n.td,{children:"Not available (ask Mercury to search)"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Pause learning"}),(0,i.jsx)(n.td,{children:"Arrow-key menu \u2192 Pause"}),(0,i.jsx)(n.td,{children:"Inline button: \u23F8 Pause"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Resume learning"}),(0,i.jsx)(n.td,{children:"Arrow-key menu \u2192 Resume"}),(0,i.jsx)(n.td,{children:"Inline button: \u25B6 Resume"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Clear all"}),(0,i.jsx)(n.td,{children:"Arrow-key menu \u2192 Clear (with confirmation)"}),(0,i.jsx)(n.td,{children:"Inline button: \u{1F5D1} Clear \u2192 Yes"})]})]})]}),"\n",(0,i.jsx)(n.h2,{id:"api-endpoints",children:"API Endpoints"}),"\n",(0,i.jsx)(n.p,{children:"The web dashboard talks to the brain through a small REST surface:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"GET /api/brain/status\nGET /api/brain/memory # ?scope=conscious|subconscious\nGET /api/brain/memory/search?q=...\nGET /api/brain/memory/:id\nPUT /api/brain/memory/:id\nDELETE /api/brain/memory/:id\nPOST /api/brain/memory # manual add\nGET /api/brain/persons\nGET /api/brain/persons/:id\nGET /api/brain/persons/:id/memories\nGET /api/brain/graph\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Goals and projects are not a separate resource \u2014 they are memories filtered by ",(0,i.jsx)(n.code,{children:"type=goal"})," or ",(0,i.jsx)(n.code,{children:"type=project"})," against ",(0,i.jsx)(n.code,{children:"/api/brain/memory"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"which-model-learns",children:"Which model learns"}),"\n",(0,i.jsx)(n.p,{children:"Extraction and reflection are strict-JSON jobs; a weak free-tier model misses most of what you say or returns nothing. Point them at a capable provider without changing your chat model:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"memory:\n learning:\n provider: anthropic # any name from `providers`; falls back to the default when unusable\n"})}),"\n",(0,i.jsxs)(n.p,{children:["(",(0,i.jsx)(n.code,{children:"LEARNING_PROVIDER=anthropic"})," does the same.) A Haiku-class model is plenty; each turn costs one small call and each hour of activity one reflection."]}),"\n",(0,i.jsx)(n.h2,{id:"enable--disable",children:"Enable / Disable"}),"\n",(0,i.jsxs)(n.p,{children:["Second Brain is ",(0,i.jsx)(n.strong,{children:"enabled by default"}),". To disable it:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Environment variable: ",(0,i.jsx)(n.code,{children:"SECOND_BRAIN_ENABLED=false"})]}),"\n",(0,i.jsxs)(n.li,{children:["Config file: set ",(0,i.jsx)(n.code,{children:"memory.secondBrain.enabled: false"})," in ",(0,i.jsx)(n.code,{children:"~/.mercury/mercury.yaml"})]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"When disabled, Mercury falls back to basic long-term fact search (JSONL, text-match only). No extraction, no consolidation, no SQLite."}),"\n",(0,i.jsxs)(n.p,{children:["All data is stored locally in ",(0,i.jsx)(n.code,{children:"~/.mercury/memory/second-brain/second-brain.db"})," (SQLite). Nothing leaves your machine."]}),"\n",(0,i.jsx)(n.h2,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,i.jsx)(n.h3,{id:"native-module-version-mismatch",children:"Native module version mismatch"}),"\n",(0,i.jsxs)(n.p,{children:["If you see ",(0,i.jsx)(n.code,{children:"NODE_MODULE_VERSION"})," mismatch errors in logs, the ",(0,i.jsx)(n.code,{children:"better-sqlite3"})," native addon was compiled against a different Node.js version than your runtime. Fix with:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"npm rebuild better-sqlite3\n"})}),"\n",(0,i.jsxs)(n.p,{children:["When ",(0,i.jsx)(n.code,{children:"better-sqlite3"})," fails to load, Second Brain silently falls back to disabled \u2014 memory extraction and consolidation will not run. Check daemon logs (",(0,i.jsx)(n.code,{children:"mercury logs"}),") for SQLite-related errors if memories aren't being stored."]})]})}function h(e={}){let{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},28453(e,n,s){s.d(n,{R:()=>o,x:()=>d});var r=s(96540);let i={},t=r.createContext(i);function o(e){let n=r.useContext(t);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),r.createElement(t.Provider,{value:n},e.children)}}}]);