> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Resource Pressure Policy Protocol • AI Agent SDK

> ResourcePressurePolicyProtocol: Protocol for memory/resource-aware admission decisions.

# ResourcePressurePolicyProtocol

> Defined in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

AI Agent

Protocol for memory/resource-aware admission decisions.

Pure, import-free decision contract consumed by the wrapper's admission
gate. The wrapper samples its own resource usage on a lightweight cadence
and hands the policy a :class:`ResourceSample`; the policy returns an
:class:`AdmissionDecision` — `ADMIT` below the soft threshold, `QUEUE`
to apply backpressure above it, and `REJECT` above the hard threshold so
the process sheds load before the OOM killer fires. Sampling and
enforcement (the `asyncio.Semaphore` ceiling and bounded wait queue)
live in the wrapper; this keeps the *decision* provable in isolation,
symmetric with :class:`GatewayConcurrencyPolicyProtocol`.

A config-driven default (:class:`MemoryPressurePolicy`) is provided for
the common "soft/hard RSS threshold" case.

## Methods

> [card] [evaluate()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ResourcePressurePolicyProtocol-evaluate.md)
>
> Return an :class:`AdmissionDecision` for the supplied sample.

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L4784)
>
> `praisonaiagents/gateway/protocols.py` at line 4784


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.