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

# From Env • AI Agent SDK

> from_env: Load config from environment variables.

# from\_env

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**ContextConfig**](../classes/ContextConfig) class in the [**models**](../modules/models) module.

Load config from environment variables.

Reads PRAISONAI\_CONTEXT\_\* environment variables.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def from_env() -> 'ContextConfig'
```

### Returns

<ResponseField name="Returns" type="'ContextConfig'">
  The result of the operation.
</ResponseField>

## Uses

* `os.getenv`
* `OptimizerStrategy`
* `cls`
* `get_bool`
* `get_float`
* `get_int`

## Used By

* [`create_context_manager`](../functions/create_context_manager)

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/context/models.py#L376">
  `praisonaiagents/context/models.py` at line 376
</Card>
