Skip to main content

require_scope

Function
This function is defined in the protocols module.
Enforce that at least one scope identifier is provided. Shared helper so every knowledge adapter enforces the same tenant-scope contract (mem0 already did via its own _check_scope). Without this, an unscoped call that raises ScopeRequiredError on the mem0 backend would silently return or wipe every tenant’s data on the Chroma/SQLite backends — a data-loss/leak hazard depending purely on which backend is installed.

Signature

Parameters

Any
required
No description available.
Any
required
No description available.
Any
required
No description available.
str
default:"'operation'"
No description available.
str
No description available.

Exceptions

If none of user_id/agent_id/run_id is provided.

Uses

  • ScopeRequiredError

Source

View on GitHub

praisonaiagents/knowledge/protocols.py at line 202