...
To access identity information inside of your agent routines, you must use session data. For instance, to access the user name inside of a routine, you will refer to it as follows: pjs.session.identity.name
. This can then be used to limit data that the agent can retrieve or process.
...
JWT tokens can be retrieved from client-side storage mechanisms like localStore, sessionStorage, cookies, or JavaScript variables. The Deploy this Agent Dialog in the Profound AI IDE helps construct the appropriate client-side code based on the setup of your agent.
...
If the token is wrapped in an arrow function like above, the agent will re-evaluate it with every interaction. This means within a Single Page Application, the user can log in or out and the agent will automatically recognize the new effective user without having to restart the conversation.