Persist agent interaction history to disk via MEMORY.md and resume across process restarts.
Swarms agents can persist their interaction history to disk through a per-agent MEMORY.md file. The flag is False by default: set persistent_memory=True and reuse the same agent_name across process starts to resume the same memory.
The agent runs in separate processes (CLI, cron, restarts) and needs to resume prior context.
You want a human-readable transcript of what the agent has seen and produced.
You need to inspect, search, or export the agent’s interaction log.
For external knowledge (PDFs, databases, doc stores), give the agent a retrieval tool instead — MEMORY.md is for the agent’s own history, not a document index. See External knowledge.
On construction, Swarms reads MEMORY.md and adds it to agent.short_memory as a single System message. Every conversation.add(...) then writes through to disk so nothing is lost on exit.
Set agent_name and persistent_memory=True. The first construction creates MEMORY.md, and every turn after that is appended to it:
from swarms import Agent# Off by default; opt in to keep a log that survives restarts.persistent_agent = Agent( agent_name="ResearchAssistant", agent_description="Remembers context across sessions", model_name="gpt-5.4", max_loops=1, persistent_memory=True,)persistent_agent.run("Research low-latency cloud data warehouses for analytics.")persistent_agent.run("Narrow the recommendation to GCP.")# Active on-disk memoryprint(persistent_agent.short_memory.memory_md_path)# -> $WORKSPACE_DIR/agents/ResearchAssistant/MEMORY.md
Re-instantiate an agent with the sameagent_name and persistent_memory=True. The prior log is loaded into agent.short_memory as one System message, and new turns keep appending to the same file.Changing the name starts a fresh memory folder; id changes between runs and is not used as the key.
agent.run() does not currently send that System message to the model, so a resumed agent does not see its earlier sessions on its own. Until it does, put the log into system_prompt yourself. The system prompt is never written to MEMORY.md, so this does not make the log grow.
import osfrom pathlib import Pathfrom swarms import Agentmemory_file = Path( os.getenv("WORKSPACE_DIR", "agent_workspace"), "agents", "ResearchAssistant", "MEMORY.md",)earlier = memory_file.read_text() if memory_file.exists() else ""# Second process, hours lateragent = Agent( agent_name="ResearchAssistant", model_name="gpt-5.4", max_loops=1, persistent_memory=True, system_prompt=( "You are a research assistant.\n\n" f"Your notes from earlier sessions:\n{earlier}" ),)agent.run("Compare BigQuery vs AlloyDB for our latency requirements.")
Snapshot the conversation to JSON and reload it later:
# Writes ./conversations/conversation_<conversation name>.jsonagent.short_memory.export()snapshot = agent.short_memory.save_filepath# Replace the history with the snapshotagent.short_memory.load(snapshot)
Snapshots go to ./conversations/ under the current working directory, not to the workspace. The folder is created only when you save.
For privacy-sensitive or one-off agents, set persistent_memory=False. In-process conversation_history still works for the duration of the run, but nothing is written to disk and nothing is preloaded next time:
from swarms import Agent# No MEMORY.md and no archive.ephemeral_agent = Agent( agent_name="EphemeralAgent", model_name="gpt-5.4", max_loops=1, persistent_memory=False,)ephemeral_agent.run("This task is not written to MEMORY.md.")
Conversation API — Underlying class for export, load, and search.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"swarms","colors":{"primary":"#DC2626","light":"#FFFFFF","dark":"#000000"},"logo":{"light":"https://mintcdn.com/kyegomez-swarms-97/2Wfh9aBTbMWV_Lyz/logo/light.svg?fit=max\u0026auto=format\u0026n=2Wfh9aBTbMWV_Lyz\u0026q=85\u0026s=e3d664b8b8f6928c836776b54704d076","dark":"https://mintcdn.com/kyegomez-swarms-97/2Wfh9aBTbMWV_Lyz/logo/dark.svg?fit=max\u0026auto=format\u0026n=2Wfh9aBTbMWV_Lyz\u0026q=85\u0026s=d1f710292b2b40794b44a3168a6b09dc"},"favicon":"https://mintcdn.com/kyegomez-swarms-97/UEClO9jJGrigmMUe/logo.svg?fit=max\u0026auto=format\u0026n=UEClO9jJGrigmMUe\u0026q=85\u0026s=07dcb5f5b9bca5ec8fd6475dcc9b5484","navbar":{"primary":{"type":"github","href":"https://github.com/kyegomez/swarms"}},"footer":{"socials":{"twitter":"https://twitter.com/swarms_corp","github":"https://github.com/kyegomez/swarms","website":"https://swarms.ai","linkedin":"https://www.linkedin.com/company/the-swarm-corporation","discord":"https://discord.gg/EamjgSaEQf","youtube":"https://www.youtube.com/channel/UC9yXyitkbU_WSy7bd_41SqQ","medium":"https://medium.com/@kyeg"}},"contextual":{"options":["copy","view","chatgpt","claude","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"kyegomez-swarms-97","hasAudioNarration":false,"actualSubdomain":"kyegomez-swarms-97","customDomains":["docs.swarms.world"],"gitSource":{"type":"github","owner":"the-swarm-corporation","repo":"swarms-framework-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ade27d790f989adb24ebb0c","collectionId":"0cb2ea24-451d-42c5-9222-5334866254f6","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ade27d790f989adb24ebb0c"},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6ade27d790f989adb24ebb0c","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"Examples","count":111},{"language":"default","tag":"Documentation","count":58},{"language":"default","tag":"API Reference","count":54},{"language":"default","tag":"Multi-Agent Harnesses","count":37},{"language":"default","tag":"RouteHub","count":17},{"language":"default","tag":"MCP Tool Integrations","count":15},{"language":"default","tag":"Community","count":13},{"language":"default","tag":"Model Providers","count":13},{"language":"default","tag":"Multi-Agent Architectures","count":12},{"language":"default","tag":"Integrations","count":12}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","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":"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":"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":"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":"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":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","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":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","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},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"examples/agents/persistent-memory","slug":"/examples/agents/persistent-memory","pageMetadata":{"title":"Persistent Memory","description":"Persist agent interaction history to disk via MEMORY.md and resume across process restarts.","icon":"database","href":"/examples/agents/persistent-memory"},"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: \"Persist agent interaction history to disk via MEMORY.md and resume across process restarts.\"\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`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Swarms agents can persist their interaction history to disk through a per-agent `,_jsx(_components.code,{children:`MEMORY.md`}),` file. The flag is `,_jsx(_components.code,{children:`False`}),` by default: set `,_jsx(_components.code,{children:`persistent_memory=True`}),` and reuse the same `,_jsx(_components.code,{children:`agent_name`}),` across process starts to resume the same memory.`]}),`\n`,_jsx(Heading,{level:`2`,id:`when-to-use-it`,children:`When to use it`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`The agent runs in separate processes (CLI, cron, restarts) and needs to resume prior context.`}),`\n`,_jsx(_components.li,{children:`You want a human-readable transcript of what the agent has seen and produced.`}),`\n`,_jsx(_components.li,{children:`You need to inspect, search, or export the agent’s interaction log.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`For external knowledge (PDFs, databases, doc stores), give the agent a retrieval tool instead — `,_jsx(_components.code,{children:`MEMORY.md`}),` is for the agent’s own history, not a document index. See `,_jsx(_components.a,{href:`/agents/agent-memory#external-knowledge`,children:`External knowledge`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`how-it-works`,children:`How it works`}),`\n`,_jsxs(_components.p,{children:[`Memory is keyed by `,_jsx(_components.code,{children:`agent_name`}),` and lives under the workspace directory. When `,_jsx(_components.code,{children:`WORKSPACE_DIR`}),` is not set, it falls back to `,_jsx(_components.code,{children:`./agent_workspace`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`$WORKSPACE_DIR/agents/{agent_name}/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`|-- MEMORY.md`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\"`-- archive/\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:\" `-- history_\u003ctimestamp>.md\"})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`On construction, Swarms reads `,_jsx(_components.code,{children:`MEMORY.md`}),` and adds it to `,_jsx(_components.code,{children:`agent.short_memory`}),` as a single `,_jsx(_components.code,{children:`System`}),` message. Every `,_jsx(_components.code,{children:`conversation.add(...)`}),` then writes through to disk so nothing is lost on exit.`]}),`\n`,_jsx(Heading,{level:`2`,id:`basic-example`,children:`Basic example`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`agent_name`}),` and `,_jsx(_components.code,{children:`persistent_memory=True`}),`. The first construction creates `,_jsx(_components.code,{children:`MEMORY.md`}),`, and every turn after that is appended to it:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`17`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` swarms `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Agent`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Off by default; opt in to keep a log that survives restarts.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`persistent_agent `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Agent(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` agent_name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ResearchAssistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` agent_description`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Remembers context across sessions\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model_name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-5.4\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` max_loops`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` persistent_memory`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`persistent_agent.run(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Research low-latency cloud data warehouses for analytics.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`persistent_agent.run(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Narrow the recommendation to GCP.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Active on-disk memory`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(persistent_agent.short_memory.memory_md_path)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# -> $WORKSPACE_DIR/agents/ResearchAssistant/MEMORY.md`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`resume-across-restarts`,children:`Resume across restarts`}),`\n`,_jsxs(_components.p,{children:[`Re-instantiate an agent with the `,_jsx(_components.strong,{children:`same`}),` `,_jsx(_components.code,{children:`agent_name`}),` and `,_jsx(_components.code,{children:`persistent_memory=True`}),`. The prior log is loaded into `,_jsx(_components.code,{children:`agent.short_memory`}),` as one `,_jsx(_components.code,{children:`System`}),` message, and new turns keep appending to the same file.`]}),`\n`,_jsxs(_components.p,{children:[`Changing the name starts a fresh memory folder; `,_jsx(_components.code,{children:`id`}),` changes between runs and is not used as the key.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`agent.run()`}),` does not currently send that `,_jsx(_components.code,{children:`System`}),` message to the model, so a resumed agent does not see its earlier sessions on its own. Until it does, put the log into `,_jsx(_components.code,{children:`system_prompt`}),` yourself. The system prompt is never written to `,_jsx(_components.code,{children:`MEMORY.md`}),`, so this does not make the log grow.`]})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`26`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`26`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` pathlib `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Path`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` swarms `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Agent`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`memory_file `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Path(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os.getenv(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"WORKSPACE_DIR\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"agent_workspace\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"agents\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"ResearchAssistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"MEMORY.md\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`earlier `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` memory_file.read_text() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` memory_file.exists() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`else`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Second process, hours later`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`agent `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Agent(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` agent_name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ResearchAssistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model_name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-5.4\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` max_loops`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` persistent_memory`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` system_prompt`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"You are a research assistant.`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Your notes from earlier sessions:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`earlier`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`agent.run(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Compare BigQuery vs AlloyDB for our latency requirements.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`inspect-memory-in-code`,children:`Inspect memory in code`}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`Conversation`}),` object is exposed as `,_jsx(_components.code,{children:`agent.short_memory`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`12`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Full prompt-ready history`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(agent.short_memory.return_history_as_string())`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Structured message list`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`messages `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` agent.short_memory.to_dict()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Last response only`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(agent.short_memory.get_final_message_content())`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Search past turns`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`hits `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` agent.short_memory.search(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"GCP\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`matches `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` agent.short_memory.search_keyword_in_conversation(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"latency\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`export-and-reload`,children:`Export and reload`}),`\n`,_jsx(_components.p,{children:`Snapshot the conversation to JSON and reload it later:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Writes ./conversations/conversation_\u003cconversation name>.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`agent.short_memory.export()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`snapshot `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` agent.short_memory.save_filepath`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Replace the history with the snapshot`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`agent.short_memory.load(snapshot)`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Snapshots go to `,_jsx(_components.code,{children:`./conversations/`}),` under the current working directory, not to the workspace. The folder is created only when you save.`]}),`\n`,_jsx(Heading,{level:`2`,id:`disable-disk-backed-memory`,children:`Disable disk-backed memory`}),`\n`,_jsxs(_components.p,{children:[`For privacy-sensitive or one-off agents, set `,_jsx(_components.code,{children:`persistent_memory=False`}),`. In-process `,_jsx(_components.code,{children:`conversation_history`}),` still works for the duration of the run, but nothing is written to disk and nothing is preloaded next time:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` swarms `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Agent`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# No MEMORY.md and no archive.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ephemeral_agent `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Agent(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` agent_name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"EphemeralAgent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model_name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-5.4\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` max_loops`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` persistent_memory`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`False`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ephemeral_agent.run(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"This task is not written to MEMORY.md.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`tips`,children:`Tips`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Use stable, descriptive `,_jsx(_components.code,{children:`agent_name`}),` values for any agent that should remember prior work.`]}),`\n`,_jsxs(_components.li,{children:[`Don’t reuse the same `,_jsx(_components.code,{children:`agent_name`}),` across unrelated tasks — memory will leak between runs.`]}),`\n`,_jsxs(_components.li,{children:[`For long-running agents, also enable `,_jsx(_components.a,{href:`/examples/agents/context-compression`,children:`context compression`}),` so memory stays within the model’s context window.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`see-also`,children:`See also`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/agents/agent-memory`,children:`Agent Memory Reference`}),` — Full memory stack, lifecycle, disk layout, and where every file is written.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/examples/agents/context-compression`,children:`Context Compression`}),` — Keep persistent memory within the context window.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/api/conversation`,children:`Conversation API`}),` — Underlying class for export, load, and search.`]}),`\n`]})]})}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":"Persistent Memory","description":"Persist agent interaction history to disk via MEMORY.md and resume across process restarts.","icon":"database","href":"/examples/agents/persistent-memory"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"When to use it","slug":"when-to-use-it","depth":2,"children":[]},{"title":"How it works","slug":"how-it-works","depth":2,"children":[]},{"title":"Basic example","slug":"basic-example","depth":2,"children":[]},{"title":"Resume across restarts","slug":"resume-across-restarts","depth":2,"children":[]},{"title":"Inspect memory in code","slug":"inspect-memory-in-code","depth":2,"children":[]},{"title":"Export and reload","slug":"export-and-reload","depth":2,"children":[]},{"title":"Disable disk-backed memory","slug":"disable-disk-backed-memory","depth":2,"children":[]},{"title":"Tips","slug":"tips","depth":2,"children":[]},{"title":"See also","slug":"see-also","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"kyegomez-swarms-97","siteName":"swarms","title":"Persistent Memory - swarms","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-03T00:14:37.517Z","originalFileLocation":"examples/agents/persistent-memory.mdx"},"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=\"system\"}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=\"Persist agent interaction history to disk via MEMORY.md and resume across process restarts.\">\u003cmeta data-mint-head name=\"application-name\" content=\"swarms\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/kyegomez-swarms-97/Ctj8KAbEFcaygyNp/_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/kyegomez-swarms-97/Ctj8KAbEFcaygyNp/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/kyegomez-swarms-97/Ctj8KAbEFcaygyNp/_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/kyegomez-swarms-97/Ctj8KAbEFcaygyNp/_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/kyegomez-swarms-97/Ctj8KAbEFcaygyNp/_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/kyegomez-swarms-97/Ctj8KAbEFcaygyNp/_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/kyegomez-swarms-97/Ctj8KAbEFcaygyNp/_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/kyegomez-swarms-97/Ctj8KAbEFcaygyNp/_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/kyegomez-swarms-97/Ctj8KAbEFcaygyNp/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Persistent Memory - swarms\">\u003cmeta data-mint-head property=\"og:description\" content=\"Persist agent interaction history to disk via MEMORY.md and resume across process restarts.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"swarms\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.swarms.world/examples/agents/persistent-memory\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://kyegomez-swarms-97.mintlify.app/_mintlify/api/og/v2?division=Single+Agent\u0026amp;title=Persistent+Memory\u0026amp;description=Persist+agent+interaction+history+to+disk+via+MEMORY.md+and+resume+across+process+restarts.\u0026amp;theme=5153e5700b995bc72eadb0da\u0026amp;signature=e00f20bfeb0b7a03bde1105a3cb25603a4c019843e56354dd25b4dc7e7160ca3\">\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=\"Persistent Memory - swarms\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Persist agent interaction history to disk via MEMORY.md and resume across process restarts.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://kyegomez-swarms-97.mintlify.app/_mintlify/api/og/v2?division=Single+Agent\u0026amp;title=Persistent+Memory\u0026amp;description=Persist+agent+interaction+history+to+disk+via+MEMORY.md+and+resume+across+process+restarts.\u0026amp;theme=5153e5700b995bc72eadb0da\u0026amp;signature=e00f20bfeb0b7a03bde1105a3cb25603a4c019843e56354dd25b4dc7e7160ca3\">\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/kyegomez-swarms-97/Ctj8KAbEFcaygyNp/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"swarms\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#DC2626\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.swarms.world/examples/agents/persistent-memory\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/examples/agents/persistent-memory.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.swarms.world/#organization\",\"name\":\"swarms\",\"url\":\"https://docs.swarms.world\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/kyegomez-swarms-97/2Wfh9aBTbMWV_Lyz/logo/light.svg?fit=max\u0026auto=format\u0026n=2Wfh9aBTbMWV_Lyz\u0026q=85\u0026s=e3d664b8b8f6928c836776b54704d076\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.swarms.world#website\",\"name\":\"swarms\",\"url\":\"https://docs.swarms.world\",\"publisher\":{\"@id\":\"https://docs.swarms.world/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.swarms.world/examples/agents/persistent-memory#webpage\",\"url\":\"https://docs.swarms.world/examples/agents/persistent-memory\",\"name\":\"Persistent Memory\",\"description\":\"Persist agent interaction history to disk via MEMORY.md and resume across process restarts.\",\"dateModified\":\"2026-10-03T00:14:37.517Z\",\"isPartOf\":{\"@id\":\"https://docs.swarms.world#website\"},\"breadcrumb\":{\"@id\":\"https://docs.swarms.world/examples/agents/persistent-memory#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.swarms.world/examples/agents/persistent-memory#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Single Agent\",\"item\":\"https://docs.swarms.world/examples/overviews/rag-overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Persistent Memory\",\"item\":\"https://docs.swarms.world/examples/agents/persistent-memory\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.swarms.world/examples/agents/persistent-memory#article\",\"headline\":\"Persistent Memory\",\"name\":\"Persistent Memory\",\"description\":\"Persist agent interaction history to disk via MEMORY.md and resume across process restarts.\",\"url\":\"https://docs.swarms.world/examples/agents/persistent-memory\",\"mainEntityOfPage\":{\"@id\":\"https://docs.swarms.world/examples/agents/persistent-memory#webpage\"},\"dateModified\":\"2026-10-03T00:14:37.517Z\",\"publisher\":{\"@id\":\"https://docs.swarms.world/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.swarms.world#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"swarms\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"swarms","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api/agent"}]},{"tab":"RouteHub","pages":[{"title":"RouteHub","href":"/routehub/overview"}]},{"tab":"Swarms API","pages":[{"title":"Swarms API","href":"/swarms-api/overview"}]},{"tab":"Examples","groups":[{"group":"Index","pages":[{"title":"Overview","icon":"table-list","href":"/examples/overview"},{"title":"Examples Index","icon":"book","href":"/examples/overviews/examples-index"},{"title":"Swarms Cookbook","icon":"book-open","href":"/examples/overviews/cookbook"},{"title":"Community Resources","icon":"users","href":"/examples/overviews/community-resources"}]},{"group":"Basic Examples","pages":[{"title":"Basic Examples Overview","icon":"graduation-cap","href":"/examples/overviews/basic-overview"},{"title":"Basic Agent","icon":"robot","href":"/examples/basic-agent"},{"title":"Agent with Tools","icon":"wrench","href":"/examples/agent-with-tools"},{"title":"Dynamic Tool Usage","icon":"magnifying-glass-arrow-right","href":"/examples/tools/dynamic-tool-usage"},{"title":"Vision Agent","icon":"eye","href":"/examples/vision-agent"},{"title":"Streaming Responses","icon":"tower-broadcast","href":"/examples/streaming"},{"title":"Agent Streaming","icon":"bolt","href":"/examples/agent-streaming-example"}]},{"group":"Model Providers","pages":[{"title":"Building Agents with Anthropic","icon":"anthropic","href":"/examples/model-providers/anthropic"},{"title":"Building Agents with OpenAI","icon":"openai","href":"/examples/model-providers/openai"},{"title":"Building Agents with Gemini","icon":"google","href":"/examples/model-providers/gemini"},{"title":"Claude Fable 5","icon":"sparkles","href":"/examples/model-providers/claude-fable-5"},{"title":"Building Agents with Groq","icon":"bolt","href":"/examples/model-providers/groq"},{"title":"Building Agents with Cerebras","icon":"gauge-high","href":"/examples/model-providers/cerebras"},{"title":"Building Agents with DeepSeek","icon":"brain","href":"/examples/model-providers/deepseek"},{"title":"Building Agents with xAI (Grok)","icon":"x","href":"/examples/model-providers/xai"},{"title":"Building Agents with Ollama","icon":"house","href":"/examples/model-providers/ollama"},{"title":"Building Agents with vLLM","icon":"server","href":"/examples/model-providers/vllm"},{"title":"Building Agents with OpenRouter","icon":"route","href":"/examples/model-providers/openrouter"},{"title":"OpenRouter Tutorial: Single Agents, Group Chat \u0026 Concurrent Workflows","icon":"route","href":"/examples/model-providers/openrouter-tutorial"},{"title":"Building Agents with Azure OpenAI","icon":"microsoft","href":"/examples/model-providers/azure-openai"}]},{"group":"Single Agent","pages":[{"title":"RAG Examples Overview","icon":"database","href":"/examples/overviews/rag-overview"},{"title":"Agent Streaming","icon":"wave-pulse","href":"/examples/agents/agent-streaming"},{"title":"Advanced Research","icon":"flask","href":"/examples/agents/advanced-research"},{"title":"Autonomous Looper with Bash","icon":"terminal","href":"/examples/agents/autonomous-looper-bash"},{"title":"Autonomous Looper with Tools","description":"Build an autonomous looping agent that uses tools to iteratively achieve a goal.","icon":"screwdriver-wrench","href":"/examples/agents/autonomous-looper-tools"},{"title":"Persistent Memory","icon":"database","href":"/examples/agents/persistent-memory"},{"title":"Context Compression","description":"Automatically summarize agent memory when it nears the context window, while archiving the full transcript.","icon":"compress","href":"/examples/agents/context-compression"},{"title":"Prompt Caching","icon":"database","href":"/examples/agents/prompt-caching"}]},{"group":"Tree of Thoughts","pages":[{"title":"Number theory with a BFS beam","icon":"calculator","href":"/examples/tree-of-thoughts/number-theory-counting"},{"title":"Fermi estimate with sampling and votes","icon":"bolt","href":"/examples/tree-of-thoughts/fermi-estimation"},{"title":"Knights and knaves with DFS","icon":"chess-knight","href":"/examples/tree-of-thoughts/knights-and-knaves"}]},{"group":"Multi-Agent Examples","pages":[{"title":"Multi-Agent Architectures Overview","icon":"sitemap","href":"/examples/overviews/multi-agent-overview"},{"title":"Sequential Workflow Example","href":"/examples/sequential-workflow-example"},{"title":"Sequential Workflow Streaming","icon":"arrow-right-arrow-left","href":"/examples/sequential-workflow-streaming-example"},{"title":"Concurrent Workflow Example","href":"/examples/concurrent-workflow-example"},{"title":"Mixture of Agents (MoA) Example","href":"/examples/mixture-of-agents-example"},{"title":"Hierarchical Swarm Example","href":"/examples/hierarchical-swarm-example"},{"title":"Group Chat Example","href":"/examples/group-chat-example"},{"title":"Swarm Router Example","href":"/examples/swarm-router-example"},{"title":"Advisor Swarm Example","href":"/examples/multi-agent/advisor-swarm-example"},{"title":"Debate Swarm Quickstart","icon":"comments","href":"/examples/multi-agent/debate-quickstart"},{"title":"Social Swarm Patterns","icon":"diagram-project","href":"/examples/social-swarm-patterns"}]},{"group":"Auto Agent Builder","pages":[{"title":"Auto Agent Builder Quickstart","icon":"wand-magic-sparkles","href":"/examples/auto-agent-builder/quickstart"},{"title":"Dynamic Support Triage","icon":"headset","href":"/examples/auto-agent-builder/triage"},{"title":"Reproducible Rosters","icon":"lock","href":"/examples/auto-agent-builder/reproducible"}]},{"group":"Scheduled Agents","pages":[{"title":"CronJob Quickstart","icon":"clock","href":"/examples/cron-job/quickstart"},{"title":"Multiple Agents on Different Schedules","icon":"layer-group","href":"/examples/cron-job/multiple-agents"},{"title":"Failure Handling and Monitoring","icon":"shield-halved","href":"/examples/cron-job/resilience"}]},{"group":"Applications","pages":[{"title":"Applications Overview","icon":"rectangle-list","href":"/examples/overviews/applications-overview"},{"title":"Apps Overview","icon":"grid","href":"/examples/overviews/apps-overview"},{"title":"Paper Implementations","icon":"scroll","href":"/examples/overviews/paper-implementations"},{"title":"Templates \u0026 Applications","icon":"layer-group","href":"/examples/overviews/templates"},{"title":"Marketing Team Swarm","icon":"bullhorn","href":"/examples/applications/marketing-team"},{"title":"Hiring Swarm","icon":"user-tie","href":"/examples/applications/hiring-swarm"},{"title":"Job Finding Swarm","icon":"briefcase","href":"/examples/applications/job-finding"},{"title":"M\u0026A Swarm","icon":"handshake","href":"/examples/applications/ma-swarm"},{"title":"Real Estate Swarm","icon":"house","href":"/examples/applications/realestate-swarm"},{"title":"Smart Database Swarm","icon":"database","href":"/examples/applications/smart-database"}]},{"group":"Research","pages":[{"title":"Can AI Agents Agree?","icon":"people-arrows","href":"/examples/research/can_agents_agree"},{"title":"Open Agent Bazaar","icon":"store","href":"/examples/research/open_agent_bazaar"}]},{"group":"Technical Analysis","pages":[{"title":"GroupChat Internals: A Technical Analysis","icon":"diagram-project","href":"/examples/groupchat_insight"}]},{"group":"Use Cases","pages":[{"title":"Research Team Swarm","icon":"microscope","href":"/examples/use-cases/research-team"},{"title":"Content Creation Pipeline","icon":"pen-nib","href":"/examples/use-cases/content-creation"},{"title":"Data Analysis Swarm","icon":"chart-line","href":"/examples/use-cases/data-analysis"}]},{"group":"Finance","pages":[{"title":"Gold ETF Research","icon":"coins","href":"/examples/applications/gold-etf-research"},{"title":"Financial Analysis System","icon":"chart-pie","href":"/examples/use-cases/financial-analysis"},{"title":"Agentic Trading with Gemini","icon":"robot","href":"/examples/finance/agentic-trading-gemini"},{"title":"Prediction Markets: Polymarket","icon":"scale-balanced","href":"/examples/finance/prediction-markets-polymarket"},{"title":"Prediction Markets: Kalshi","icon":"scale-balanced","href":"/examples/finance/prediction-markets-kalshi"}]},{"group":"Voice Agents","pages":[{"title":"Voice Agents Overview","icon":"microphone","href":"/examples/voice-agents/overview"},{"title":"Basic Speech Agent","icon":"volume-high","href":"/examples/voice-agents/agent-speech"},{"title":"Streaming Voice Agent","icon":"tower-broadcast","href":"/examples/voice-agents/agent-with-streaming-speech"},{"title":"Autonomous Voice Agent","icon":"robot","href":"/examples/voice-agents/autonomous-agent-with-speech"},{"title":"Voice Debate","icon":"comments","href":"/examples/voice-agents/debate-with-speech"},{"title":"Hierarchical Speech Swarm","icon":"sitemap","href":"/examples/voice-agents/hierarchical-speech-swarm"}]},{"group":"Integrations","pages":[{"title":"Tools \u0026 Integrations Overview","icon":"puzzle-piece","href":"/examples/overviews/tools-overview"},{"title":"Web Search with Exa","icon":"magnifying-glass","href":"/examples/integrations/exa-search"},{"title":"Browser Use","icon":"globe","href":"/examples/integrations/browser-use"},{"title":"MCP Server and Client","icon":"plug","href":"/examples/integrations/mcp-datastax"},{"title":"x402 Discovery Query","icon":"satellite-dish","href":"/examples/integrations/x402-discovery"},{"title":"x402 Payment Integration","icon":"credit-card","href":"/examples/integrations/x402-payment"},{"title":"Firecrawl Tool","icon":"fire","href":"/examples/integrations/firecrawl"},{"title":"Web Scraper Agents","icon":"spider","href":"/examples/integrations/web-scraper-agents"}]},{"group":"MCP Tool Integrations","pages":[{"title":"MCP examples overview","icon":"plug","href":"/examples/mcp/overview"},{"title":"DeepWiki: repo Q\u0026A","icon":"book","href":"/examples/mcp/deepwiki-repo-qa"},{"title":"GitMCP: one-repo docs bot","icon":"github","href":"/examples/mcp/gitmcp-repo-docs"},{"title":"Microsoft Learn: grounded answers","icon":"microsoft","href":"/examples/mcp/microsoft-learn-docs"},{"title":"Exa: live web search","icon":"magnifying-glass","href":"/examples/mcp/exa-web-search"},{"title":"Firecrawl: scrape pages to markdown","icon":"fire","href":"/examples/mcp/firecrawl-web-scraping"},{"title":"Hugging Face: find models","icon":"face-smile","href":"/examples/mcp/huggingface-model-search"},{"title":"Semgrep: security review","icon":"shield-halved","href":"/examples/mcp/semgrep-security-scan"},{"title":"Several servers at once","icon":"layer-group","href":"/examples/mcp/multi-server-agent"},{"title":"Serve an agent over MCP","icon":"rocket","href":"/examples/mcp/mcp-deployer-serve-agent"},{"title":"Serve a team of agents from one MCP server","icon":"users","href":"/examples/mcp/mcp-deployer-serve-team"},{"title":"MCP in a multi-agent workflow","icon":"diagram-project","href":"/examples/mcp/sequential-workflow"},{"title":"Dynamic tool loading","icon":"bolt","href":"/examples/mcp/dynamic-tool-loading"},{"title":"Authentication patterns","icon":"key","href":"/examples/mcp/authentication"},{"title":"Build your own MCP server","icon":"server","href":"/examples/mcp/local-server"}]},{"group":"Deployment","pages":[{"title":"Deployment Solutions Overview","icon":"cloud-arrow-up","href":"/examples/deployment-overview"},{"title":"FastAPI Agent API","icon":"server","href":"/examples/fastapi-agent-api"},{"title":"Google Cloud Run","icon":"cloud","href":"/examples/cloud-run"},{"title":"Cloudflare Workers","icon":"cloudflare","href":"/examples/cloudflare-workers"},{"title":"Phala TEE Deployment","icon":"shield-halved","href":"/examples/phala-deploy"}]},{"group":"CLI","pages":[{"title":"CLI Guides Overview","icon":"terminal","href":"/examples/overviews/cli-overview"},{"title":"CLI Quickstart Tutorial","icon":"rocket","href":"/examples/cli/quickstart-tutorial"},{"title":"Chat Command","icon":"message","href":"/examples/cli/chat-command"},{"title":"Multi-Agent CLI Quickstart","icon":"rocket","href":"/examples/cli/multi-agent-quickstart"}]}]},{"tab":"Community","pages":[{"title":"Community","href":"/community/contributing"}]}]},"basePath":"","title":"Persistent Memory - swarms","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":[],"chunks":[]}