# Asking subquestions

Let’s start by making a recipe that returns subquestions given a question:

{% code title="subquestions.py" %}

```python
from fvalues import F

from ice.recipe import recipe


def make_subquestion_prompt(question: str) -> str:
    return F(
        f"""Decompose the following question into 2-5 subquestions that would help you answer the question. Make the questions stand alone, so that they can be answered without the context of the original question.

Question: "{question}"
Subquestions:
-"""
    ).strip()


async def ask_subquestions(
    question: str = "What is the effect of creatine on cognition?",
):
    prompt = make_subquestion_prompt(question)
    subquestions_text = await recipe.agent().complete(prompt=prompt)
    subquestions = [line.strip("- ") for line in subquestions_text.split("\n")]
    return subquestions


recipe.main(ask_subquestions)
```

{% endcode %}

If we run this we get:

```python
[
    'What is creatine?',
    'What is cognition?',
    'How does creatine affect cognition?',
    'What are the benefits of creatine on cognition?',
    'What are the side effects of creatine on cognition?'
]
```

The trace:

<figure><img src="https://393762053-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFqoUXVrYie7Ht7Fi4JrU%2Fuploads%2FtbDFjOrowIyObauArQtx%2FScreenshot%20aTuRIdPR%402x.png?alt=media&#x26;token=2593ffc2-b1db-4fb2-92d6-af3fa0db4d95" alt=""><figcaption><p>Execution trace (<a href="https://ice.ought.org/traces/01GE0VXVNP2G2CDE7JKJ1GP8CC">view online</a>)</p></figcaption></figure>
