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

# Resolve Route • AI Agent SDK

> resolve_route: Resolve the handling agent from priority-ordered bindings.

# resolve\_route

Function

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

Resolve the handling agent from priority-ordered bindings.

Bindings are evaluated most-specific-first: the matching binding with the
highest `priority` wins; ties are broken by specificity (exact thread →
peer → role/channel → guild/account → chat-type), then by declaration
order.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def resolve_route(bindings: List[RouteBinding], facts: RouteFacts, default_agent: str) -> RouteMatch
```

## Parameters

**bindings** `List[RouteBinding]` *required*

Candidate route bindings (any order).

**facts** `RouteFacts` *required*

Inbound facts extracted from the message.

**default\_agent** `str` (default: 'default')

Agent id to fall back to when nothing matches.

### Returns

**Returns** `RouteMatch`

class:`RouteMatch` with the selected agent and matched binding.

## Uses

* `binding.matches`
* `RouteMatch`

## Source

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


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