# 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"])
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aios.foundation/aios-docs/aios-agent-sdk/storage-api/retrieve_file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
