# 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 Templates>Create empty pipeline*.
2. Give your pipeline a name and click **Create Pipeline**.
3. Click **Add** to open the component library, find `Input` and drag it onto the canvas.
4. Now, drag the `Agent` component onto the canvas.
6. Connect `Input` to `Agent`. The Builder automatically connects `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. Click **Add**, find `Output`, and drag it onto the canvas. Every query pipeline must end with the `Output` component.
9. Connect `Agent` to `Output`. The Builder automatically connects `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 Pipeline**.

<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.

## Tutorials

Follow these step-by-step tutorials to see a complete agent built with tools:

- [Building a Deal Desk Agent with Search and Custom Code](/docs/tutorials/build-agents/tutorial-building-an-agent-with-tools.mdx) — Combines a document search pipeline tool with a custom code tool.
- [Building an IT Helpdesk Agent with Multiple Knowledge Bases](/docs/tutorials/build-agents/tutorial-building-helpdesk-agent.mdx) — Uses two document search pipeline tools to route between knowledge bases.
