Skip to main content
StateBase allows you to perform Set Operations on context contexts.

Union (Merge)

Combine User Context + Global Company Context.
user_ctx = sb.context.get(user_id="user_123")
corp_ctx = sb.context.get(org_id="corp_abc")

full_context = user_ctx + corp_ctx

Intersection (Commonality)

Find shared knowledge between two users.
shared_context = ctx_user_a & ctx_user_b

Subtraction (Privacy)

Remove sensitive PII from a context before sending to LLM.
safe_context = full_context - sensitive_topics