# Storage

The storage manager in AIOS is built powered by the LLM-based semantic file system, which is published in ICLR2025, with its paper can be found at [From Commands to Prompts: LLM-based Semantic File System for AIOS](https://arxiv.org/pdf/2410.11843).&#x20;

```python
class StorageManager:
    def __init__(self, root_dir, use_vector_db=True, filesystem_type="lsfs"):
        self.use_vector_db = use_vector_db
        self.filesystem_type = filesystem_type
        self.root_dir = root_dir
        os.makedirs(self.root_dir, exist_ok=True)
        if filesystem_type == "lsfs":
            self.filesystem = LSFS(root_dir, use_vector_db)

    def address_request(self, agent_request):
        return self.filesystem.address_request(agent_request)
```

By default, the storage manager integrates the LLM-based semantic file system as its file system, which supports prompt-driven file management. Its original implementation can be found at <https://github.com/agiresearch/AIOS-LSFS>.&#x20;

Available system calls are shown as below

* [sto\_mount](/aios-docs/aios-kernel/storage/sto_mount.md)
* [sto\_create\_file](/aios-docs/aios-kernel/storage/sto_create_file.md)
* [sto\_create\_directory](/aios-docs/aios-kernel/storage/sto_create_directory.md)
* [sto\_write](/aios-docs/aios-kernel/storage/sto_write.md)
* [sto\_retrieve](/aios-docs/aios-kernel/storage/sto_retrieve.md)
* [sto\_rollback](/aios-docs/aios-kernel/storage/sto_rollback.md)
* [sto\_share](/aios-docs/aios-kernel/storage/sto_share.md)

<pre><code>@inproceedings{
    shi2025from,
<strong>    title={From Commands to Prompts: {LLM}-based Semantic File System for AIOS},
</strong>    author={Zeru Shi and Kai Mei and Mingyu Jin and Yongye Su and Chaoji Zuo and Wenyue Hua and Wujiang Xu and Yujie Ren and Zirui Liu and Mengnan Du and Dong Deng and Yongfeng Zhang},
    booktitle={The Thirteenth International Conference on Learning Representations},
    year={2025},
    url={https://openreview.net/forum?id=2G021ZqUEZ}
}
</code></pre>


---

# 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-kernel/storage.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.
