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

# Query Rewriter Agent Builder • Rust AI Agent SDK

> QueryRewriterAgentBuilder: Builder for QueryRewriterAgent

# QueryRewriterAgentBuilder

> Defined in the [**Specialized Agents**](../modules/specialized_agents) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Builder for QueryRewriterAgent

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%

graph LR
    input["Input Data"] --> agent["Agent: QueryRewriterAgentBuilder"]
    agent --> output["Output Result"]
    style agent fill:#8B0000,color:#fff
    style input fill:#8B0000,color:#fff
    style output fill:#8B0000,color:#fff
```

## Fields

| Name     | Type                  | Description |
| -------- | --------------------- | ----------- |
| `config` | `QueryRewriterConfig` | -           |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new() -> Self
```

Create a new builder

### `name`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn name(mut self, name: impl Into<String>) -> Self
```

Set agent name

**Parameters:**

| Name   | Type                      |
| ------ | ------------------------- |
| `name` | `impl Into&lt;String&gt;` |

### `model`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn model(mut self, model: impl Into<String>) -> Self
```

Set LLM model

**Parameters:**

| Name    | Type                      |
| ------- | ------------------------- |
| `model` | `impl Into&lt;String&gt;` |

### `instructions`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn instructions(mut self, instructions: impl Into<String>) -> Self
```

Set custom instructions

**Parameters:**

| Name           | Type                      |
| -------------- | ------------------------- |
| `instructions` | `impl Into&lt;String&gt;` |

### `verbose`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn verbose(mut self) -> Self
```

Enable verbose output

### `max_queries`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn max_queries(mut self, max: usize) -> Self
```

Set max queries

**Parameters:**

| Name  | Type    |
| ----- | ------- |
| `max` | `usize` |

### `abbreviation`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn abbreviation(mut self, abbrev: impl Into<String>, expansion: impl Into<String>) -> Self
```

Add abbreviation expansion

**Parameters:**

| Name        | Type                      |
| ----------- | ------------------------- |
| `abbrev`    | `impl Into&lt;String&gt;` |
| `expansion` | `impl Into&lt;String&gt;` |

### `abbreviations`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn abbreviations(mut self, abbrevs: HashMap<String, String>) -> Self
```

Set abbreviations map

**Parameters:**

| Name      | Type                |
| --------- | ------------------- |
| `abbrevs` | `HashMap&lt;String` |

### `temperature`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn temperature(mut self, temp: f32) -> Self
```

Set temperature

**Parameters:**

| Name   | Type  |
| ------ | ----- |
| `temp` | `f32` |

### `max_tokens`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn max_tokens(mut self, tokens: usize) -> Self
```

Set max tokens

**Parameters:**

| Name     | Type    |
| -------- | ------- |
| `tokens` | `usize` |

### `build`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn build(self) -> QueryRewriterAgent
```

Build the agent

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/specialized_agents.rs#L648">
  `praisonai/src/specialized_agents.rs` at line 648
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Agent" icon="robot" href="/docs/rust/agent" />

  <Card title="Rust Overview" icon="book-open" href="/docs/rust/overview" />

  <Card title="Rust Quickstart" icon="rocket" href="/docs/rust/quickstart" />

  <Card title="Rust Installation" icon="download" href="/docs/rust/installation" />

  <Card title="Rust Autonomy" icon="wand-magic-sparkles" href="/docs/rust/autonomy" />
</CardGroup>
