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

# Message Steering Protocol • AI Agent SDK

> MessageSteeringProtocol: Protocol for message steering during agent execution.

# MessageSteeringProtocol

> Defined in the [**protocols**](../modules/protocols) module.

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

Protocol for message steering during agent execution.

This protocol enables real-time communication with agents during
long-running operations, allowing users to provide mid-execution
guidance, feedback, and course corrections.

## Methods

<CardGroup cols={2}>
  <Card title="queue_message()" icon="function" href="../functions/MessageSteeringProtocol-queue_message">
    Queue a steering message for the agent.
  </Card>

  <Card title="get_pending_messages()" icon="function" href="../functions/MessageSteeringProtocol-get_pending_messages">
    Get all pending steering messages.
  </Card>

  <Card title="process_steering()" icon="function" href="../functions/MessageSteeringProtocol-process_steering">
    Process any pending steering messages and update execution context.
  </Card>

  <Card title="clear_messages()" icon="function" href="../functions/MessageSteeringProtocol-clear_messages">
    Clear all pending messages.
  </Card>

  <Card title="has_pending_messages()" icon="function" href="../functions/MessageSteeringProtocol-has_pending_messages">
    Check if there are pending steering messages.
  </Card>

  <Card title="enabled()" icon="function" href="../functions/MessageSteeringProtocol-enabled">
    Whether message steering is enabled.
  </Card>
</CardGroup>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
class BasicMessageSteering:
        def queue_message(self, message: str, priority: int = 5) -> str:
            # Add to internal queue
            return "msg_001"
        
        def get_pending_messages(self) -> List[SteeringMessage]:
            # Return queued messages
            return []
        
        def process_steering(self, context: dict) -> bool:
            # Check for messages and update context
            return False
    
    agent = Agent(name="assistant", message_steering=BasicMessageSteering())
```

## Source

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