> Source: https://builder-docs.ema.ai/agent-reference/core/respond-to-a-query
> Title: Respond to a Query Agent

# Respond to a Query Agent

The Respond to a Query agent is the **core, general-purpose response agent** on the Ema platform. It generates text responses by synthesizing any combination of typed inputs -- search results, documents, conversation history, structured entities, and free-form text -- using LLM reasoning. Unlike specialized response agents that are tuned for a single input type, Respond to a Query uses the full [Type System](/legacy-docs/core-concepts/type-system) through [Named Inputs](/legacy-docs/core-concepts/named-inputs-outputs), making it the right choice whenever no specialized agent fits your specific input combination.

## Use Cases

-   You need a flexible response agent that can work with any combination of upstream data.
-   You want to generate a response that synthesizes information from multiple sources (e.g., search results plus extracted entities plus conversation history).
-   No specialized response agent fits your specific input combination.
-   You want to route custom typed data (documents, extracted entities, chat conversations) through a single response step without a custom agent.

## Inputs

Respond to a Query uses **Named Inputs** for its "Additional Context" section, allowing any number of labeled, typed fields to be bound from upstream agents. Common named inputs include:

Named Input

Type

Description

`Text`

Text

Any free-form text context.

`Search_Results`

SearchResults

Search results to ground the response. The agent reads passages and can cite sources.

`Conversation`

Conversation

Chat history for conversational awareness and multi-turn context.

`Document`

Document

Document content to reference in the response.

`Entities`

JSON

Structured data (extracted fields, key-value pairs) to include in the response.

`Text_With_Sources`

TextWithSources

Text paired with citations, formatted for LLM consumption.

You can add your own named input fields for any supported type -- see [Named Inputs and Outputs](/legacy-docs/core-concepts/named-inputs-outputs) for the full list of supported primitive and framework types and instructions for adding custom fields.

## Outputs

Output

Type

Description

`response`

Text

The generated response.

## Configurations

Parameter

Description

Default

`instructions`

Instructions that guide the response style, tone, and content.

None

`model`

Override EmaFusion model selection.

EmaFusion default

`temperature`

LLM temperature.

`0.0`

### Type-Aware Input Handling

Because Respond to a Query uses the platform Type System, each input type is prepared for LLM consumption according to its type contract:

-   **SearchResults** are flattened with snippet text, source metadata, and relevance scores so the model can cite specific passages.
-   **Documents** are passed with their extracted text content; the model can reference sections by name.
-   **Conversation** history is formatted as turn-by-turn dialogue, allowing the model to track references like "the order I mentioned earlier."
-   **Entities** (JSON) are rendered as structured key-value pairs the model can embed in the response.
-   **Text with Sources** is presented with inline citation markers.

This means you do not need intermediate formatting agents between typed upstream data and Respond to a Query.

### Choosing the Right Response Agent

-   Use **Respond to a Query** when you need to synthesize multiple input types, or when your input combination is non-standard.
-   Use [Respond using Search Results](/legacy-docs/agent-reference/core/respond-using-search-results) when your input is purely search results and you need inline citations out of the box.
-   Use [Respond using Action Calling Results](/legacy-docs/agent-reference/core/respond-using-action-calling-results) when your input is tool execution results from Intelligent Actions.
-   Use [Fixed Response](/legacy-docs/agent-reference/core/fixed-response) when the response is deterministic and template-based.

## How to Use This Agent

Synthesize search results and extracted entities into a single grounded response:

```
trigger -> knowledge_search --------\
 -> extract_entities --------> respond_to_a_query -> workflow_output
```

Combine conversation history with a document reference:

```
chat_trigger -> conversation_summarizer ---\
 -> document_synthesis ---> respond_to_a_query -> workflow_output
```

## Related Agents

-   [Respond using Search Results](/legacy-docs/agent-reference/core/respond-using-search-results) -- optimized for search-grounded responses with citations.
-   [Respond using Action Calling Results](/legacy-docs/agent-reference/core/respond-using-action-calling-results) -- for formatting tool execution results.
-   [Custom Agent](/legacy-docs/agent-reference/core/custom-agent) -- for arbitrary LLM tasks beyond response generation.
-   [Fixed Response](/legacy-docs/agent-reference/core/fixed-response) -- for deterministic, template-based responses.
