> For the complete documentation index, see [llms.txt](https://docs.aios.foundation/aios-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aios.foundation/aios-docs/aios-agent-sdk/storage-api/retrieve_file.md).

# retrieve\_file

#### `retrieve_file`: Search and Retrieve Files

Searches for files matching query criteria and returns the results.

```python
def retrieve_file(
    agent_name: str, 
    query_text: str,
    n: int,
    keywords: List[str] = None,
    base_url: str = aios_kernel_url
) -> StorageResponse
```

**Parameters:**

* `agent_name`: Identifier for the agent making the request
* `query_text`: Text to search for in files
* `n`: Maximum number of results to return
* `keywords`: Optional list of specific keywords to match
* `base_url`: API endpoint URL

**Returns:**

* `StorageResponse` object containing matched files

**Example:**

```python
# Find Python files related to data processing
response = retrieve_file(
    "data_scientist",
    "data processing pipeline",
    n=5,
    keywords=["pandas", "numpy", "dataframe"]
)

print(response["response"]["response_message"])
```
