> ## 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.

# process • AI Agent SDK

> process: Process messages through the context pipeline.

# process

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**ContextManager**](../classes/ContextManager) class in the [**manager**](../modules/manager) module.

Process messages through the context pipeline.

Applies budgeting, optimization, and monitoring.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def process(messages: List[Dict[str, Any]], system_prompt: str, tools: Optional[List[Dict[str, Any]]], trigger: Literal['turn', 'tool_call', 'manual', 'overflow']) -> Dict[str, Any]
```

## Parameters

<ParamField query="messages" type="List" required={true}>
  Conversation messages
</ParamField>

<ParamField query="system_prompt" type="str" required={false} default="''">
  System prompt content
</ParamField>

<ParamField query="tools" type="Optional" required={false}>
  Tool schemas
</ParamField>

<ParamField query="trigger" type="Literal" required={false} default="'turn'">
  What triggered this processing
</ParamField>

### Returns

<ResponseField name="Returns" type="Dict[str, Any]">
  Dict with processed messages and metadata
</ResponseField>

## Uses

* `reset`
* `track_system_prompt`
* `track_tools`
* `track_history`
* `get_utilization`
* `get_total`
* `get_warnings`
* `estimate_messages_tokens`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/context/manager.py#L391">
  `praisonaiagents/context/manager.py` at line 391
</Card>
