Skip to main content

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. Now, drag the Agent component onto the canvas.

    Incompatible Types

    The Agent expects messages as its required input, while Input produces a string. The two types are incompatible. The easiest way to connect them is to use DeepsetChatHistoryParser in between. It does two things: converts the query into a ChatMessage with the user role and collects the chat conversation history, converts it into a list of ChatMessages and sends them all to the Agent.

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

  6. Connect Input's query output to DeepsetChatHistoryParser's history_and_query input.

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

    HistoryParser connected to Agent
  8. 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 connections until you configure its prompt. Once you enter the prompt, you'll see messages as an output connection.

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

  10. Connect Agent's messages output to AnswerBuilder's replies input.

  11. Connect Input's query output to AnswerBuilder's query input.

    AnswerBuilder connected to Agent and Query
  12. Drag the Output component onto the canvas. Every query pipeline must end with the Output component.

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

  14. Save the pipeline.

This is how the pipeline should look like:

The complete pipeline in Builder.

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