# Agents Endpoint Object Structure (/docs/configuration/librechat_yaml/object_structure/agents)

This page applies to the [`agents`](/docs/features/agents) endpoint.

## Example

```yaml filename="Agents Endpoint"
endpoints:
  agents:
    recursionLimit: 50
    maxRecursionLimit: 100
    disableBuilder: false
    # (optional) Agent Capabilities available to all users. Omit the ones you wish to exclude. Defaults to list below.
    # capabilities: ["execute_code", "file_search", "actions", "tools", "artifacts", "context", "ocr", "chain", "web_search"]
    # (optional) File citation configuration for file_search capability
    maxCitations: 30          # Maximum total citations in responses (1-50)
    maxCitationsPerFile: 7    # Maximum citations from each file (1-10)
    minRelevanceScore: 0.45   # Minimum relevance score threshold (0.0-1.0)
```
> This configuration enables the builder interface for agents.

## recursionLimit

<OptionTable
  options={[
    ['recursionLimit', 'Number', 'Sets the default number of steps an agent can take in a run.', 'Controls recursion depth to prevent infinite loops. When limit is reached, raises GraphRecursionError. This value can be configured from the UI up to the maxRecursionLimit.'],
  ]}
/>

**Default:** `25`

**Example:**
```yaml filename="endpoints / agents / recursionLimit"
recursionLimit: 50
```

