<!-- source: https://deepwiki.com/MervinPraison/PraisonAI/8.2-presets-and-defaults -->

# Presets and Defaults

- src/praisonai-agents/praisonaiagents/__init__.py
- src/praisonai-agents/praisonaiagents/agent/agent.py
- src/praisonai-agents/praisonaiagents/llm/llm.py

## Purpose and Scope

This document describes the preset configuration system in PraisonAI, which provides pre-defined configuration bundles for common use cases. Presets simplify agent configuration by offering named configurations that encapsulate best practices for specific scenarios such as debugging, production deployment, or research workflows.

For information about how presets are resolved and merged with explicit parameters, see [Consolidated Parameters](/MervinPraison/PraisonAI/8.1-consolidated-parameters). For environment variable configuration, see [Environment Variables](/MervinPraison/PraisonAI/8.3-environment-variables).

## Overview

The preset system consists of 13 preset dictionaries, each corresponding to one of the consolidated configuration parameters. Presets are string identifiers that map to fully-configured `Config` objects, allowing users to specify complex configurations with a single keyword.

The system uses a **fast-path optimization** pattern in `Agent.__init__()` that avoids expensive lookups for common cases (None, string presets, Config objects), reducing initialization overhead from ~420ms to ~20ms in silent mode.

### Preset Architecture with Fast-Path Resolution

```

```

**Sources:** [praisonaiagents/agent/agent.py125-135](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L125-L135) [praisonaiagents/agent/agent.py621-787](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L621-L787) [praisonaiagents/agent/agent.py707-734](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L707-L734)

## Preset Categories

### Memory Presets

The `MEMORY_PRESETS` dictionary provides pre-configured memory backends and settings for different persistence requirements. Memory resolution includes special handling for database URLs and Memory instances.

#### Fast-Path Memory Resolution

From [praisonaiagents/agent/agent.py844-900](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L844-L900):

```

```

#### Memory URL Schemes

The `MEMORY_URL_SCHEMES` constant maps URL schemes to backend types from [praisonaiagents/config/presets.py](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/config/presets.py):

#### Available Memory Presets

#### Memory Config Attributes

From [praisonaiagents/agent/agent.py871-895](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L871-L895):

```

```

