[{"data":1,"prerenderedAt":391},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fv2\u002Fagent":3},{"id":4,"title":5,"body":6,"description":16,"extension":384,"meta":385,"navigation":386,"path":387,"seo":388,"stem":389,"__hash__":390},"docs\u002Fdocs\u002Fv2\u002Fagent\u002Findex.md","Agent",{"type":7,"value":8,"toc":378},"minimark",[9,13,17,20,25,59,66,84,87,217,221,229,242,255,264,273,285,294,303,307,331,338,342,356,365,374],[10,11,5],"h1",{"id":12},"agent",[14,15,16],"p",{},"An agent is a TypeScript project with a shape Axon knows how to read. You author four\nthings: identity, tools, scripts, and policy. The loop, context assembly, tool dispatch,\nsession persistence, stop conditions — you write none of it.",[14,18,19],{},"Boot it in the TUI on your laptop, run it headless in CI, deploy it as a live cloud\nservice with a public URL and API key. The folder is the same in every case.",[21,22,24],"h2",{"id":23},"create-one","Create one",[26,27,32],"pre",{"className":28,"code":29,"language":30,"meta":31,"style":31},"language-bash shiki shiki-themes dark-plus","axon init my-agent\ncd my-agent\n","bash","",[33,34,35,51],"code",{"__ignoreMap":31},[36,37,40,44,48],"span",{"class":38,"line":39},"line",1,[36,41,43],{"class":42},"sCudf","axon",[36,45,47],{"class":46},"sKc5r"," init",[36,49,50],{"class":46}," my-agent\n",[36,52,54,57],{"class":38,"line":53},2,[36,55,56],{"class":42},"cd",[36,58,50],{"class":46},[14,60,61,62,65],{},"That scaffolds the project, installs the framework, and generates its types — you can\nopen ",[33,63,64],{},"src\u002Fboot.vue"," and start writing immediately.",[14,67,68,69,72,73,76,77,76,80,83],{},"Agents are the default project kind, so this is ",[33,70,71],{},"axon init"," with no noun in the middle.\nEvery other kind names itself: ",[33,74,75],{},"axon module init",", ",[33,78,79],{},"axon cognet init",[33,81,82],{},"axon bench init",".",[14,85,86],{},"Here's what you get:",[26,88,90],{"className":28,"code":89,"language":30,"meta":31,"style":31},"my-agent\u002F\n├── data\u002F            # durable storage and knowledge\n├── modules\u002F         # installed capabilities\n├── server\u002F          # HTTP routes, plugins (optional)\n├── src\u002F\n│   ├── prompts\u002F     # context it can load\n│   ├── scripts\u002F     # how work is orchestrated\n│   ├── tools\u002F       # what it can do\n│   └── boot.vue     # who the agent is\n├── tests\u002F           # boot test to prove it runs\n└── axon.config.ts   # engine, policy, environment\n",[33,91,92,97,109,120,131,139,154,167,180,194,205],{"__ignoreMap":31},[36,93,94],{"class":38,"line":39},[36,95,96],{"class":42},"my-agent\u002F\n",[36,98,99,102,105],{"class":38,"line":53},[36,100,101],{"class":42},"├──",[36,103,104],{"class":46}," data\u002F",[36,106,108],{"class":107},"sOLPB","            # durable storage and knowledge\n",[36,110,112,114,117],{"class":38,"line":111},3,[36,113,101],{"class":42},[36,115,116],{"class":46}," modules\u002F",[36,118,119],{"class":107},"         # installed capabilities\n",[36,121,123,125,128],{"class":38,"line":122},4,[36,124,101],{"class":42},[36,126,127],{"class":46}," server\u002F",[36,129,130],{"class":107},"          # HTTP routes, plugins (optional)\n",[36,132,134,136],{"class":38,"line":133},5,[36,135,101],{"class":42},[36,137,138],{"class":46}," src\u002F\n",[36,140,142,145,148,151],{"class":38,"line":141},6,[36,143,144],{"class":42},"│",[36,146,147],{"class":46},"   ├──",[36,149,150],{"class":46}," prompts\u002F",[36,152,153],{"class":107},"     # context it can load\n",[36,155,157,159,161,164],{"class":38,"line":156},7,[36,158,144],{"class":42},[36,160,147],{"class":46},[36,162,163],{"class":46}," scripts\u002F",[36,165,166],{"class":107},"     # how work is orchestrated\n",[36,168,170,172,174,177],{"class":38,"line":169},8,[36,171,144],{"class":42},[36,173,147],{"class":46},[36,175,176],{"class":46}," tools\u002F",[36,178,179],{"class":107},"       # what it can do\n",[36,181,183,185,188,191],{"class":38,"line":182},9,[36,184,144],{"class":42},[36,186,187],{"class":46},"   └──",[36,189,190],{"class":46}," boot.vue",[36,192,193],{"class":107},"     # who the agent is\n",[36,195,197,199,202],{"class":38,"line":196},10,[36,198,101],{"class":42},[36,200,201],{"class":46}," tests\u002F",[36,203,204],{"class":107},"           # boot test to prove it runs\n",[36,206,208,211,214],{"class":38,"line":207},11,[36,209,210],{"class":42},"└──",[36,212,213],{"class":46}," axon.config.ts",[36,215,216],{"class":107},"   # engine, policy, environment\n",[21,218,220],{"id":219},"the-build-journey","The build journey",[14,222,223,224,228],{},"The ",[225,226,227],"strong",{},"Build"," section walks the authoring surface in the order you'll actually use it:",[14,230,231,238,239,241],{},[225,232,233],{},[234,235,237],"a",{"href":236},"\u002Fdocs\u002Fv2\u002Fagent\u002Fbuild\u002Fidentity","Identity"," — ",[33,240,64],{}," is the standing system\nprompt. Edit it, save, and the running agent hot-reloads in ~40ms. This is where the\nagent gets its character.",[14,243,244,250,251,254],{},[225,245,246],{},[234,247,249],{"href":248},"\u002Fdocs\u002Fv2\u002Fagent\u002Fbuild\u002Ftools","Tools"," — export a function from ",[33,252,253],{},"src\u002Ftools\u002F"," and the\nagent can call it. Signatures and JSDoc become the model's documentation. No registration,\nno schemas.",[14,256,257,263],{},[225,258,259],{},[234,260,262],{"href":261},"\u002Fdocs\u002Fv2\u002Fagent\u002Fbuild\u002Fscripts","Scripts"," — TypeScript files that orchestrate work:\nload context, call the agent, process results. One script runs identically from the\nterminal, the TUI, an HTTP route, or another script.",[14,265,266,272],{},[225,267,268],{},[234,269,271],{"href":270},"\u002Fdocs\u002Fv2\u002Fagent\u002Fbuild\u002Fthreads","Threads"," — isolated contexts for structuring\nmulti-step work. Side threads for noisy research, parallel branches for independent\ntasks, named threads that persist across runs.",[14,274,275,238,281,284],{},[225,276,277],{},[234,278,280],{"href":279},"\u002Fdocs\u002Fv2\u002Fconcepts\u002Fevents-and-inbox","Routes & Hooks",[33,282,283],{},"server\u002Fapi\u002F"," makes the agent\naddressable; hooks let it react when the outside world does something. This is how an\nagent becomes a service instead of a session.",[14,286,287,293],{},[225,288,289],{},[234,290,292],{"href":291},"\u002Fdocs\u002Fv2\u002Fagent\u002Fpolicy","Policy"," — declare what the agent may read, write, run, and\nreach. Enforced structurally on every call, before the function runs. Not a prompt hint.",[14,295,296,302],{},[225,297,298],{},[234,299,301],{"href":300},"\u002Fdocs\u002Fv2\u002Fagent\u002Ftesting","Testing"," — boot the full runtime with a deterministic mock\nengine. Test tools, prompts, and hook flows — the parts with correct answers.",[21,304,306],{"id":305},"capabilities-you-dont-write","Capabilities you don't write",[26,308,310],{"className":28,"code":309,"language":30,"meta":31,"style":31},"axon install @axon\u002Fgithub\naxon install @axon\u002Flinear\n",[33,311,312,322],{"__ignoreMap":31},[36,313,314,316,319],{"class":38,"line":39},[36,315,43],{"class":42},[36,317,318],{"class":46}," install",[36,320,321],{"class":46}," @axon\u002Fgithub\n",[36,323,324,326,328],{"class":38,"line":53},[36,325,43],{"class":42},[36,327,318],{"class":46},[36,329,330],{"class":46}," @axon\u002Flinear\n",[14,332,333,334,83],{},"Modules contribute typed tools, prompts, webhook routes, and boot-time setup. The\nintegration work is already done. See ",[234,335,337],{"href":336},"\u002Fdocs\u002Fv2\u002Fmodules\u002Foverview","Modules",[21,339,341],{"id":340},"when-something-surprises-you","When something surprises you",[14,343,344,350,351,355],{},[225,345,346],{},[234,347,349],{"href":348},"\u002Fdocs\u002Fv2\u002Fagent\u002Fmanaged-runtime","Understand"," holds the mental models — what the\nruntime owns, how state and memory work, what the kernel enforces. Reach for it when\nyou want to know ",[352,353,354],"em",{},"why"," the agent behaved the way it did.",[14,357,358,364],{},[225,359,360],{},[234,361,363],{"href":362},"\u002Fdocs\u002Fv2\u002Fagent\u002Ffolder","Agent Structure"," is the folder reference — every file, what\nit does, what Axon does with it.",[14,366,367,373],{},[225,368,369],{},[234,370,372],{"href":371},"\u002Fdocs\u002Fv2\u002Fconcepts\u002Fruntime-loop","Internals"," is how it actually works under the hood. None\nof it is required reading — that's the point of the platform.",[375,376,377],"style",{},"html pre.shiki code .sCudf, html code.shiki .sCudf{--shiki-default:#DCDCAA}html pre.shiki code .sKc5r, html code.shiki .sKc5r{--shiki-default:#CE9178}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 pre.shiki code .sOLPB, html code.shiki .sOLPB{--shiki-default:#6A9955}",{"title":31,"searchDepth":53,"depth":53,"links":379},[380,381,382,383],{"id":23,"depth":53,"text":24},{"id":219,"depth":53,"text":220},{"id":305,"depth":53,"text":306},{"id":340,"depth":53,"text":341},"md",{},true,"\u002Fdocs\u002Fv2\u002Fagent",{"title":5,"description":16},"docs\u002Fv2\u002Fagent\u002Findex","gZGz6-4N5JCk6IgPrqLIHvbSQeyEMPNSBaUrReqr0ak",1785671806603]