When you pass memory= to an Agent, the agent automatically injects stored conversation history before each model call and stores new messages after each response. When the session grows beyond max_messages, older messages are automatically summarized.
Setup
There are two ways to add memory to an agent:1. Memory instance (recommended):
from definable.agent import Agentfrom definable.memory import Memory, SQLiteStorefrom definable.model.openai import OpenAIChatagent = Agent( model=OpenAIChat(id="gpt-4o"), instructions="You are a helpful assistant.", memory=Memory(store=SQLiteStore("./memory.db")),)
2. memory=True — ephemeral in-memory store, useful for testing:
agent = Agent( model=OpenAIChat(id="gpt-4o"), memory=True, # Uses InMemoryStore, data lost when process exits)
Execution Flow
Recall — Before calling the model, the agent loads the session’s conversation history from the store and injects it as context in the system prompt.
Model call — The model receives the conversation plus any injected memory context.
Store — After the response, the agent stores the new user and assistant messages. If the total entry count exceeds max_messages, the SummarizeStrategy runs: it pins the first few messages, summarizes the middle section, and keeps the most recent messages intact. This runs as a background task.
Auto-Summarization
When conversation history exceeds max_messages, the SummarizeStrategy compresses it:
[pinned: first N messages] + [summary of middle messages] + [recent: last M messages]
Configure the summarization behavior:
memory = Memory( store=SQLiteStore("./memory.db"), max_messages=100, # Trigger summarization above this count pin_count=2, # Always keep the first 2 messages recent_count=5, # Always keep the last 5 messages)
The summarization is tool-call-aware — it respects tool call boundaries so that tool requests and their results stay together in the same section.
Multi-User Scoping
Pass user_id to scope memory per user:
# Alice's conversationoutput = await agent.arun("I prefer dark mode.", user_id="alice")# Bob's conversation — will not see Alice's historyoutput = await agent.arun("What theme do I prefer?", user_id="bob")
The user_id flows through RunContext and is used for both recall and storage. Each user’s conversation history is fully isolated.
Multi-Turn Conversations
Memory works alongside session-based multi-turn conversations. Pass previous messages to maintain conversation continuity, while memory handles long-term history:
# Turn 1r1 = await agent.arun( "My favorite color is blue.", user_id="alice",)# Turn 2 — pass messages for conversation continuityr2 = await agent.arun( "What's my favorite color?", user_id="alice", messages=r1.messages,)
session_id alone does NOT maintain conversation history. You must pass messages=r1.messages for multi-turn context, or use Memory for long-term recall across sessions.
Direct Memory Operations
You can interact with the memory system directly, outside of agent runs:
from definable.memory import Memory, SQLiteStorefrom definable.model.message import Messagememory = Memory(store=SQLiteStore("./memory.db"))# Add messagesawait memory.add(Message(role="user", content="Hello!"), session_id="s1", user_id="alice")await memory.add(Message(role="assistant", content="Hi Alice!"), session_id="s1", user_id="alice")# Read session historyentries = await memory.get_entries("s1", user_id="alice")# Get as Message objectsmessages = await memory.get_context_messages("s1", user_id="alice")# Update a specific entryawait memory.update(entries[0].memory_id, "Updated content")# Delete a specific entryawait memory.delete(entries[0].memory_id)# Clear entire sessionawait memory.clear("s1", user_id="alice")# Clean upawait memory.close()
Non-Fatal Behavior
All memory operations are designed to be non-fatal. If the memory store is unavailable or a memory operation fails, the agent logs a warning and continues normally without memory context:
# Even if the database is unreachable, the agent still worksoutput = await agent.arun("Hello!") # Works fine, just without memory context
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Definable AI","colors":{"primary":"#FA8112","light":"#FA8112","dark":"#FA8112"},"logo":{"light":"https://mintcdn.com/definableaiprivatelimited/mDNvZulDI7LGheEl/logo/light.svg?fit=max\u0026auto=format\u0026n=mDNvZulDI7LGheEl\u0026q=85\u0026s=4b85977f6a03ffc7ceaa9b818e5d7990","dark":"https://mintcdn.com/definableaiprivatelimited/mDNvZulDI7LGheEl/logo/dark.svg?fit=max\u0026auto=format\u0026n=mDNvZulDI7LGheEl\u0026q=85\u0026s=88f4a2faa73881a1af38ae9e48f83c11"},"favicon":"/favicon.svg","background":{"color":{"light":"#FAF3E1","dark":"#222222"}},"navbar":{"links":[{"href":"https://github.com/definable-ai/definable","label":"GitHub"}]},"footer":{"socials":{"github":"https://github.com/definable-ai"}},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/definable-ai/definable"},{"anchor":"PyPI","icon":"cube","href":"https://pypi.org/project/definable-ai/"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"definableaiprivatelimited","hasAudioNarration":false,"actualSubdomain":"definableaiprivatelimited","customDomains":["docs.definable.ai"],"gitSource":{"type":"github","owner":"definableai","repo":"definable.ai","deployBranch":"main","contentDirectory":"definable/docs","isPrivate":true,"mountPath":"","label":"","_id":"6b10d3309ffae5051c40c07e"},"entitlements":{},"buildId":"6ae94795d69537c8ab6fa802:success","clientVersion":"0.0.4453","searchFilterCounts":[{"language":"default","tag":"Documentation","count":127},{"language":"default","tag":"Basics","count":48},{"language":"default","tag":"Capabilities","count":41},{"language":"default","tag":"Examples","count":36},{"language":"default","tag":"Advanced","count":34},{"language":"default","tag":"Models","count":19},{"language":"default","tag":"Usage","count":17},{"language":"default","tag":"Interfaces","count":17},{"language":"default","tag":"Tools","count":15},{"language":"default","tag":"Agents","count":12}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":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":"rbac-expansion","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":"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":"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":"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":"turbopuffer-dual-write","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":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"memory/agent-integration","slug":"/memory/agent-integration","pageMetadata":{"title":"Agent Integration","sidebarTitle":"Agent Integration","description":"How memory integrates with the agent lifecycle.","icon":"link","href":"/memory/agent-integration","hidden":false},"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: \"How memory integrates with the agent lifecycle.\"\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={code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading,Mermaid,Note}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Mermaid)_missingMdxReference(`Mermaid`,true);if(!Note)_missingMdxReference(`Note`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`When you pass `,_jsx(_components.code,{children:`memory=`}),` to an `,_jsx(_components.code,{children:`Agent`}),`, the agent automatically injects stored conversation history before each model call and stores new messages after each response. When the session grows beyond `,_jsx(_components.code,{children:`max_messages`}),`, older messages are automatically summarized.`]}),`\n`,_jsx(Heading,{level:`2`,id:`setup`,children:`Setup`}),`\n`,_jsx(_components.p,{children:`There are two ways to add memory to an agent:`}),`\n`,_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[`1. `,_jsx(_components.code,{children:`Memory`}),` instance (recommended)`]}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,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:`9`,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:` definable.agent `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Agent`})]}),`\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:` definable.memory `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Memory, SQLiteStore`})]}),`\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:` definable.model.openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAIChat`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\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:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`OpenAIChat(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-4o\"`}),_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:` instructions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"You are a helpful assistant.\"`}),_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:` memory`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`Memory(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`store`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SQLiteStore(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./memory.db\"`}),_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`]})})}),`\n`,_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[`2. `,_jsx(_components.code,{children:`memory=True`})]}),` — ephemeral in-memory store, useful for testing:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,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:`4`,children:[_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:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`OpenAIChat(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-4o\"`}),_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:` 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:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Uses InMemoryStore, data lost when process exits`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`execution-flow`,children:`Execution Flow`}),`\n`,_jsx(Mermaid,{chart:`sequenceDiagram\n participant User\n participant Agent\n participant Memory\n participant Store\n participant Model\n\n User->>Agent: arun(\"Where do I work?\", user_id=\"alice\")\n\n Agent->>Store: get_entries(session_id, user_id=\"alice\")\n Store-->>Agent: list[MemoryEntry]\n Agent->>Agent: Format entries as conversation history\n Note over Agent: Inject into system prompt\n\n Agent->>Model: messages + system prompt\n Model-->>Agent: response\n\n Agent->>Memory: add(user_message + assistant_response)\n Memory->>Store: store entries\n opt count > max_messages\n Memory->>Model: Summarize older messages\n Model-->>Memory: Summary text\n Memory->>Store: Replace middle entries with summary\n end\n\n Agent-->>User: RunOutput`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Recall`}),` — Before calling the model, the agent loads the session’s conversation history from the store and injects it as context in the system prompt.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Model call`}),` — The model receives the conversation plus any injected memory context.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Store`}),` — After the response, the agent stores the new user and assistant messages. If the total entry count exceeds `,_jsx(_components.code,{children:`max_messages`}),`, the `,_jsx(_components.code,{children:`SummarizeStrategy`}),` runs: it pins the first few messages, summarizes the middle section, and keeps the most recent messages intact. This runs as a background task.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`auto-summarization`,children:`Auto-Summarization`}),`\n`,_jsxs(_components.p,{children:[`When conversation history exceeds `,_jsx(_components.code,{children:`max_messages`}),`, the `,_jsx(_components.code,{children:`SummarizeStrategy`}),` compresses it:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,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:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`[pinned: first N messages] + [summary of middle messages] + [recent: last M messages]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Configure the summarization behavior:`}),`\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:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`memory `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Memory(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` store`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SQLiteStore(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./memory.db\"`}),_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_messages`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`100`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Trigger summarization above this count`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` pin_count`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Always keep the first 2 messages`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` recent_count`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Always keep the last 5 messages`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The summarization is tool-call-aware — it respects tool call boundaries so that tool requests and their results stay together in the same section.`}),`\n`,_jsx(Heading,{level:`2`,id:`multi-user-scoping`,children:`Multi-User Scoping`}),`\n`,_jsxs(_components.p,{children:[`Pass `,_jsx(_components.code,{children:`user_id`}),` to scope memory per user:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,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:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Alice's conversation`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`output `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` agent.arun(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"I prefer dark mode.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`user_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"alice\"`}),_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:`# Bob's conversation — will not see Alice's history`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`output `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` agent.arun(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"What theme do I prefer?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`user_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"bob\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`user_id`}),` flows through `,_jsx(_components.code,{children:`RunContext`}),` and is used for both recall and storage. Each user’s conversation history is fully isolated.`]}),`\n`,_jsx(Heading,{level:`2`,id:`multi-turn-conversations`,children:`Multi-Turn Conversations`}),`\n`,_jsx(_components.p,{children:`Memory works alongside session-based multi-turn conversations. Pass previous messages to maintain conversation continuity, while memory handles long-term history:`}),`\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:`# Turn 1`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`r1 `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` agent.arun(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"My favorite color is blue.\"`}),_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:` user_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"alice\"`}),_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`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Turn 2 — pass messages for conversation continuity`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`r2 `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` agent.arun(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"What's my favorite color?\"`}),_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:` user_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"alice\"`}),_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:` messages`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`r1.messages,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`session_id`}),` alone does NOT maintain conversation history. You must pass `,_jsx(_components.code,{children:`messages=r1.messages`}),` for multi-turn context, or use Memory for long-term recall across sessions.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`direct-memory-operations`,children:`Direct Memory Operations`}),`\n`,_jsx(_components.p,{children:`You can interact with the memory system directly, outside of agent runs:`}),`\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:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` definable.memory `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Memory, SQLiteStore`})]}),`\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:` definable.model.message `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Message`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`memory `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Memory(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`store`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`SQLiteStore(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./memory.db\"`}),_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:`# Add messages`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` memory.add(Message(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`role`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello!\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`session_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"s1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`user_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"alice\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` memory.add(Message(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`role`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"assistant\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hi Alice!\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`session_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"s1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`user_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"alice\"`}),_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:`# Read session history`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`entries `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` memory.get_entries(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"s1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`user_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"alice\"`}),_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:`# Get as Message objects`})}),`\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:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` memory.get_context_messages(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"s1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`user_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"alice\"`}),_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:`# Update a specific entry`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` memory.update(entries[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].memory_id, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Updated content\"`}),_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:`# Delete a specific entry`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` memory.delete(entries[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].memory_id)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Clear entire session`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` memory.clear(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"s1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`user_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"alice\"`}),_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:`# Clean up`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` memory.close()`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`non-fatal-behavior`,children:`Non-Fatal Behavior`}),`\n`,_jsx(_components.p,{children:`All memory operations are designed to be non-fatal. If the memory store is unavailable or a memory operation fails, the agent logs a warning and continues normally without memory context:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,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:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Even if the database is unreachable, the agent still works`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`output `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` agent.arun(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello!\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Works fine, just without memory context`})]}),`\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":"Agent Integration","sidebarTitle":"Agent Integration","description":"How memory integrates with the agent lifecycle.","icon":"link","href":"/memory/agent-integration","hidden":false}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Setup","slug":"setup","depth":2,"children":[]},{"title":"Execution Flow","slug":"execution-flow","depth":2,"children":[]},{"title":"Auto-Summarization","slug":"auto-summarization","depth":2,"children":[]},{"title":"Multi-User Scoping","slug":"multi-user-scoping","depth":2,"children":[]},{"title":"Multi-Turn Conversations","slug":"multi-turn-conversations","depth":2,"children":[]},{"title":"Direct Memory Operations","slug":"direct-memory-operations","depth":2,"children":[]},{"title":"Non-Fatal Behavior","slug":"non-fatal-behavior","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"definableaiprivatelimited","siteName":"Definable AI","title":"Agent Integration - Definable AI","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-02-19T22:51:53.430Z","originalFileLocation":"memory/agent-integration.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=\"How memory integrates with the agent lifecycle.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Definable AI\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/definableaiprivatelimited/Kfj4AiUCcTNUUhqf/_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/definableaiprivatelimited/Kfj4AiUCcTNUUhqf/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/definableaiprivatelimited/Kfj4AiUCcTNUUhqf/_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/definableaiprivatelimited/Kfj4AiUCcTNUUhqf/_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/definableaiprivatelimited/Kfj4AiUCcTNUUhqf/_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/definableaiprivatelimited/Kfj4AiUCcTNUUhqf/_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/definableaiprivatelimited/Kfj4AiUCcTNUUhqf/_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/definableaiprivatelimited/Kfj4AiUCcTNUUhqf/_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/definableaiprivatelimited/Kfj4AiUCcTNUUhqf/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Agent Integration - Definable AI\">\u003cmeta data-mint-head property=\"og:description\" content=\"How memory integrates with the agent lifecycle.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Definable AI\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.definable.ai/memory/agent-integration\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://definableaiprivatelimited.mintlify.site/_mintlify/api/og/v2?division=Memory\u0026amp;title=Agent+Integration\u0026amp;description=How+memory+integrates+with+the+agent+lifecycle.\u0026amp;theme=292dbdbb8f2a2bd1ee1ab5df\u0026amp;signature=795a69f8a79d49748b0ae803ad00b20c428830018a6e10ac0437a5b82eef57b8\">\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=\"Agent Integration - Definable AI\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How memory integrates with the agent lifecycle.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://definableaiprivatelimited.mintlify.site/_mintlify/api/og/v2?division=Memory\u0026amp;title=Agent+Integration\u0026amp;description=How+memory+integrates+with+the+agent+lifecycle.\u0026amp;theme=292dbdbb8f2a2bd1ee1ab5df\u0026amp;signature=795a69f8a79d49748b0ae803ad00b20c428830018a6e10ac0437a5b82eef57b8\">\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/definableaiprivatelimited/Kfj4AiUCcTNUUhqf/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Definable AI\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FA8112\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.definable.ai/memory/agent-integration\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/memory/agent-integration.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.definable.ai/#organization\",\"name\":\"Definable AI\",\"url\":\"https://docs.definable.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/definableaiprivatelimited/mDNvZulDI7LGheEl/logo/light.svg?fit=max\u0026auto=format\u0026n=mDNvZulDI7LGheEl\u0026q=85\u0026s=4b85977f6a03ffc7ceaa9b818e5d7990\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.definable.ai#website\",\"name\":\"Definable AI\",\"url\":\"https://docs.definable.ai\",\"publisher\":{\"@id\":\"https://docs.definable.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.definable.ai/memory/agent-integration#webpage\",\"url\":\"https://docs.definable.ai/memory/agent-integration\",\"name\":\"Agent Integration\",\"description\":\"How memory integrates with the agent lifecycle.\",\"dateModified\":\"2026-02-19T22:51:53.430Z\",\"isPartOf\":{\"@id\":\"https://docs.definable.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.definable.ai/memory/agent-integration#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.definable.ai/memory/agent-integration#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Capabilities\",\"item\":\"https://docs.definable.ai/tools/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Memory\",\"item\":\"https://docs.definable.ai/memory/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Agent Integration\",\"item\":\"https://docs.definable.ai/memory/agent-integration\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.definable.ai/memory/agent-integration#article\",\"headline\":\"Agent Integration\",\"name\":\"Agent Integration\",\"description\":\"How memory integrates with the agent lifecycle.\",\"url\":\"https://docs.definable.ai/memory/agent-integration\",\"mainEntityOfPage\":{\"@id\":\"https://docs.definable.ai/memory/agent-integration#webpage\"},\"dateModified\":\"2026-02-19T22:51:53.430Z\",\"publisher\":{\"@id\":\"https://docs.definable.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.definable.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Definable AI\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Definable AI\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/memory/agent-integration.md","siteName":"Definable AI","nav":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/definable-ai/definable"},{"anchor":"PyPI","icon":"cube","href":"https://pypi.org/project/definable-ai/"}]},"tabs":[{"tab":"Documentation","groups":[{"group":"Get Started","pages":[{"title":"Definable","sidebarTitle":"Introduction","mode":"wide","href":"/introduction","hidden":false},{"title":"Your First Agent","mode":"wide","href":"/first-agent","hidden":false},{"title":"Quickstart","icon":"bolt","href":"/quickstart","hidden":false},{"title":"Installation","href":"/installation","hidden":false}]},{"group":"Basics","pages":[{"group":"Agents","pages":[{"title":"What are Agents?","sidebarTitle":"Overview","mode":"wide","href":"/agents/overview","hidden":false},{"title":"Building Agents","sidebarTitle":"Building Agents","mode":"wide","href":"/agents/building-agents","hidden":false},{"title":"Running Agents","sidebarTitle":"Running Agents","icon":"play","href":"/agents/running-agents","hidden":false},{"title":"Agent Configuration","sidebarTitle":"Configuration","icon":"gear","href":"/agents/configuration","hidden":false},{"group":"Usage","pages":[{"title":"Agent with Tools","href":"/agents/usage/agent-with-tools","hidden":false},{"title":"Agent with Knowledge","href":"/agents/usage/agent-with-knowledge","hidden":false},{"title":"Agent with Memory","href":"/agents/usage/agent-with-memory","hidden":false},{"title":"Agent with Structured Output","href":"/agents/usage/agent-with-structured-output","hidden":false},{"title":"Agent with Streaming","href":"/agents/usage/agent-with-streaming","hidden":false}]}]},{"group":"Teams","pages":[{"title":"What are Teams?","sidebarTitle":"Overview","mode":"wide","href":"/teams/overview","hidden":false},{"title":"Building Teams","sidebarTitle":"Building Teams","mode":"wide","href":"/teams/building-teams","hidden":false},{"title":"Running Teams","sidebarTitle":"Running Teams","href":"/teams/running-teams","hidden":false},{"title":"Delegation","sidebarTitle":"Delegation","href":"/teams/delegation","hidden":false},{"group":"Usage","pages":[{"title":"Coordinate Team","href":"/teams/usage/coordinate-team","hidden":false},{"title":"Route Team","href":"/teams/usage/route-team","hidden":false},{"title":"Collaborate Team","href":"/teams/usage/collaborate-team","hidden":false},{"title":"Tasks Team","href":"/teams/usage/tasks-team","hidden":false}]}]},{"group":"Workflows","pages":[{"title":"What are Workflows?","sidebarTitle":"Overview","mode":"wide","href":"/workflows/overview","hidden":false},{"title":"Building Workflows","sidebarTitle":"Building Workflows","mode":"wide","href":"/workflows/building-workflows","hidden":false},{"title":"Running Workflows","sidebarTitle":"Running Workflows","href":"/workflows/running-workflows","hidden":false},{"group":"Patterns","pages":[{"title":"Sequential Workflow","sidebarTitle":"Sequential","href":"/workflows/patterns/sequential","hidden":false},{"title":"Parallel Workflow","sidebarTitle":"Parallel","href":"/workflows/patterns/parallel","hidden":false},{"title":"Conditional Workflow","sidebarTitle":"Conditional","href":"/workflows/patterns/conditional","hidden":false},{"title":"Loop Workflow","sidebarTitle":"Loop","href":"/workflows/patterns/loop","hidden":false},{"title":"Router Workflow","sidebarTitle":"Router","href":"/workflows/patterns/router","hidden":false}]},{"group":"Usage","pages":[{"title":"Basic Workflow","href":"/workflows/usage/basic-workflow","hidden":false},{"title":"Nested Workflows","href":"/workflows/usage/nested-workflows","hidden":false}]}]},{"group":"Input \u0026 Output","pages":[{"title":"Structured Output","sidebarTitle":"Structured Output","href":"/input-output/structured-output","hidden":false},{"title":"Streaming","sidebarTitle":"Streaming","href":"/input-output/streaming","hidden":false},{"title":"Multimodal Input","sidebarTitle":"Multimodal","href":"/input-output/multimodal","hidden":false}]},{"group":"Models","pages":[{"title":"What are Models?","sidebarTitle":"Overview","icon":"microchip","mode":"wide","href":"/models/overview","hidden":false},{"title":"Model as String","sidebarTitle":"String Shorthand","href":"/models/model-as-string","hidden":false},{"group":"Providers","pages":[{"title":"OpenAI","icon":"brain","href":"/models/openai","hidden":false},{"title":"Anthropic","href":"/models/anthropic","hidden":false},{"title":"Google Gemini","href":"/models/google","hidden":false},{"title":"DeepSeek","icon":"bolt","href":"/models/deepseek","hidden":false},{"title":"Mistral","href":"/models/mistral","hidden":false},{"title":"Moonshot","icon":"moon","href":"/models/moonshot","hidden":false},{"title":"xAI","icon":"magnifying-glass","href":"/models/xai","hidden":false},{"title":"Perplexity","href":"/models/perplexity","hidden":false},{"title":"Ollama","href":"/models/ollama","hidden":false},{"title":"OpenRouter","href":"/models/openrouter","hidden":false},{"title":"OpenAI-Like Providers","sidebarTitle":"OpenAI-Like","icon":"plug","href":"/models/openai-like","hidden":false}]},{"title":"Model Resilience","sidebarTitle":"Resilience","href":"/models/resilience","hidden":false},{"title":"Streaming","icon":"bars-staggered","href":"/models/streaming","hidden":false},{"title":"Structured Output","icon":"code","href":"/models/structured-output","hidden":false},{"title":"Vision \u0026 Audio","icon":"image","href":"/models/vision-and-audio","hidden":false},{"title":"Metrics \u0026 Pricing","icon":"chart-line","href":"/models/metrics-and-pricing","hidden":false}]}]},{"group":"Capabilities","pages":[{"group":"Tools","pages":[{"title":"What are Tools?","sidebarTitle":"Overview","mode":"wide","href":"/tools/overview","hidden":false},{"title":"Creating Tools","sidebarTitle":"Overview","href":"/tools/creating-tools/overview","hidden":false},{"title":"Tool Parameters","sidebarTitle":"Parameters","icon":"list","href":"/tools/creating-tools/parameters","hidden":false},{"title":"Tool Hooks","sidebarTitle":"Hooks","icon":"anchor","href":"/tools/creating-tools/hooks","hidden":false},{"title":"Tool Caching","sidebarTitle":"Caching","icon":"database","href":"/tools/creating-tools/caching","hidden":false},{"title":"Async Tools","sidebarTitle":"Async Tools","icon":"rotate","href":"/tools/creating-tools/async-tools","hidden":false},{"title":"Tool Dependencies","sidebarTitle":"Dependencies","icon":"puzzle-piece","href":"/tools/creating-tools/dependencies","hidden":false},{"group":"Toolkits","pages":[{"title":"Toolkits Overview","sidebarTitle":"Overview","icon":"toolbox","href":"/toolkits/overview","hidden":false},{"title":"KnowledgeToolkit","icon":"book","href":"/toolkits/knowledge-toolkit","hidden":false},{"title":"MCPToolkit","icon":"plug","href":"/toolkits/mcp-toolkit","hidden":false}]},{"group":"Built-in Skills","pages":[{"title":"Skills Overview","sidebarTitle":"Overview","icon":"puzzle-piece","href":"/skills/overview","hidden":false},{"title":"Built-in Skills","sidebarTitle":"Built-in Skills","icon":"toolbox","href":"/skills/built-in","hidden":false},{"title":"MacOS Skill","sidebarTitle":"MacOS","icon":"apple","href":"/skills/macos","hidden":false},{"title":"Skill Registry","sidebarTitle":"Skill Registry","icon":"book","href":"/skills/registry","hidden":false}]}]},{"group":"Knowledge \u0026 RAG","pages":[{"title":"Knowledge Overview","sidebarTitle":"Overview","icon":"book","href":"/knowledge/overview","hidden":false},{"title":"Documents","icon":"file-lines","href":"/knowledge/documents","hidden":false},{"title":"Agent Integration","sidebarTitle":"Agent Integration","icon":"robot","href":"/knowledge/agent-integration","hidden":false},{"title":"Hybrid Search \u0026 Scoring","sidebarTitle":"Hybrid Search","icon":"magnifying-glass-chart","href":"/knowledge/hybrid-search","hidden":false},{"group":"Pipeline","pages":[{"title":"Readers","icon":"file-import","href":"/knowledge/pipeline/readers","hidden":false},{"title":"Chunkers","icon":"scissors","href":"/knowledge/pipeline/chunkers","hidden":false},{"title":"Embedders","icon":"vector-square","href":"/knowledge/pipeline/embedders","hidden":false},{"title":"Rerankers","icon":"ranking-star","href":"/knowledge/pipeline/rerankers","hidden":false},{"title":"Vector Databases","sidebarTitle":"Vector Databases","icon":"database","href":"/knowledge/pipeline/vector-databases","hidden":false}]},{"group":"Usage","pages":[{"title":"Basic RAG","href":"/knowledge/usage/basic-rag","hidden":false},{"title":"Hybrid Search","href":"/knowledge/usage/hybrid-search-example","hidden":false}]}]},{"group":"Memory","pages":[{"title":"Memory Overview","sidebarTitle":"Overview","icon":"brain","href":"/memory/overview","hidden":false},{"title":"Memory Stores","sidebarTitle":"Stores","description":"Storage backends for session conversation memory.","icon":"database","href":"/memory/stores","hidden":false},{"title":"Agent Integration","sidebarTitle":"Agent Integration","icon":"link","href":"/memory/agent-integration","hidden":false}]},{"group":"Reasoning","pages":[{"title":"Thinking","sidebarTitle":"Thinking","description":"Add a reasoning phase before the agent generates responses.","href":"/reasoning/thinking","hidden":false},{"title":"Deep Research","sidebarTitle":"Deep Research","href":"/reasoning/deep-research","hidden":false}]},{"group":"MCP","pages":[{"title":"MCP Overview","sidebarTitle":"Overview","icon":"plug","href":"/mcp/overview","hidden":false},{"title":"Getting Started with MCP","sidebarTitle":"Getting Started","icon":"rocket","href":"/mcp/getting-started","hidden":false},{"title":"MCP Configuration","sidebarTitle":"Configuration","icon":"gear","href":"/mcp/configuration","hidden":false},{"title":"MCP Resources","sidebarTitle":"Resources","icon":"folder-open","href":"/mcp/resources","hidden":false},{"title":"MCP Prompts","sidebarTitle":"Prompts","icon":"message","href":"/mcp/prompts","hidden":false},{"title":"MCP Error Handling","sidebarTitle":"Error Handling","icon":"triangle-exclamation","href":"/mcp/error-handling","hidden":false},{"title":"Mock MCP Servers","sidebarTitle":"Mock Servers","icon":"flask-vial","href":"/mcp/mock-servers","hidden":false}]},{"group":"Readers","pages":[{"title":"File Readers","sidebarTitle":"Overview","icon":"file-lines","href":"/readers/overview","hidden":false}]},{"group":"Browser","pages":[{"title":"Browser Toolkit","sidebarTitle":"Overview","icon":"globe","href":"/browser/overview","hidden":false}]},{"group":"Tracing","pages":[{"title":"Tracing","icon":"chart-gantt","href":"/agents/tracing","hidden":false}]},{"group":"Evaluation","pages":[{"title":"Evaluation","sidebarTitle":"Evaluation","icon":"chart-bar","href":"/agents/evaluation","hidden":false}]}]},{"group":"Advanced","pages":[{"group":"Interfaces","pages":[{"title":"Interfaces Overview","sidebarTitle":"Overview","icon":"message-bot","href":"/interfaces/overview","hidden":false},{"group":"Platforms","pages":[{"title":"Telegram","icon":"paper-plane","href":"/interfaces/telegram","hidden":false},{"title":"Discord","icon":"discord","href":"/interfaces/discord","hidden":false},{"title":"Slack","icon":"slack","href":"/interfaces/slack","hidden":false},{"title":"WebSocket","sidebarTitle":"WebSocket","href":"/interfaces/websocket","hidden":false},{"title":"WhatsApp","sidebarTitle":"WhatsApp","icon":"comment-dots","href":"/interfaces/whatsapp"},{"title":"Email","sidebarTitle":"Email","href":"/interfaces/email","hidden":false},{"title":"Call (Voice)","icon":"phone","href":"/interfaces/call","hidden":false},{"title":"Custom Interfaces","sidebarTitle":"Custom Interfaces","icon":"code","href":"/interfaces/custom-interfaces","hidden":false}]},{"group":"Usage","pages":[{"title":"Telegram Bot","href":"/interfaces/usage/telegram-bot","hidden":false},{"title":"Discord Bot","href":"/interfaces/usage/discord-bot","hidden":false},{"title":"Slack Bot","href":"/interfaces/usage/slack-bot","hidden":false},{"title":"Multi-Platform Agent","href":"/interfaces/usage/multi-platform","hidden":false}]},{"title":"Sessions","icon":"clock-rotate-left","href":"/interfaces/sessions","hidden":false},{"title":"Interface Hooks","sidebarTitle":"Hooks","icon":"anchor","href":"/interfaces/hooks","hidden":false},{"title":"Identity Resolution","sidebarTitle":"Identity","icon":"fingerprint","href":"/interfaces/identity","hidden":false},{"title":"Multi-Interface Serving","sidebarTitle":"Multi-Interface","icon":"server","href":"/interfaces/multi-interface","hidden":false}]},{"group":"Security","pages":[{"title":"Security","sidebarTitle":"Security","icon":"shield-halved","href":"/agents/security","hidden":false}]},{"group":"Guardrails","pages":[{"title":"Guardrails Overview","sidebarTitle":"Overview","icon":"shield","href":"/guardrails/overview","hidden":false}]},{"group":"Plugins","pages":[{"title":"Plugins","sidebarTitle":"Plugins","href":"/agents/plugins","hidden":false}]},{"group":"Scheduling","pages":[{"title":"Scheduling","sidebarTitle":"Scheduling","href":"/agents/scheduling","hidden":false}]},{"title":"Middleware","icon":"layer-group","href":"/agents/middleware","hidden":false},{"title":"Multi-Turn Conversations","sidebarTitle":"Multi-Turn","icon":"comments","href":"/agents/multi-turn","hidden":false},{"title":"Agentic Loop","sidebarTitle":"Agentic Loop","icon":"rotate","href":"/agents/agentic-loop","hidden":false},{"title":"Testing","icon":"flask-vial","href":"/agents/testing","hidden":false},{"title":"Authentication","sidebarTitle":"Authentication","icon":"lock","href":"/agents/auth","hidden":false},{"title":"Agent Runtime","sidebarTitle":"Runtime","icon":"server","href":"/agents/runtime","hidden":false},{"title":"Error Handling","icon":"shield","href":"/advanced/error-handling","hidden":false},{"title":"Cost Tracking","icon":"dollar-sign","href":"/advanced/cost-tracking","hidden":false},{"title":"Run Output \u0026 Events","sidebarTitle":"Run Output","icon":"square-poll-vertical","href":"/advanced/run-output","hidden":false},{"title":"Media Types","icon":"photo-film","href":"/advanced/media-types","hidden":false},{"title":"Replay Overview","sidebarTitle":"Overview","icon":"rotate","href":"/replay/overview","hidden":false},{"title":"Observability Dashboard","sidebarTitle":"Overview","icon":"chart-line","href":"/observability/overview","hidden":false},{"title":"Claude Code Agent","href":"/claude-code/overview","hidden":false}]}]},{"tab":"Examples","pages":[{"title":"Examples","href":"/examples/overview"}]},{"tab":"Reference","pages":[{"title":"Reference","href":"/reference/agents/agent"}]}]},"basePath":"","title":"Agent Integration - Definable AI","deploymentId":"dpl_BLZw3QngerHodH9E8mGgC4v752y3","buildId":"dpl_BLZw3QngerHodH9E8mGgC4v752y3","dynamics":[],"chunks":[]}