The OMP Python SDK raises typed exceptions so you can write consistent error-handling logic regardless of which provider is underneath. All exceptions inherit fromDocumentation Index
Fetch the complete documentation index at: https://docs.openmem.blog/llms.txt
Use this file to discover all available pages before exploring further.
OMPError, carry a standard code, type, provider, and request_id, and mirror the error envelope that the OMP HTTP API returns on failure.
Import
Error hierarchy
All exceptions extendOMPError(Exception). Each subclass maps to a specific error.code value in the OMP wire format.
| Exception class | error.code | error.type | When raised |
|---|---|---|---|
UnauthorizedError | unauthorized | auth | Missing or invalid credentials |
ScopeDeniedError | scope_denied | auth | App lacks the required scope permission |
NotFoundError | not_found | not_found | Memory ID does not exist |
InvalidRequestError | invalid_request | invalid | Malformed or missing request parameters |
RateLimitedError | rate_limited | rate_limited | Provider rate limit exceeded |
UnsupportedCapabilityError | unsupported_capability | invalid | Verb not supported by this provider |
ProviderError | provider_error | provider_error | Backend-specific error |
UnsupportedProviderError | invalid_request | invalid | Unknown provider string passed to Memory() |
e.message— human-readable descriptione.code— machine-readable error code stringe.type— error category (auth,not_found,invalid,rate_limited,provider_error)e.provider— the provider that raised the error, orNonee.request_id— the provider-assigned request ID for tracing, orNone
Common error handling pattern
OMPError as the final handler gives you a safe fallback for any OMP-originated exception.
Handling auth errors
Handling unsupported capabilities
Not all providers support every OMP verb. You can either check capabilities upfront or catchUnsupportedCapabilityError at call time:
Error envelope structure
When an OMP-native HTTP server returns an error, it uses this JSON envelope. The SDK parses this envelope and raises the matching exception class automatically.OMPError subclass from a raw error dict using OMPError.from_response_dict():
Provider consistency guarantee
OMP guarantees that the same logical condition raises the same exception class regardless of which provider is active. For example, requesting a non-existent memory ID always raisesNotFoundError — whether you’re using the postgres adapter, the mem0 adapter, or a native passthrough provider. You never need to write provider-specific error handling.
Ingestion timeout
ProviderError with code="ingestion_timeout" is a special case raised by async-ingestion providers (mem0, supermemory) when a memory fails to become searchable within the polling timeout. This is distinct from a generic backend failure.