@agentium/harness history and leases, use harness conversations.
Continue a chat
Use the Agent conversation pattern with a stable, owner-scoped session ID and configured storage. Verify a follow-up can reference the earlier order number.InMemoryStorage is process-local; select a persistent storage adapter when restart persistence is required.
Remember an explicit preference across sessions
Host function: pass a configured model. This example deliberately records a known preference for one fictional user, then asks about it in a new session. It owns the Agent and in-memory store. Live model calls still need provider credentials.agent.memory.awaitExtractions() after verifying memory exists, then inspect the store. Do not promise that every user statement becomes a correct durable fact.
Choose a memory feature
fileMemory: true does not by itself establish disk persistence. Vector-backed memory also requires an embedding provider and store; an in-memory index can still invoke a paid embedding API.
Preserve the ownership boundary
Your host verifies identity, binds sessions to owners, scopes backing stores, and decides which learnings may be shared. User IDs supplied by a request body are not trusted identity. A shared storage client does not automatically partition every record by tenant. For Teams, configure memory on each member Agent.TeamConfig.memory does not initialize member memory in v4. Member histories are distinct from an automatically shared Team transcript; see Team patterns.