# Create a Minimal Agent Pipeline

Start simple by creating a minimal Agent pipeline that passes the query to the Agent and returns the result.

***

## About This Task

Create a minimal Agent pipeline to understand how to connect the Agent to other components and build more complex systems. In this pipeline, the Agent receives the user query and generates a response. 

## Create an Agent Pipeline

1. In the left navigation, go to *Pipelines>Create empty pipeline*.
2. Click **Create empty pipeline**, give your pipeline a name, and click **Create Pipeline**.
3. In the Component Library, find `Input` and drag it onto the canvas.
4. On the `Input` component card, expand optional parameters, click **Configure**, and add `-messages` as a connection point.
   <ClickableImage src="/img/how-tos/input-messages.png" alt="Input component with messages connection point" size="large" />

   <ClickableImage src="/img/how-tos/configure-input-messages.png" alt="Input component with messages connection point configured" size="large" />

5. Now, drag the `Agent` component onto the canvas.
6. Connect `Input`'s `messages` output to `Agent`'s `messages` input.
7. On the Agent component card, click **Prompt**, and enter the following prompt in the **System prompt** field:

    ```
    You are a helpful assistant.
    Answer the user's question.
    ```

    :::tip Agent Output
    The Agent component has no output connections until you configure its prompt. Once you enter the prompt, you'll see `messages` as an output connection.
    :::

8. In Component Library, find `Output` and drag it onto the canvas. Every query pipeline must end with the `Output` component.
9. Expand optional parameters on the `Output` component card, click **Configure**, and add `-messages` as a connection point.
9. Connect `Agent`'s `messages` output to `Output`'s `messages` input.
10. Save the pipeline.

This is how the pipeline should look like:

<ClickableImage src="/img/how-tos/minimal-agent-pipeline.png" alt="The complete pipeline in Builder." />

This is the pipeline YAML:
```yaml
components:
  Agent:
    type: haystack.components.agents.agent.Agent
    init_parameters:
      chat_generator:
        init_parameters:
          model: gpt-5.4
        type: haystack.components.generators.chat.openai_responses.OpenAIResponsesChatGenerator
      tools:
      system_prompt: |-
        {% message role="system" %}
        You are a helpful assistant. Answer user's question.
        {% endmessage %}
      user_prompt:
      required_variables:
      exit_conditions:
      state_schema: {}
      max_agent_steps: 100
      streaming_callback:
      raise_on_tool_invocation_failure: false
      tool_invoker_kwargs:
      confirmation_strategies:

connections: []

max_runs_per_component: 100

metadata: {}

inputs:
  messages:
  - Agent.messages

outputs:
  messages: Agent.messages

```

## Run the Pipeline

1. In Builder, click **Run**.

<ClickableImage src="/img/how-tos/run-pipeline.png" alt="The Run button in Builder." size="large" />

2. Ask any question and see how the Agent responds. 

## What To Do Next

- [Configure the Agent's model, prompt, and tools](/docs/how-to-guides/building-agents/configuring-agent.mdx). Once you do that, you'll already have a powerful Agent with tools it can use to expand its capabilities.
- If needed, [configure the Agent's advanced settings](/docs/how-to-guides/building-agents/configuring-agent-advanced.mdx), such as when it should stop, what to store in the Agent's state, and more.
- Check out our Agent templates available in <ProductShortName /> on the Pipeline Templates page.
