> ## 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 Template • AI Agent SDK

> from_template: Create an Agent from a template.

# from\_template

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

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

Create an Agent from a template.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def from_template(uri: str, config: Optional[Dict[str, Any]], offline: bool) -> 'Agent'
```

## Parameters

<ParamField query="uri" type="str" required={true}>
  Template URI (local path, package ref, or github ref)
</ParamField>

<ParamField query="config" type="Optional" required={false}>
  No description available.
</ParamField>

<ParamField query="offline" type="bool" required={false} default="False">
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="'Agent'">
  Configured Agent instance
</ResponseField>

## Usage

<CodeGroup>
  ```python Example 1 theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  - "./my-template" (local path)
          - "transcript-generator" (default recipes repo)
          - "github:owner/repo/template@v1.0.0" (GitHub with version)
          - "package:agent_recipes/transcript-generator" (installed package)
      config: Optional configuration overrides
      offline: If True, only use cached templates (no network)
      **kwargs: Additional Agent constructor arguments
  ```

  ```python Example 2 theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  from praisonaiagents import Agent

      # From default recipes repo
      agent = Agent.from_template("transcript-generator")
      result = agent.chat("Transcribe ./audio.mp3")

      # With config overrides
      agent = Agent.from_template(
          "data-transformer",
          config={"output_format": "json"},
          verbose=True
      )
  ```
</CodeGroup>

## Uses

* `create_agent_from_template`
* `ImportError`

## Source

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