**Sources:** [praisonaiagents/agent/agent.py844-900](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L844-L900) [praisonaiagents/config/presets.py](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/config/presets.py#LNaN-LNaN) [praisonaiagents/config/presets.py](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/config/presets.py#LNaN-LNaN)

### Output Presets

The `OUTPUT_PRESETS` dictionary configures output verbosity and formatting for different deployment scenarios. The default mode is **"silent"** (`DEFAULT_OUTPUT_MODE`), providing zero overhead for background tasks.

#### Fast-Path Output Resolution

The `Agent.__init__()` method implements a fast path for output parameter resolution:

```

```

**Key Code Paths:**

- Fast path for None: praisonaiagents/agent/agent.py 623-630
- Fast path for string: praisonaiagents/agent/agent.py 633-643
- File path detection: praisonaiagents/agent/agent.py 99-119

#### Common Output Presets

#### Output Config Attributes

From [praisonaiagents/agent/agent.py657-676](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L657-L676):

```

```

**Sources:** [praisonaiagents/agent/agent.py621-676](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L621-L676) [praisonaiagents/agent/agent.py99-119](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L99-L119) [praisonaiagents/config/presets.py](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/config/presets.py#LNaN-LNaN)

### Execution Presets

The `EXECUTION_PRESETS` dictionary controls agent execution behavior including retries, timeouts, and error handling. Resolution follows the same fast-path pattern as output presets.

#### Fast-Path Execution Resolution

From [praisonaiagents/agent/agent.py707-734](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L707-L734):

```

```

#### Execution Config Attributes

From [praisonaiagents/agent/agent.py728-734](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L728-L734):

```

```

#### Execution Preset Types

**Sources:** [praisonaiagents/agent/agent.py707-734](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L707-L734) [praisonaiagents/config/presets.py](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/config/presets.py#LNaN-LNaN)

### Web Search Presets

The `WEB_PRESETS` dictionary configures web search and fetch capabilities. Web search is handled either natively by the LLM (Perplexity, Gemini) or via DuckDuckGo fallback tool.

#### Fast-Path Web Resolution

From [praisonaiagents/agent/agent.py1067-1099](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L1067-L1099):

```

```

#### Web Config Attributes

From [praisonaiagents/agent/agent.py1087-1099](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L1087-L1099) and [praisonaiagents/llm/llm.py684-708](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/llm/llm.py#L684-L708):

```

```

**Native Web Search Support:**

- Perplexity models (all)
- Google Gemini models (all)
- Other models use DuckDuckGo fallback tool

**Native Web Fetch Support:**

- Anthropic Claude models only
- Enables fetching full content from URLs

#### Web Preset Configuration

**Sources:** [praisonaiagents/agent/agent.py1067-1099](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L1067-L1099) [praisonaiagents/agent/agent.py1336-1352](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L1336-L1352) [praisonaiagents/llm/llm.py684-708](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/llm/llm.py#L684-L708)

### Planning Presets

The `PLANNING_PRESETS` dictionary provides configurations for agent planning modes. Planning integrates with the `PlanningAgent` for task decomposition and execution.

#### Fast-Path Planning Resolution

From [praisonaiagents/agent/agent.py969-1000](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L969-L1000):

```

```

#### Planning Config Attributes

From [praisonaiagents/agent/agent.py989-995](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L989-L995):

```

```

#### Planning Modes

**Sources:** [praisonaiagents/agent/agent.py969-1000](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L969-L1000) [praisonaiagents/config/presets.py](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/config/presets.py#LNaN-LNaN)

### Reflection Presets

The `REFLECTION_PRESETS` dictionary configures self-reflection depth and frequency for iterative improvement of agent responses.

#### Fast-Path Reflection Resolution

From [praisonaiagents/agent/agent.py1002-1034](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L1002-L1034):

```

```

#### Reflection Config Attributes

From [praisonaiagents/agent/agent.py1023-1028](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L1023-L1028):

```

```

#### Reflection Levels

**Sources:** [praisonaiagents/agent/agent.py1002-1034](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L1002-L1034) [praisonaiagents/config/presets.py](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/config/presets.py#LNaN-LNaN)

### Context Management Presets

The `CONTEXT_PRESETS` dictionary configures context window optimization strategies.

#### Context Strategies

```

```

**Sources:** [praisonaiagents/__init__.py360](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L360-L360) [praisonaiagents/__init__.py376-379](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L376-L379) [praisonaiagents/__init__.py343](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L343-L343)

### Autonomy Presets

The `AUTONOMY_PRESETS` dictionary controls autonomous agent behavior and intervention thresholds.

#### Autonomy Levels

The `AutonomyLevel` enum defines preset autonomy configurations:

**Sources:** [praisonaiagents/__init__.py361](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L361-L361) [praisonaiagents/__init__.py319](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L319-L319) [praisonaiagents/__init__.py326](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L326-L326) [praisonaiagents/__init__.py344](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L344-L344)

### Caching Presets

The `CACHING_PRESETS` dictionary configures LLM response caching strategies. Caching supports prompt caching (Anthropic, OpenAI, Bedrock, Deepseek) and general response caching.

#### Fast-Path Caching Resolution

From [praisonaiagents/agent/agent.py761-787](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L761-L787):

```

```

#### Caching Config Attributes

From [praisonaiagents/agent/agent.py781-787](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L781-L787):

```

```

When `prompt_caching=True`, the system enables:

- Anthropic : Cache control with ephemeral type praisonaiagents/llm/llm.py 1338-1351
- OpenAI : Prompt caching for repeated prefixes
- Bedrock : Cross-turn caching
- Deepseek : Prefix caching

#### Caching Configurations

**Sources:** [praisonaiagents/agent/agent.py761-787](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L761-L787) [praisonaiagents/llm/llm.py1338-1351](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/llm/llm.py#L1338-L1351) [praisonaiagents/config/presets.py](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/config/presets.py#LNaN-LNaN)

### Guardrail Presets

The `GUARDRAIL_PRESETS` dictionary provides safety and validation configurations for output filtering and validation.

#### Fast-Path Guardrails Resolution

From [praisonaiagents/agent/agent.py1036-1066](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L1036-L1066):

```

```

#### Guardrail Config Attributes

From [praisonaiagents/agent/agent.py1056-1066](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L1056-L1066):

```

```

#### Guardrail Actions

**Sources:** [praisonaiagents/agent/agent.py1036-1066](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L1036-L1066) [praisonaiagents/config/presets.py](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/config/presets.py#LNaN-LNaN)

### Knowledge/RAG Presets

The `KNOWLEDGE_PRESETS` dictionary configures retrieval-augmented generation pipelines.

#### Knowledge Configuration

**Sources:** [praisonaiagents/__init__.py366](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L366-L366) [praisonaiagents/__init__.py308](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L308-L308) [praisonaiagents/__init__.py321](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L321-L321)

### Multi-Agent Presets

The `MULTI_AGENT_OUTPUT_PRESETS` and `MULTI_AGENT_EXECUTION_PRESETS` dictionaries configure behavior for multi-agent orchestration.

#### Multi-Agent Output Presets

#### Multi-Agent Execution Presets

**Sources:** [praisonaiagents/__init__.py363-364](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L363-L364) [praisonaiagents/__init__.py327-331](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L327-L331)

## Using Presets

### Basic Usage

Presets can be specified as strings when creating agents or configuring the `AgentTeam` orchestrator:

```

```

### Fast-Path vs. Fallback Resolution

The resolution system has two paths:

```

```

**Fast Path Benefits:**

- ~400ms faster initialization (no resolve() overhead)
- Covers 95%+ of use cases (None, string presets, Config objects)
- Lazy loads only when needed

**Sources:** [praisonaiagents/agent/agent.py621-676](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L621-L676) [praisonaiagents/agent/agent.py707-734](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L707-L734) [praisonaiagents/config/param_resolver.py](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/config/param_resolver.py#LNaN-LNaN)

## Preset Discovery

### Listing Available Presets

The parameter resolver provides suggestion mechanisms when invalid preset names are used:

```

```

### Preset Validation

The `is_policy_string()` and `parse_policy_string()` utilities validate and parse preset strings:

```

```

**Sources:** [praisonaiagents/__init__.py369-373](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L369-L373)

## Custom Presets

While the preset dictionaries are defined in [praisonaiagents/config/presets.py](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/config/presets.py) users can create custom configurations by:

1. Direct Config Objects : Pass fully-configured Config objects instead of preset strings
2. Dict Override : Use dictionaries to override specific preset values
3. Environment Variables : Set defaults via environment variables (see Environment Variables )

### Example: Custom Configuration

```

```

## Resolution Priority and Config-Driven Defaults

When multiple configuration sources are present, the resolver follows this precedence order:

```

```

### Config-Driven Defaults

From [praisonaiagents/agent/agent.py545-585](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L545-L585):

The system supports config file defaults at `~/.praison/config.yaml` or `$PRAISON_CONFIG_DIR/config.yaml`:

```

```

**Precedence Rules:**

1. Config file defaults apply only when parameter is None (not explicitly set)
2. Explicit parameters always override config defaults
3. Environment variables (e.g., PRAISONAI_OUTPUT=verbose ) override config defaults but not explicit params
4. System defaults (e.g., DEFAULT_OUTPUT_MODE ) are the final fallback

**Sources:** [praisonaiagents/agent/agent.py545-585](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/agent/agent.py#L545-L585) [praisonaiagents/config/loader.py](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/config/loader.py#LNaN-LNaN) [praisonaiagents/config/loader.py](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/config/loader.py#LNaN-LNaN)

## Integration with Parameter Resolution

The preset system integrates with the consolidated parameter resolver (see [Consolidated Parameters](/MervinPraison/PraisonAI/8.1-consolidated-parameters)):

### Resolution Functions

Each configuration category has a dedicated resolver function:

- resolve_memory() -> MemoryConfig
- resolve_output() -> OutputConfig
- resolve_execution() -> ExecutionConfig
- resolve_planning() -> PlanningConfig
- resolve_reflection() -> ReflectionConfig
- resolve_guardrails() -> GuardrailConfig
- resolve_web() -> WebConfig
- resolve_context() -> ContextConfig
- resolve_autonomy() -> AutonomyConfig
- resolve_caching() -> CachingConfig
- resolve_knowledge() -> KnowledgeConfig
- resolve_hooks() -> HooksConfig

These functions are invoked by `Agent` and `Agents` constructors to normalize all configuration inputs.

**Sources:** [praisonaiagents/__init__.py336-348](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L336-L348)

## Preset Constants Location and Lazy Loading

All preset dictionaries are defined in [praisonaiagents/config/presets.py](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/config/presets.py) and exported through the lazy loading system for optimal import performance.

### Lazy Loading Implementation

From [praisonaiagents/__init__.py101-528](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L101-L528):

```

```

### Lazy Import Mapping for Presets

From [praisonaiagents/__init__.py369-383](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L369-L383):

```

```

This design ensures presets are only loaded when accessed, maintaining the **~20ms import time** for the package when using default silent mode.

**Sources:** [praisonaiagents/__init__.py101-119](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L101-L119) [praisonaiagents/__init__.py369-383](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L369-L383) [praisonaiagents/__init__.py520-528](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/praisonaiagents/__init__.py#L520-L528)

## Summary

The preset system provides 14 configuration dictionaries covering all aspects of agent behavior. Presets simplify configuration by offering named bundles while maintaining full flexibility through config objects, dictionaries, and environment variables. The resolution system ensures intuitive precedence rules and helpful error messages when invalid presets are referenced.
