> ## 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**](../modules/protocols) module.

<Badge color="blue">AI Agent</Badge>

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

<CardGroup cols={2}>
  <Card title="evaluate()" icon="function" href="../functions/ResourcePressurePolicyProtocol-evaluate">
    Return an :class:`AdmissionDecision` for the supplied sample.
  </Card>
</CardGroup>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L3358">
  `praisonaiagents/gateway/protocols.py` at line 3358
</Card>
