Sequential Tasks Agent

Build a Sequential Tasks Agent flow for a multi-agent application using multiple Agent components.

Each agent has an LLM model and a unique set of tools at its disposal, with Prompt components connected to the Agent Instructions fields to control the agent’s behavior. For example, the Researcher Agent has a Tavily AI Search component connected as a tool. The Prompt instructs the agent how to answer your query, format the response, and pass the query and research results on to the next agent in the flow.

Each successive agent in the flow builds on the work of the previous agent, creating a chain of reasoning for solving complex problems.

Open Langflow and create a new flow

  1. In the Astra Portal header, switch your active app from Astra DB Serverless to Langflow.

  2. In Langflow, click New Flow, and then select Sequential Tasks Agent.

This opens a starter template with the necessary components to run the flow.

starter flow sequential agent

The Sequential Tasks Agent flow consists of these components:

  • The Agent component contains all of the elements required for creating an agent, including an agent prompt, an LLM selector, and a current-date tool.

  • The Chat Input component accepts user input to the chat.

  • The Prompt component combines the user input with a user-defined prompt.

  • The OpenAI model component sends the user input and prompt to the OpenAI API and receives a response.

  • The Chat Output component prints the flow’s output to the chat.

  • The YFinance component creates a tool for retrieving news from Yahoo Finance.

  • The Tavily Search API tool performs web searches using the Tavily API.

  • The Calculator performs basic arithmetic operations.

Run the Sequential Tasks Agent flow

  1. Add your credentials to the Open AI and Tavily AI Search components. The fastest and most secure way to add credentials is with Langflow’s Global Variables.

    1. Click settings Settings, and then click language Global Variables.

    2. Click Add New.

    3. Name your variable. Paste your API key in the Value field.

    4. In the Apply To Fields field, select the field you want to globally apply this variable to.

    5. Click Save Variable.

  2. Click play_arrow Playground to start a chat session with the template’s default question.

    Should I invest in Tesla (TSLA) stock right now?
    Please analyze the company's current position, market trends,
    financial health, and provide a clear investment recommendation.`

    This question provides clear instructions to the agents about how to proceed and what question to answer.

  3. Inspect the answers to see how the agents use the Tavily AI Search tool to research the query, the YFinance tool to analyze the stock data, and the Calculator to determine if the stock is a wise investment.

  4. Ask similar questions to see how the agents use the tools to answer your queries.

Next steps

To create your own multi-agent flow, see Create a problem-solving agent.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com