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

# Intelligent Routing

> Auto-route tasks to the best agent

PuzldAI's router automatically selects the best agent for each task based on the prompt content and task type.

## How It Works

When you send a message without specifying an agent, the router:

1. Analyzes your prompt
2. Determines task type (code, research, general, etc.)
3. Selects the most suitable agent
4. Routes the request

## Router Agent

The router uses a fast local model by default (Ollama). You can change it:

```bash theme={null}
/router ollama            # Use Ollama (fast, local)
/router claude            # Use Claude (more accurate)
/router gemini            # Use Gemini
```

## Agent Selection

| Task Type | Typical Agent |
| - | - |
| Code generation | Claude |
| Research, analysis | Gemini |
| Quick questions | Ollama |
| Complex reasoning | Claude |

## Bypassing the Router

Force a specific agent:

```bash theme={null}
# TUI
/agent claude
/agent gemini

# CLI
puzldai run "task" -a claude
```

## Auto Mode

The default `auto` mode lets the router decide:

```bash theme={null}
puzldai run "explain async/await"  # Router picks
```

## Fallback

If the selected agent fails, PuzldAI falls back to the configured fallback agent (default: Claude).

Configure in `~/.puzldai/config.json`:

```json theme={null}
{
  "fallbackAgent": "claude"
}
```


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