Skip to main content
Capsule gives you two common state layers before you add any external storage system:
  • session.data for lightweight per-session state
  • collections for durable queryable records
Use the smallest layer that fits the job.

1. Store session state

session.data is useful for conversation-local memory.
Use it for preferences, last selections, short-lived workflow state, and other values that belong to one conversation.

2. Declare a collection

Collections hold durable records.
scope="owner" keeps records scoped to the current owner identity. That is usually what you want for user-owned app data.

3. Write records from chat

4. Read records back

5. Expose data to pages

Pages use named data handlers when they need computed JSON.
You can bind that data to a page in the next guide.

Next steps