Patterns.
Recipes for using user_id and search_user_id
together. These are patterns you implement in your app —
they're not modes you configure in AgentLoop. The two fields are
independent; mix and match based on how you want logging and
retrieval to behave for your users.
Per-user personalization
agentloop={ "user_id": user.id, "search_user_id": user.id, # retrieval scoped to this user }
This partitions end-users within your AgentLoop org. Separation
between different AgentLoop customers (orgs) is already enforced
at the database level via org_id — you don't need
to do anything for that.
Admin reviewing a user's session
agentloop={ "user_id": admin.id, # audit: this came from the admin "search_user_id": user.id, # context: what would the user see "tags": ["admin_review"], }
Workspace memory with per-seat audit
agentloop={ "user_id": user.id, # who clicked "search_user_id": workspace.id, # what knowledge to draw on }
If you can't articulate why user_id and
search_user_id should differ, leave
search_user_id off. The default (log-tagged, org-wide
retrieval) is what most apps want, and it's the only mode where
new users benefit from the corrections existing users have already
made.