CowAgent’s long-term memory: core memory in MEMORY.md, daily memories and dream diaries stored as workspace files, written automatically when context is trimmed and recalled with hybrid search.
Long-term memory is stored in workspace files, persisting across sessions. The Agent loads historical memory on demand via retrieval tools during conversation, and automatically writes conversation summaries to long-term memory when context is trimmed.
Stored in ~/cow/MEMORY.md, containing long-term user preferences, important decisions, key facts, and other information that doesn’t fade over time. The Agent reads and writes this file via tools to maintain long-term knowledge.
Stored in ~/cow/memory/ directory, named by date (e.g., 2026-03-08.md), recording daily conversation summaries and key events. Files are only created on first write to avoid generating empty files.
A byproduct of the Deep Dream (memory distillation) process, recording discoveries, deduplication operations, and new insights from each consolidation. Stored in ~/cow/memory/dreams/ directory, named by date.
The Agent automatically persists conversation content to long-term memory through the following mechanisms:
On context trimming — When conversation turns or tokens exceed the configured limit, the oldest half of the context is trimmed, and the discarded content is summarized by LLM into key information and written to the daily memory file. The summary is also asynchronously injected into the retained context for conversational continuity
Daily scheduled summary — A full summary is automatically triggered at 23:55 every day, ensuring memory is preserved even on low-activity days (skipped if content hasn’t changed)
Deep Dream (memory distillation) — Runs automatically after the daily summary, distilling daily memories into MEMORY.md and generating a dream diary
On API context overflow — When the model API returns a context overflow error, the current conversation summary is saved as an emergency measure
All memory writes run asynchronously in a background thread (LLM summarization + file writing), never blocking normal conversation replies.
The memory system supports hybrid retrieval modes:
Keyword retrieval — FTS5 full-text index matching with BM25 ranking
Vector retrieval — Embedding-based semantic similarity search, finds relevant memory even with different wording
The Agent automatically triggers memory retrieval during conversation as needed, incorporating relevant historical information into context. Results are ranked by rank-normalizing the vector and keyword scores onto a common scale and taking a weighted average (default: 0.7 vector weight + 0.3 keyword weight). Because the top hit is always normalized to 1.0, min_score acts as a rank-position cutoff rather than an absolute relevance floor. Daily memory scores decay over time (30-day half-life), while core memory does not decay.
For more precise ranking, rerank can optionally be enabled: run pip install sentence-transformers, then set "rerank_provider": "local" in the config, and results are reordered by a local rerank model (default BAAI/bge-reranker-base). It is off by default and has no effect unless configured.
Workspace path, memory files stored under this directory
~/cow
agent_max_context_tokens
Max context tokens; when exceeded, content is trimmed and summarized into memory
200000
agent_max_context_turns
Max context turns; when exceeded, content is trimmed and summarized into memory
30
rerank_provider
Rerank service for memory retrieval; empty disables it, local uses a local cross-encoder
""
rerank_model
Rerank model; empty uses the provider’s default
BAAI/bge-reranker-base
memory.hit_boost
Nudge frequently retrieved memories up the ranking (fading after about a week idle); off keeps ranking unchanged and searches write nothing
false
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"CowAgent","description":"CowAgent - AI Super Assistant powered by LLMs, with autonomous task planning, long-term memory, skills system, and multi-channel deployment.","colors":{"primary":"#35A85B","light":"#4ABE6E","dark":"#228547"},"logo":{"light":"https://mintcdn.com/minimalfuture/kFr6XLKqkl319blp/images/logo.jpg?fit=max\u0026auto=format\u0026n=kFr6XLKqkl319blp\u0026q=85\u0026s=71578eed432dfbc8615e84af3b5f2eab","dark":"https://mintcdn.com/minimalfuture/kFr6XLKqkl319blp/images/logo.jpg?fit=max\u0026auto=format\u0026n=kFr6XLKqkl319blp\u0026q=85\u0026s=71578eed432dfbc8615e84af3b5f2eab"},"favicon":"https://mintcdn.com/minimalfuture/kFr6XLKqkl319blp/images/favicon.ico?fit=max\u0026auto=format\u0026n=kFr6XLKqkl319blp\u0026q=85\u0026s=38cedc5ca4e6be81dc0609fe0e9c11ba","appearance":{"default":"light"},"navbar":{"links":[{"href":"https://cowagent.ai/","label":"官网"},{"href":"https://cowagent.ai/download/","label":"下载"},{"href":"https://cowagent.ai/zh/blog/","label":"博客"},{"href":"https://github.com/zhayujie/CowAgent","label":"GitHub"}]},"footer":{"socials":{"github":"https://github.com/zhayujie/CowAgent"}},"styling":{"latex":false},"navigation":{"languages":[{"language":"en","default":true,"navbar":{"links":[{"href":"https://cowagent.ai/","label":"Website"},{"href":"https://cowagent.ai/download/","label":"Download"},{"href":"https://cowagent.ai/blog/","label":"Blog"},{"href":"https://github.com/zhayujie/CowAgent","label":"GitHub"}]},"href":"intro"},{"language":"zh","navbar":{"links":[{"href":"https://cowagent.ai/?lang=zh","label":"官网"},{"href":"https://cowagent.ai/zh/download/","label":"下载"},{"href":"https://cowagent.ai/zh/blog/","label":"博客"},{"href":"https://github.com/zhayujie/CowAgent","label":"GitHub"}]},"href":"zh/intro"},{"language":"ja","navbar":{"links":[{"href":"https://cowagent.ai/","label":"ウェブサイト"},{"href":"https://cowagent.ai/download/","label":"ダウンロード"},{"href":"https://cowagent.ai/blog/","label":"ブログ"},{"href":"https://github.com/zhayujie/CowAgent","label":"GitHub"}]},"href":"ja/intro"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"minimalfuture","hasAudioNarration":false,"actualSubdomain":"minimalfuture","customDomains":["docs.cowagent.ai"],"gitSource":{"type":"github","owner":"zhayujie","repo":"cowagent","deployBranch":"master","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ad9f9c38f11a1d91225c439","collectionId":"b7ab12e7-5b88-43eb-baec-908626d5769e","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ad9f9c38f11a1d91225c439"},"entitlements":{},"buildId":"6ad9f9c38f11a1d91225c439","clientVersion":"0.0.3952","searchFilterCounts":[{"language":"en","tag":"Releases","count":23},{"language":"en","tag":"Release Notes","count":23},{"language":"ja","tag":"リリース","count":23},{"language":"ja","tag":"リリースノート","count":23},{"language":"zh","tag":"版本","count":23},{"language":"zh","tag":"发布记录","count":23},{"language":"en","tag":"Tools","count":18},{"language":"ja","tag":"ツール","count":18},{"language":"zh","tag":"工具","count":18},{"language":"en","tag":"Models","count":15},{"language":"en","tag":"Model Configuration","count":15},{"language":"ja","tag":"モデル","count":15},{"language":"ja","tag":"モデル設定","count":15},{"language":"zh","tag":"模型","count":15},{"language":"zh","tag":"模型配置","count":15},{"language":"en","tag":"Channels","count":13},{"language":"en","tag":"Platforms","count":13},{"language":"en","tag":"Built-in Tools","count":13},{"language":"ja","tag":"チャネル","count":13},{"language":"ja","tag":"プラットフォーム","count":13},{"language":"ja","tag":"内蔵ツール","count":13},{"language":"zh","tag":"通道","count":13},{"language":"zh","tag":"接入渠道","count":13},{"language":"zh","tag":"内置工具","count":13},{"language":"en","tag":"Skills","count":7},{"language":"ja","tag":"スキル","count":7},{"language":"zh","tag":"技能","count":7},{"language":"en","tag":"CLI","count":6},{"language":"zh","tag":"命令","count":6},{"language":"ja","tag":"CLI","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"memory/index","slug":"/memory/index","pageMetadata":{"title":"Long-term Memory","description":"CowAgent's long-term memory: core memory in MEMORY.md, daily memories and dream diaries stored as workspace files, written automatically when context is trimmed and recalled with hybrid search.","href":"/memory/index"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"CowAgent’s long-term memory: core memory in MEMORY.md, daily memories and dream diaries stored as workspace files, written automatically when context is trimmed and recalled with hybrid search.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Frame,Heading,OptimizedImage,Table,Tip}=_components;if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Long-term memory is stored in workspace files, persisting across sessions. The Agent loads historical memory on demand via retrieval tools during conversation, and automatically writes conversation summaries to long-term memory when context is trimmed.`}),`\n`,_jsx(OptimizedImage,{src:`https://cdn.link-ai.tech/doc/memory-architecture-en.jpg`,alt:`Memory Architecture`}),`\n`,_jsx(Heading,{level:`2`,id:`memory-types`,children:`Memory Types`}),`\n`,_jsx(Heading,{level:`3`,id:`core-memory-memory-md`,children:`Core Memory (MEMORY.md)`}),`\n`,_jsxs(_components.p,{children:[`Stored in `,_jsx(_components.code,{children:`~/cow/MEMORY.md`}),`, containing long-term user preferences, important decisions, key facts, and other information that doesn’t fade over time. The Agent reads and writes this file via tools to maintain long-term knowledge.`]}),`\n`,_jsx(Heading,{level:`3`,id:`daily-memory-memory/yyyy-mm-dd-md`,children:`Daily Memory (memory/YYYY-MM-DD.md)`}),`\n`,_jsxs(_components.p,{children:[`Stored in `,_jsx(_components.code,{children:`~/cow/memory/`}),` directory, named by date (e.g., `,_jsx(_components.code,{children:`2026-03-08.md`}),`), recording daily conversation summaries and key events. Files are only created on first write to avoid generating empty files.`]}),`\n`,_jsx(Heading,{level:`3`,id:`dream-diary-memory/dreams/yyyy-mm-dd-md`,children:`Dream Diary (memory/dreams/YYYY-MM-DD.md)`}),`\n`,_jsxs(_components.p,{children:[`A byproduct of the Deep Dream (memory distillation) process, recording discoveries, deduplication operations, and new insights from each consolidation. Stored in `,_jsx(_components.code,{children:`~/cow/memory/dreams/`}),` directory, named by date.`]}),`\n`,_jsx(Heading,{level:`2`,id:`automatic-writing`,children:`Automatic Writing`}),`\n`,_jsx(_components.p,{children:`The Agent automatically persists conversation content to long-term memory through the following mechanisms:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`On context trimming`}),` — When conversation turns or tokens exceed the configured limit, the oldest half of the context is trimmed, and the discarded content is summarized by LLM into key information and written to the daily memory file. The summary is also asynchronously injected into the retained context for conversational continuity`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Daily scheduled summary`}),` — A full summary is automatically triggered at 23:55 every day, ensuring memory is preserved even on low-activity days (skipped if content hasn’t changed)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/memory/deep-dream`,children:`Deep Dream (memory distillation)`}),` — Runs automatically after the daily summary, distilling daily memories into MEMORY.md and generating a dream diary`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`On API context overflow`}),` — When the model API returns a context overflow error, the current conversation summary is saved as an emergency measure`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`All memory writes run asynchronously in a background thread (LLM summarization + file writing), never blocking normal conversation replies.`}),`\n`,_jsx(Heading,{level:`2`,id:`memory-retrieval`,children:`Memory Retrieval`}),`\n`,_jsx(_components.p,{children:`The memory system supports hybrid retrieval modes:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Keyword retrieval`}),` — FTS5 full-text index matching with BM25 ranking`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Vector retrieval`}),` — Embedding-based semantic similarity search, finds relevant memory even with different wording`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The Agent automatically triggers memory retrieval during conversation as needed, incorporating relevant historical information into context. Results are ranked by rank-normalizing the vector and keyword scores onto a common scale and taking a weighted average (default: 0.7 vector weight + 0.3 keyword weight). Because the top hit is always normalized to 1.0, `,_jsx(_components.code,{children:`min_score`}),` acts as a rank-position cutoff rather than an absolute relevance floor. Daily memory scores decay over time (30-day half-life), while core memory does not decay.`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`For more precise ranking, rerank can optionally be enabled: run `,_jsx(_components.code,{children:`pip install sentence-transformers`}),`, then set `,_jsx(_components.code,{children:`\"rerank_provider\": \"local\"`}),` in the config, and results are reordered by a local rerank model (default `,_jsx(_components.code,{children:`BAAI/bge-reranker-base`}),`). It is off by default and has no effect unless configured.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`related-files`,children:`Related Files`}),`\n`,_jsxs(_components.p,{children:[`Files related to memory in the workspace (default `,_jsx(_components.code,{children:`~/cow`}),`):`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`File`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`AGENT.md`})}),_jsx(_components.td,{children:`Agent personality and behavior settings`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`USER.md`})}),_jsx(_components.td,{children:`User identity information and preferences`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`RULE.md`})}),_jsx(_components.td,{children:`Custom rules and constraints`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`MEMORY.md`})}),_jsx(_components.td,{children:`Core memory (long-term)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`memory/YYYY-MM-DD.md`})}),_jsx(_components.td,{children:`Daily memory (created on demand)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`memory/dreams/YYYY-MM-DD.md`})}),_jsx(_components.td,{children:`Dream diary (auto-generated by Deep Dream)`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`web-console`,children:`Web Console`}),`\n`,_jsx(_components.p,{children:`The memory management page in the Web console allows browsing memory files and dream diaries, with tab switching support:`}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://cdn.link-ai.tech/doc/20260414171014.png`,width:`800`})}),`\n`,_jsx(Heading,{level:`2`,id:`configuration`,children:`Configuration`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Description`}),_jsx(_components.th,{children:`Default`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`agent_workspace`})}),_jsx(_components.td,{children:`Workspace path, memory files stored under this directory`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`~/cow`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`agent_max_context_tokens`})}),_jsx(_components.td,{children:`Max context tokens; when exceeded, content is trimmed and summarized into memory`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`200000`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`agent_max_context_turns`})}),_jsx(_components.td,{children:`Max context turns; when exceeded, content is trimmed and summarized into memory`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`30`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`rerank_provider`})}),_jsxs(_components.td,{children:[`Rerank service for memory retrieval; empty disables it, `,_jsx(_components.code,{children:`local`}),` uses a local cross-encoder`]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`\"\"`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`rerank_model`})}),_jsx(_components.td,{children:`Rerank model; empty uses the provider’s default`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`BAAI/bge-reranker-base`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`memory.hit_boost`})}),_jsx(_components.td,{children:`Nudge frequently retrieved memories up the ranking (fading after about a week idle); off keeps ranking unchanged and searches write nothing`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`false`})})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Long-term Memory","description":"CowAgent's long-term memory: core memory in MEMORY.md, daily memories and dream diaries stored as workspace files, written automatically when context is trimmed and recalled with hybrid search.","href":"/memory/index"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Memory Types","slug":"memory-types","depth":2,"children":[{"title":"Core Memory (MEMORY.md)","slug":"core-memory-memory-md","depth":3,"children":[]},{"title":"Daily Memory (memory/YYYY-MM-DD.md)","slug":"daily-memory-memory/yyyy-mm-dd-md","depth":3,"children":[]},{"title":"Dream Diary (memory/dreams/YYYY-MM-DD.md)","slug":"dream-diary-memory/dreams/yyyy-mm-dd-md","depth":3,"children":[]}]},{"title":"Automatic Writing","slug":"automatic-writing","depth":2,"children":[]},{"title":"Memory Retrieval","slug":"memory-retrieval","depth":2,"children":[]},{"title":"Related Files","slug":"related-files","depth":2,"children":[]},{"title":"Web Console","slug":"web-console","depth":2,"children":[]},{"title":"Configuration","slug":"configuration","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"minimalfuture","siteName":"CowAgent","title":"Long-term Memory - CowAgent","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/memory","matchLevel":2},"zh":{"href":"/zh/memory/index","matchLevel":1},"ja":{"href":"/ja/memory/index","matchLevel":1}}},"lastModified":"2026-10-16T09:14:52.684Z","originalFileLocation":"memory/index.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"CowAgent\u0026#x27;s long-term memory: core memory in MEMORY.md, daily memories and dream diaries stored as workspace files, written automatically when context is trimmed and recalled with hybrid search.\">\u003cmeta data-mint-head name=\"application-name\" content=\"CowAgent\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/minimalfuture/gk-TAsZO3835JLt2/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/minimalfuture/gk-TAsZO3835JLt2/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/minimalfuture/gk-TAsZO3835JLt2/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/minimalfuture/gk-TAsZO3835JLt2/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/minimalfuture/gk-TAsZO3835JLt2/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/minimalfuture/gk-TAsZO3835JLt2/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/minimalfuture/gk-TAsZO3835JLt2/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/minimalfuture/gk-TAsZO3835JLt2/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/minimalfuture/gk-TAsZO3835JLt2/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Long-term Memory - CowAgent\">\u003cmeta data-mint-head property=\"og:description\" content=\"CowAgent\u0026#x27;s long-term memory: core memory in MEMORY.md, daily memories and dream diaries stored as workspace files, written automatically when context is trimmed and recalled with hybrid search.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"CowAgent\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.cowagent.ai/memory\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://minimalfuture.mintlify.app/_mintlify/api/og/v2?division=Memory+System\u0026amp;title=Long-term+Memory\u0026amp;description=CowAgent%27s+long-term+memory%3A+core+memory+in+MEMORY.md%2C+daily+memories+and+dream+diaries+stored+as+workspace+files%2C+written+automatically+when+context+is+trimmed\u0026amp;theme=0a7de74e5357106a73c9a24a\u0026amp;signature=b9f3c66f82e11eca10345c84092d8c16bb5e5265d6ac3cf9eabcf2746ba5bb0e\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Long-term Memory - CowAgent\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"CowAgent\u0026#x27;s long-term memory: core memory in MEMORY.md, daily memories and dream diaries stored as workspace files, written automatically when context is trimmed and recalled with hybrid search.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://minimalfuture.mintlify.app/_mintlify/api/og/v2?division=Memory+System\u0026amp;title=Long-term+Memory\u0026amp;description=CowAgent%27s+long-term+memory%3A+core+memory+in+MEMORY.md%2C+daily+memories+and+dream+diaries+stored+as+workspace+files%2C+written+automatically+when+context+is+trimmed\u0026amp;theme=0a7de74e5357106a73c9a24a\u0026amp;signature=b9f3c66f82e11eca10345c84092d8c16bb5e5265d6ac3cf9eabcf2746ba5bb0e\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/minimalfuture/gk-TAsZO3835JLt2/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"CowAgent\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#35A85B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.cowagent.ai/memory\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/memory/index.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.cowagent.ai/memory\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://docs.cowagent.ai/zh/memory\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://docs.cowagent.ai/ja/memory\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.cowagent.ai/memory\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.cowagent.ai/#organization\",\"name\":\"CowAgent\",\"url\":\"https://docs.cowagent.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/minimalfuture/kFr6XLKqkl319blp/images/logo.jpg?fit=max\u0026auto=format\u0026n=kFr6XLKqkl319blp\u0026q=85\u0026s=71578eed432dfbc8615e84af3b5f2eab\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.cowagent.ai#website\",\"name\":\"CowAgent\",\"url\":\"https://docs.cowagent.ai\",\"publisher\":{\"@id\":\"https://docs.cowagent.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.cowagent.ai/memory#webpage\",\"url\":\"https://docs.cowagent.ai/memory\",\"name\":\"Long-term Memory\",\"description\":\"CowAgent's long-term memory: core memory in MEMORY.md, daily memories and dream diaries stored as workspace files, written automatically when context is trimmed and recalled with hybrid search.\",\"dateModified\":\"2026-10-16T09:14:52.684Z\",\"isPartOf\":{\"@id\":\"https://docs.cowagent.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.cowagent.ai/memory#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.cowagent.ai/memory#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Memory System\",\"item\":\"https://docs.cowagent.ai/memory/index\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Long-term Memory\",\"item\":\"https://docs.cowagent.ai/memory\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.cowagent.ai/memory#article\",\"headline\":\"Long-term Memory\",\"name\":\"Long-term Memory\",\"description\":\"CowAgent's long-term memory: core memory in MEMORY.md, daily memories and dream diaries stored as workspace files, written automatically when context is trimmed and recalled with hybrid search.\",\"url\":\"https://docs.cowagent.ai/memory\",\"mainEntityOfPage\":{\"@id\":\"https://docs.cowagent.ai/memory#webpage\"},\"dateModified\":\"2026-10-16T09:14:52.684Z\",\"publisher\":{\"@id\":\"https://docs.cowagent.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.cowagent.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"CowAgent\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"CowAgent","nav":{"global":null,"languages":[{"language":"en","default":true,"navbar":{"links":[{"href":"https://cowagent.ai/","label":"Website"},{"href":"https://cowagent.ai/download/","label":"Download"},{"href":"https://cowagent.ai/blog/","label":"Blog"},{"href":"https://github.com/zhayujie/CowAgent","label":"GitHub"}]},"tabs":[{"tab":"Introduction","pages":[{"title":"Introduction","href":"/intro"}]},{"tab":"Get Started","pages":[{"title":"Get Started","href":"/guide/quick-start"}]},{"tab":"Models","pages":[{"title":"Models","href":"/models"}]},{"tab":"Tools","pages":[{"title":"Tools","href":"/tools"}]},{"tab":"Skills","pages":[{"title":"Skills","href":"/skills"}]},{"tab":"Memory","groups":[{"group":"Memory System","pages":[{"title":"Long-term Memory","href":"/memory"},{"title":"Short-term Memory","description":"Short-term memory is the conversation context of messages, replies and tool results. Learn its structure, key settings, multi-stage compression on overflow, and commands to inspect or clear it.","href":"/memory/context"},{"title":"Deep Dream","href":"/memory/deep-dream"},{"title":"Self-Evolution","href":"/memory/self-evolution"}]}]},{"tab":"Knowledge","pages":[{"title":"Knowledge","href":"/knowledge"}]},{"tab":"Channels","pages":[{"title":"Channels","href":"/channels"}]},{"tab":"CLI","pages":[{"title":"CLI","href":"/cli"}]},{"tab":"Multi-Agent","pages":[{"title":"Multi-Agent","href":"/multi-agent/team"}]},{"tab":"Extensions","pages":[{"title":"Extensions","href":"/extensions/chat-api"}]},{"tab":"Releases","pages":[{"title":"Releases","href":"/releases/overview"}]}]},{"language":"zh","navbar":{"links":[{"href":"https://cowagent.ai/?lang=zh","label":"官网"},{"href":"https://cowagent.ai/zh/download/","label":"下载"},{"href":"https://cowagent.ai/zh/blog/","label":"博客"},{"href":"https://github.com/zhayujie/CowAgent","label":"GitHub"}]},"pages":[{"title":"zh","href":"/zh/memory"}]},{"language":"ja","navbar":{"links":[{"href":"https://cowagent.ai/","label":"ウェブサイト"},{"href":"https://cowagent.ai/download/","label":"ダウンロード"},{"href":"https://cowagent.ai/blog/","label":"ブログ"},{"href":"https://github.com/zhayujie/CowAgent","label":"GitHub"}]},"pages":[{"title":"ja","href":"/ja/memory"}]}]},"title":"Long-term Memory - CowAgent","buildId":"dpl_7GUK3ixdQTF3BSNUQYJm8ibGxQWw","deploymentId":"dpl_7GUK3ixdQTF3BSNUQYJm8ibGxQWw","dynamics":["a74be98ba7","07c022d89b"],"chunks":["zoom-image-lightbox-BVI9Chd9.js","PlusIcon-dPxQtROk.js","lightbox-handle-r17bVUz3.js","Frame-BUwlkhKf.js","DynamicMarkdown-CCag2O17.js"]}