[{"data":1,"prerenderedAt":481},["ShallowReactive",2],{"docs-navigation":3,"docs-page-\u002Fdocs\u002Ffundamentals\u002Fcontext-cache":149,"docs-surround-\u002Fdocs\u002Ffundamentals\u002Fcontext-cache":478},[4],{"title":5,"path":6,"stem":7,"children":8,"page":148},"Docs","\u002Fdocs","docs",[9,36,75,94,129],{"title":10,"path":11,"stem":12,"children":13},"GET STARTED","\u002Fdocs\u002Fget-started","docs\u002F1.get-started\u002F1.index",[14,16,20,24,28,32],{"title":15,"path":11,"stem":12},"Welcome",{"title":17,"path":18,"stem":19},"Quickstart","\u002Fdocs\u002Fget-started\u002Fquickstart","docs\u002F1.get-started\u002F2.quickstart",{"title":21,"path":22,"stem":23},"API","\u002Fdocs\u002Fget-started\u002Fapi","docs\u002F1.get-started\u002F3.api",{"title":25,"path":26,"stem":27},"SDKs and CLI","\u002Fdocs\u002Fget-started\u002Fsdks-cli","docs\u002F1.get-started\u002F4.sdks-cli",{"title":29,"path":30,"stem":31},"Sandbox testing","\u002Fdocs\u002Fget-started\u002Flocal-development","docs\u002F1.get-started\u002F5.local-development",{"title":33,"path":34,"stem":35},"Authentication","\u002Fdocs\u002Fget-started\u002Fauthentication","docs\u002F1.get-started\u002F6.authentication",{"title":37,"path":38,"stem":39,"children":40},"FUNDAMENTALS","\u002Fdocs\u002Ffundamentals","docs\u002F2.fundamentals\u002F1.index",[41,43,47,51,55,59,63,67,71],{"title":42,"path":38,"stem":39},"Fundamentals",{"title":44,"path":45,"stem":46},"Architecture","\u002Fdocs\u002Ffundamentals\u002Farchitecture","docs\u002F2.fundamentals\u002F2.architecture",{"title":48,"path":49,"stem":50},"Memory model","\u002Fdocs\u002Ffundamentals\u002Fmemory-model","docs\u002F2.fundamentals\u002F3.memory-model",{"title":52,"path":53,"stem":54},"Compression","\u002Fdocs\u002Ffundamentals\u002Fcompression","docs\u002F2.fundamentals\u002F4.compression",{"title":56,"path":57,"stem":58},"RAG and cached context","\u002Fdocs\u002Ffundamentals\u002Frag-cag","docs\u002F2.fundamentals\u002F5.rag-cag",{"title":60,"path":61,"stem":62},"Context cache","\u002Fdocs\u002Ffundamentals\u002Fcontext-cache","docs\u002F2.fundamentals\u002F6.context-cache",{"title":64,"path":65,"stem":66},"Security","\u002Fdocs\u002Ffundamentals\u002Fsecurity","docs\u002F2.fundamentals\u002F7.security",{"title":68,"path":69,"stem":70},"Languages","\u002Fdocs\u002Ffundamentals\u002Flanguages","docs\u002F2.fundamentals\u002F8.languages",{"title":72,"path":73,"stem":74},"UI patterns","\u002Fdocs\u002Ffundamentals\u002Fui","docs\u002F2.fundamentals\u002F9.ui",{"title":76,"path":77,"stem":78,"children":79},"AGENTS","\u002Fdocs\u002Fagents","docs\u002F3.agents\u002F1.index",[80,82,86,90],{"title":81,"path":77,"stem":78},"Agents",{"title":83,"path":84,"stem":85},"Agent skills","\u002Fdocs\u002Fagents\u002Fagent-skills","docs\u002F3.agents\u002F2.agent-skills",{"title":87,"path":88,"stem":89},"Admin UI prompt","\u002Fdocs\u002Fagents\u002Fadmin-ui-prompt","docs\u002F3.agents\u002F3.admin-ui-prompt",{"title":91,"path":92,"stem":93},"Codex Code Nucleus","\u002Fdocs\u002Fagents\u002Fcodex-code-nucleus","docs\u002F3.agents\u002F4.codex-code-nucleus",{"title":95,"path":96,"stem":97,"children":98},"PROVIDERS","\u002Fdocs\u002Fproviders","docs\u002F4.providers\u002F1.index",[99,101,105,109,113,117,121,125],{"title":100,"path":96,"stem":97},"Providers",{"title":102,"path":103,"stem":104},"OpenAI and Azure OpenAI","\u002Fdocs\u002Fproviders\u002Fopenai","docs\u002F4.providers\u002F2.openai",{"title":106,"path":107,"stem":108},"Anthropic Claude","\u002Fdocs\u002Fproviders\u002Fanthropic","docs\u002F4.providers\u002F3.anthropic",{"title":110,"path":111,"stem":112},"Google Gemini and Vertex AI","\u002Fdocs\u002Fproviders\u002Fgoogle-gemini","docs\u002F4.providers\u002F4.google-gemini",{"title":114,"path":115,"stem":116},"OpenAI-compatible providers","\u002Fdocs\u002Fproviders\u002Fopenai-compatible","docs\u002F4.providers\u002F5.openai-compatible",{"title":118,"path":119,"stem":120},"Groq","\u002Fdocs\u002Fproviders\u002Fgroq","docs\u002F4.providers\u002F6.groq",{"title":122,"path":123,"stem":124},"Cohere","\u002Fdocs\u002Fproviders\u002Fcohere","docs\u002F4.providers\u002F7.cohere",{"title":126,"path":127,"stem":128},"Amazon Bedrock","\u002Fdocs\u002Fproviders\u002Famazon-bedrock","docs\u002F4.providers\u002F8.amazon-bedrock",{"title":130,"path":131,"stem":132,"children":133},"CHANGELOG","\u002Fdocs\u002Fchangelog","docs\u002F5.changelog\u002F1.index",[134,136,140,144],{"title":135,"path":131,"stem":132},"Changelog",{"title":137,"path":138,"stem":139},"Roadmap","\u002Fdocs\u002Fchangelog\u002Froadmap","docs\u002F5.changelog\u002F2.roadmap",{"title":141,"path":142,"stem":143},"Release notes","\u002Fdocs\u002Fchangelog\u002Frelease-runbook","docs\u002F5.changelog\u002F3.release-runbook",{"title":145,"path":146,"stem":147},"Testing","\u002Fdocs\u002Fchangelog\u002Ftesting","docs\u002F5.changelog\u002F4.testing",false,{"id":150,"title":60,"body":151,"description":472,"extension":473,"meta":474,"navigation":475,"path":61,"seo":476,"stem":62,"__hash__":477},"docs\u002Fdocs\u002F2.fundamentals\u002F6.context-cache.md",{"type":152,"value":153,"toc":466},"minimark",[154,159,163,168,359,363,433,437,440,444,462],[155,156,158],"h1",{"id":157},"context-cache","Context Cache",[160,161,162],"p",{},"The context cache stores reusable agent context packs for repeated tasks. It is designed for speed and consistency while keeping your application in control of which scopes and tasks are eligible.",[164,165,167],"h2",{"id":166},"cache-request","Cache Request",[169,170,175],"pre",{"className":171,"code":172,"language":173,"meta":174,"style":174},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","const context_pack = await client.agentContext({\n  scopeIds: [process.env.NEUTRON_SCOPE_ID!],\n  agentId: \"agent_docs\",\n  task: \"Answer an integration question\",\n  cachePolicy: {\n    mode: \"prefer_cache\",\n    keyMode: \"intent_profile\",\n    ttlSeconds: 600\n  }\n});\n","ts","",[176,177,178,215,247,267,284,295,312,329,341,347],"code",{"__ignoreMap":174},[179,180,183,187,191,195,199,202,205,209,212],"span",{"class":181,"line":182},"line",1,[179,184,186],{"class":185},"spNyl","const",[179,188,190],{"class":189},"sTEyZ"," context_pack ",[179,192,194],{"class":193},"sMK4o","=",[179,196,198],{"class":197},"s7zQu"," await",[179,200,201],{"class":189}," client",[179,203,204],{"class":193},".",[179,206,208],{"class":207},"s2Zo4","agentContext",[179,210,211],{"class":189},"(",[179,213,214],{"class":193},"{\n",[179,216,218,222,225,228,230,233,235,238,241,244],{"class":181,"line":217},2,[179,219,221],{"class":220},"swJcz","  scopeIds",[179,223,224],{"class":193},":",[179,226,227],{"class":189}," [process",[179,229,204],{"class":193},[179,231,232],{"class":189},"env",[179,234,204],{"class":193},[179,236,237],{"class":189},"NEUTRON_SCOPE_ID",[179,239,240],{"class":193},"!",[179,242,243],{"class":189},"]",[179,245,246],{"class":193},",\n",[179,248,250,253,255,258,262,265],{"class":181,"line":249},3,[179,251,252],{"class":220},"  agentId",[179,254,224],{"class":193},[179,256,257],{"class":193}," \"",[179,259,261],{"class":260},"sfazB","agent_docs",[179,263,264],{"class":193},"\"",[179,266,246],{"class":193},[179,268,270,273,275,277,280,282],{"class":181,"line":269},4,[179,271,272],{"class":220},"  task",[179,274,224],{"class":193},[179,276,257],{"class":193},[179,278,279],{"class":260},"Answer an integration question",[179,281,264],{"class":193},[179,283,246],{"class":193},[179,285,287,290,292],{"class":181,"line":286},5,[179,288,289],{"class":220},"  cachePolicy",[179,291,224],{"class":193},[179,293,294],{"class":193}," {\n",[179,296,298,301,303,305,308,310],{"class":181,"line":297},6,[179,299,300],{"class":220},"    mode",[179,302,224],{"class":193},[179,304,257],{"class":193},[179,306,307],{"class":260},"prefer_cache",[179,309,264],{"class":193},[179,311,246],{"class":193},[179,313,315,318,320,322,325,327],{"class":181,"line":314},7,[179,316,317],{"class":220},"    keyMode",[179,319,224],{"class":193},[179,321,257],{"class":193},[179,323,324],{"class":260},"intent_profile",[179,326,264],{"class":193},[179,328,246],{"class":193},[179,330,332,335,337],{"class":181,"line":331},8,[179,333,334],{"class":220},"    ttlSeconds",[179,336,224],{"class":193},[179,338,340],{"class":339},"sbssI"," 600\n",[179,342,344],{"class":181,"line":343},9,[179,345,346],{"class":193},"  }\n",[179,348,350,353,356],{"class":181,"line":349},10,[179,351,352],{"class":193},"}",[179,354,355],{"class":189},")",[179,357,358],{"class":193},";\n",[164,360,362],{"id":361},"cache-fields","Cache Fields",[364,365,366,379],"table",{},[367,368,369],"thead",{},[370,371,372,376],"tr",{},[373,374,375],"th",{},"Field",[373,377,378],{},"Purpose",[380,381,382,393,403,413,423],"tbody",{},[370,383,384,390],{},[385,386,387],"td",{},[176,388,389],{},"mode",[385,391,392],{},"Controls whether to use, bypass, or refresh cached context.",[370,394,395,400],{},[385,396,397],{},[176,398,399],{},"keyMode",[385,401,402],{},"Controls how similar tasks are grouped for reuse.",[370,404,405,410],{},[385,406,407],{},[176,408,409],{},"ttlSeconds",[385,411,412],{},"Limits how long a cached context pack can be reused.",[370,414,415,420],{},[385,416,417],{},[176,418,419],{},"scopeIds",[385,421,422],{},"Ensures cache entries stay separated by tenant and scope.",[370,424,425,430],{},[385,426,427],{},[176,428,429],{},"agentId",[385,431,432],{},"Keeps context packs specific to an agent’s purpose.",[164,434,436],{"id":435},"freshness","Freshness",[160,438,439],{},"Cached context is best for stable, repeated workflows. Use shorter TTLs for fast-moving data and bypass the cache for sensitive or high-risk actions.",[164,441,443],{"id":442},"observability","Observability",[160,445,446,447,450,451,450,454,457,458,461],{},"SDK and API responses can include cache status fields such as ",[176,448,449],{},"hit",", ",[176,452,453],{},"miss",[176,455,456],{},"stale",", or ",[176,459,460],{},"bypassed",". Use these fields to track latency, context reuse, and task quality in your own telemetry.",[463,464,465],"style",{},"html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":174,"searchDepth":217,"depth":217,"links":467},[468,469,470,471],{"id":166,"depth":217,"text":167},{"id":361,"depth":217,"text":362},{"id":435,"depth":217,"text":436},{"id":442,"depth":217,"text":443},"Public cache controls for repeated agent tasks.","md",{},true,{"title":60,"description":472},"gA_ogqS_7j5bZE0g3I4NC0bsmdMLjg8Thm0fjgXNq20",[479,480],{"title":56,"path":57,"stem":58,"children":-1},{"title":64,"path":65,"stem":66,"children":-1},1784317984168]