# Use Agent Orion to generate a query with Natural Language

\
The [Query Language](/guide/how-to/ask-multi-modal-questions/ask-questions-with-query-language.md) is an intuitive way to write complex multi-omic queries designed to retrieve information from your graph. We make this even easier though the use of AI Agent Orion.\
\
Agent Orion converts your natural language question into a Query Language Query. Agent Orion is accessible from the Query Language page. Select "Natural Language Query Generator" to use the agent. <br>

Check out  Agent Orion in action below&#x20;

{% embed url="<https://www.loom.com/share/8619258814474888af778bce2f10cbe8?sid=e399a0d4-e69a-4222-b38f-26edc298a163>" %}

To use the agent, type in a very descriptive prompt.&#x20;

For example&#x20;

> Which genes are upregualted in differential expression datasets where the experimental group is pathologically confirmed to be "endometrium adenocarcinoma"?

\
Select <mark style="color:blue;">**"Generate Query"**</mark> and this will generate the corresponding Query Language query. <br>

Once a query has been generated you can launch the query and explore your results. A detailed breakdown explaining the results returned from the query language can be accessed here.

## Tips for Natural Language Prompts

Using quotations around data properties can help Agent Orion better understand the query that you would like to generate.  For example, if you would like to filter on a specific disease put the disease in quotations.  Throughly describing your query using terminology in your custom knowledge graph schema will improve query accuracy. Your knowledge graph schema can be reviewed in the [Foundry](/guide/how-to/configure-your-knowledge-graph-schema.md).&#x20;

## Editing the Query Generated&#x20;

Multiple natural language prompts can be attempted to ensure the correct query is generated. \
\
The generated query itself can also  be edited or expanded on prior to it's submission.  You may want to adjust the direction of the relationships, the data properties identified or add more to the query.  The Query Language query that is returned can be edited within the dialog.&#x20;

{% embed url="<https://www.loom.com/share/5b37fa1d6311487a9a45f1ba0d4bc0e7?sid=0a1c8a87-21b0-42b7-837e-c87063044e4f>" %}

\
In the example above the initial prompt was "Which genes are upregulated in differential expression datasets where the experimental group is pathologically confirmed to be "adenocarcinoma"

> Which genes are upreugulated in differential expression datasets where the experimental group is pathologically confirmed to be "adenocarcinoma"?

This natural language prompt generated the following query

{% code overflow="wrap" %}

```
(dataset:DifferentialExpressionDataset)-> upregulates ->(gene:Gene) + (dataset:DifferentialExpressionDataset)-> experimental group includes ->(Sample)-> pathologically confirmed to be ->(Disease { displayName="adenocarcinoma" })
```

{% endcode %}

\
The query was edited to update the display name of the disease to be <mark style="color:blue;">"endometrium adenocarcinoma"</mark>

\
Resulting  in the following query

{% code overflow="wrap" %}

```
(dataset:DifferentialExpressionDataset)-> upregulates ->(gene:Gene) + (dataset:DifferentialExpressionDataset)-> experimental group includes ->(Sample)-> pathologically confirmed to be ->(Disease { displayName="endometrium adenocarcinoma" })
```

{% endcode %}


---

# 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.biobox.io/guide/how-to/ask-multi-modal-questions/ask-questions-with-natural-language-graphrag/use-agent-orion-to-generate-a-query-with-natural-language.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.
