Memory (RAG)
The UE plugin exposes two memory layers:
- remote NPC memory backed by the Forboc API
- local node-backed memory backed by SQLite plus local embeddings
This matches the split between packages/core and packages/node.
During processNPC(...), the API can request memory recall or memory storage. If the runtime does not have local memory configured and the API asks for those steps, the protocol fails fast.
Memory Item Shape
Local Node Memory
Use local memory when you want the UE runtime to satisfy protocol recall/store instructions directly.
initNodeMemoryThunk(DatabasePath) tracks the active database path, and clearNodeMemoryThunk() clears that same resolved path. Custom database locations are supported.
Remote NPC Memory
Use the remote thunks when you want the API-backed per-NPC memory endpoints.
Slice State
MemorySlice tracks:
- entity-backed memory items
StorageStatusRecallStatusErrorLastRecalledIds
Useful selectors:
MemorySlice::SelectAllMemories(State)MemorySlice::SelectLastRecalledMemories(State)MemorySlice::SelectMemoryById(State, Id)
Direct Thunks
For parity with the TypeScript SDKs, dispatch:
rtk::initNodeMemoryThunk(DatabasePath)rtk::storeNodeMemoryThunk(Text, Type, Importance)rtk::recallNodeMemoryThunk(Query, Limit, Threshold)rtk::clearNodeMemoryThunk()rtk::listMemoryRemoteThunk(NpcId)rtk::recallMemoryRemoteThunk(NpcId, Query, Similarity)rtk::storeMemoryRemoteThunk(NpcId, Observation, Importance)rtk::clearMemoryRemoteThunk(NpcId)
