Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

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.

  5. Connect Input to Agent. The Builder automatically connects Input's messages output to Agent's messages input.

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

  7. Click Add, find Output, and drag it onto the canvas. Every query pipeline must end with the Output component.

  8. Connect Agent to Output. The Builder automatically connects Agent's messages output to Output's messages input.

  9. Save the pipeline.

This is how the pipeline should look like:

The complete pipeline in Builder.

This is the pipeline 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.
The Run button in Builder.
  1. Ask any question and see how the Agent responds.

What To Do Next