AI Memory
Updated
Where the agent’s memory is kept.
- Type
comp-ai-memory- Script class
AIMemoryComponent- Per entity
- One
- Version
- 1.0.0
Read about it in Translation and memory: what it does, how to use it from a script, and examples.
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
A guide that remembersAn AI Memory names the record that keeps the guide's memory between visits: a UI Switch turns it on and off, and the agent's memory activity events update a label.
Flip Remember me: the label shows whether the guide keeps a memory, and in which record. Reading and writing memory happen during replies, which need the AI service; this preview does not have it, so a message you send shows a short error instead. Drag outside the panels to orbit the camera.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(AIMemoryComponent); if (component) log(component.props);}