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 component 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 Query and drag it onto the canvas.
  4. Now, drag the Agent component onto the canvas.
📘

Incompatible Types

The Agent requires messages as input, but Query outputs a string—so you can’t connect them directly. To bridge the gap, use the DeepsetChatHistoryParser. It converts the query into a ChatMessage with the user role, gathers the chat history, turns it into a list of ChatMessages, and sends everything to the Agent.

  1. Find DeepsetChatHistoryParser in the Component Library and drag it onto the canvas.

  2. Connect Query to DeepsetChatHistoryParser's history_and_query input.

  3. Connect DeepsetChatHistoryParser's messages output to the Agent's messages input.

    History parser connected to agent
  4. On the Agent component card, click Prompt, and enter the following prompt:

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

Agent Output

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

  1. Find AnswerBuilder in the Component Library and drag it onto the canvas.
📘

AnswerBuilder's Role

AnswerBuilder converts the Agent's messages into a format you can display as the final output of the pipeline.

  1. Connect Agent's messages output to AnswerBuilder's replies output.

  2. Connect Query's query output to AnswerBuilder's query input.

    AnswerBuilder connected to agent and query
  3. Drag the Output component onto the canvas. Every query pipeline must end with the Output component.

  4. Connect AnswerBuilder's answers output to Output's answers input.

  5. Save the pipeline.

This is how the pipeline should look like:

The final pipeline with all the connections

Run the Pipeline

  1. Click Deploy.

  2. Once the pipeline is deployed, click Run to test it.

    The Run button in builder
  3. Ask any question and see how the Agent responds.

What To Do Next