# Sub-Question Query Engine

A query engine designed to solve problem of answering a complex query using multiple data sources. It first breaks down the complex query into sub questions for each relevant data source, then gather all the intermediate reponses and synthesizes a final response.

<figure><img src="https://823733684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F00tYLwhz5RyR7fJEhrWy%2Fuploads%2Fgit-blob-370d859c72e9004027ed8fe2661504795418d442%2Fimage%20(4)%20(1)%20(1)%20(1)%20(1)%20(2)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

## Inputs

* Query Engine Tools
* Chat Model
* Embeddings
* [Response Synthesizer](https://docs.flowiseai.com/integrations/llamaindex/response-synthesizer)

## Parameters

| Name                    | Description                                                         |
| ----------------------- | ------------------------------------------------------------------- |
| Return Source Documents | To return citations/sources that were used to build up the response |

## Outputs

| Name                   | Description                   |
| ---------------------- | ----------------------------- |
| SubQuestionQueryEngine | Final node to return response |
