# Develop with MetaGPT

## Intruduction

MetaGPT is a multi-agent framework. We made it so that agent applications developed with MetaGPT can run on AIOS by adding just one line of code.

## Quick Start

For installation and usage of open-interpreter, please refer to [MetaGPT](https://docs.deepwisdom.ai/main/en/).

If you want to run an application developed with MetaGPT on AIOS, please add `prepare_framework()` before you use MetaGPT, and select a framework type through `FrameworkType`. When you want to use MetaGPT, you should use `FrameworkType.MetaGPT`.

Then nothing needs to change, use MetaGPT as usual.&#x20;

```
+ with aios_starter(**vars(args)):
+     prepare_framework(FrameworkType.MetaGPT)

      repo: ProjectRepo = generate_repo("Create a 2048 game")  # or ProjectRepo("<path>")
      print(repo)
```

Or use Data Interpreter:

```
+ with aios_starter(**vars(args)):
+     prepare_framework(FrameworkType.MetaGPT)

      async def di_main():
          di = DataInterpreter()
          await di.run("Run data analysis on sklearn Iris dataset, include a plot")

      asyncio.run(di_main())  # or await main() in a jupyter notebook setting
```

More examples can be found in <https://github.com/agiresearch/AIOS/tree/main/scripts/aios-metagpt>[.](https://github.com/agiresearch/Cerebrum/blob/main/cerebrum/community/adapter/metagpt_adapter.py)

MetaGPT requires a longer output context to generate longer code, so you may need to use `--max_new_tokens` to set a larger output token length.

```
python scripts/aios-metagpt/example_aios_metagpt.py --llm_name gpt-4o-mini --max_new_tokens 4000
```


---

# 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/how-to-develop-agents/develop-with-metagpt.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.