For more information about agent steps, see [Max Agent Steps](/docs/features/agents#max-agent-steps).

## maxRecursionLimit

<OptionTable
  options={[
    ['maxRecursionLimit', 'Number', 'Sets the absolute maximum number of steps an agent can take in a run.', 'Defines the upper limit for the recursionLimit that can be set from the UI. This prevents users from setting excessively high values.'],
  ]}
/>

**Default:** If omitted, defaults to the value of recursionLimit or 50 if recursionLimit is also omitted.

**Example:**
```yaml filename="endpoints / agents / maxRecursionLimit"
maxRecursionLimit: 100
```

For more information about agent steps, see [Max Agent Steps](/docs/features/agents#max-agent-steps).

## disableBuilder

<OptionTable
  options={[
    ['disableBuilder', 'Boolean', 'Controls the visibility and use of the builder interface for agents.', 'When set to `true`, disables the builder interface for the agent, limiting direct manual interaction.'],
  ]}
/>

**Default:** `false`

**Example:**
```yaml filename="endpoints / agents / disableBuilder"
disableBuilder: false
```

## allowedProviders

<OptionTable
  options={[
    ['allowedProviders', 'Array/List of Strings', 'Specifies a list of endpoint providers (e.g., "openAI", "anthropic", "google") that are permitted for use with the Agents feature.', 'If defined, only agents configured with these providers can be initialized. If omitted or empty, all configured providers are allowed.'],
  ]}
/>

**Default:** `[]` (empty list, all providers allowed)

**Note:** Must be one of the following, or a custom endpoint name as defined in your [configuration](/docs/configuration/librechat_yaml/object_structure/custom_endpoint#name):
    - `openAI, azureOpenAI, google, anthropic, assistants, azureAssistants, bedrock`

**Example:**
```yaml filename="endpoints / agents / allowedProviders"
allowedProviders:
  - openAI
  - google
```

## capabilities

<OptionTable
  options={[
    ['capabilities', 'Array/List of Strings', 'Specifies the agent capabilities available to all users for the agents endpoint.', 'Defines the agent capabilities that are available to all users for the agents endpoint. You can omit the capabilities you wish to exclude from the list.'],
  ]}
/>

**Default:** `["execute_code", "file_search", "actions", "tools", "artifacts", "context", "ocr", "chain", "web_search"]`

**Example:**
```yaml filename="endpoints / agents / capabilities"
capabilities:
  - "execute_code"
  - "file_search"
  - "actions"
  - "tools"
  - "artifacts"
  - "context"
  - "ocr"
  - "chain"
  - "web_search"
```
**Note:** This field is optional. If omitted, the default behavior is to include all the capabilities listed in the default.

## maxCitations

<OptionTable
  options={[
    ['maxCitations', 'Number', 'Controls the maximum total number of citations that can be included in a single agent response.', 'When using file_search capability, limits the total number of source citations returned to prevent overwhelming responses while ensuring comprehensive coverage.'],
  ]}
/>

**Default:** `30`

**Range:** `1-50`

**Example:**
```yaml filename="endpoints / agents / maxCitations"
maxCitations: 30
```

## maxCitationsPerFile

<OptionTable
  options={[
    ['maxCitationsPerFile', 'Number', 'Limits the maximum number of citations that can be extracted from any single file.', 'Ensures citation diversity by preventing any single file from dominating the citations, encouraging representation from multiple sources.'],
  ]}
/>

**Default:** `7`

**Range:** `1-10`

**Example:**
```yaml filename="endpoints / agents / maxCitationsPerFile"
maxCitationsPerFile: 7
```

## minRelevanceScore

<OptionTable
  options={[
    ['minRelevanceScore', 'Number', 'Sets the minimum relevance score threshold for sources to be included in responses.', 'Filters out low-quality matches based on vector similarity scores. Higher values (e.g., 0.7) ensure only highly relevant sources are cited, while lower values (e.g., 0.0) include all sources regardless of quality.'],
  ]}
/>

**Default:** `0.45` (45% relevance threshold)

**Range:** `0.0-1.0`

**Example:**
```yaml filename="endpoints / agents / minRelevanceScore"
minRelevanceScore: 0.45
```

### File Citation Configuration Examples

**Default Configuration (Balanced)**
```yaml
endpoints:
  agents:
    maxCitations: 30
    maxCitationsPerFile: 7
    minRelevanceScore: 0.45
```
Provides comprehensive citations while preventing overwhelming responses and filtering out low-quality matches.

**Strict Configuration (High Quality)**
```yaml
endpoints:
  agents:
    maxCitations: 10
    maxCitationsPerFile: 3
    minRelevanceScore: 0.7
```
Only includes highly relevant citations with strict limits for focused responses.

**Comprehensive Configuration (Research)**
```yaml
endpoints:
  agents:
    maxCitations: 50
    maxCitationsPerFile: 10
    minRelevanceScore: 0.0
```
Maximum information extraction for exhaustive research tasks, including all sources regardless of relevance.

## Agent Capabilities

The `capabilities` field allows you to enable or disable specific functionalities for agents. The available capabilities are:

- **execute_code**: Allows the agent to execute code.
- **file_search**: Enables the agent to search and interact with files. When enabled, citation behavior is controlled by `maxCitations`, `maxCitationsPerFile`, and `minRelevanceScore` settings.
- **actions**: Permits the agent to perform predefined actions.
- **tools**: Grants the agent access to various tools.
- **artifacts**: Enables the agent to generate interactive artifacts (React components, HTML, Mermaid diagrams).
- **context**: Enables "Upload as Text" functionality in chat, and "File Context" for agents, allowing users to upload files and have their content extracted and included directly in the conversation.
- **ocr**: Optionally enhances "Upload as Text" in chat, and "File Context" for agents, allowing files to be uploaded and processed with OCR. **Requires an OCR service to be configured.**
- **chain**: Enables Beta feature for agent chaining, also known as Mixture-of-Agents (MoA) workflows.
- **web_search**: Enables web search functionality for agents, allowing them to search and retrieve information from the internet.

By specifying the capabilities, you can control the features available to users when interacting with agents.

## Example Configuration

Here is an example of configuring the `agents` endpoint with custom capabilities and file citation settings:

```yaml filename="Agents Endpoint"
endpoints:
  agents:
    disableBuilder: false
    # File citation configuration
    maxCitations: 20
    maxCitationsPerFile: 5
    minRelevanceScore: 0.6
    # Custom capabilities
    capabilities:
      - "execute_code"
      - "file_search"
      - "actions"
      - "artifacts"
      - "context"
      - "ocr"
      - "web_search"
```

In this example:
- The builder interface is enabled
- File citations are limited to 20 total, with maximum 5 per file
- Only sources with 60%+ relevance are included
- LibreChat Agents have access to code execution, file search (with citations), actions, artifacts, file context, ocr services if configured, and web search capabilities

## Notes

- It's not recommended to disable the builder interface unless you are using [modelSpecs](/docs/configuration/librechat_yaml/object_structure/model_specs) to define a list of agents to choose from.
- File citation configuration (`maxCitations`, `maxCitationsPerFile`, `minRelevanceScore`) only applies when the `file_search` capability is enabled.
- The relevance score is calculated using vector similarity, where 1.0 represents a perfect match and 0.0 represents no similarity.
- Citation limits help balance comprehensive information retrieval with response quality and performance.
- The `context` capability works without OCR configuration using text parsing methods. OCR enhances extraction quality when configured.
- The `ocr` capability requires an OCR service to be configured (see [OCR Configuration](/docs/configuration/librechat_yaml/object_structure/ocr)).
