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

> from_file: Load patterns from file.

# from\_file

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

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

Load patterns from file.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def from_file(filepath: str) -> 'IgnoreMatcher'
```

## Parameters

<ParamField query="filepath" type="str" required={true}>
  Path to .praisonignore file
</ParamField>

### Returns

<ResponseField name="Returns" type="'IgnoreMatcher'">
  IgnoreMatcher with loaded patterns
</ResponseField>

## Uses

* `splitlines`
* `f.read`
* `cls`

## Source

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