DEV Community

Cover image for Using Datastax Langflow and AstraDB to Create a Multi-Agent Research Assistant with Safety Check - Part 3: Summarizer
Alan Knox
Alan Knox

Posted on

Using Datastax Langflow and AstraDB to Create a Multi-Agent Research Assistant with Safety Check - Part 3: Summarizer

This is the third part of a multipart post about creating a multi-agent research assistant using Datastax Langflow and AstraDB.

The goal of this series is to explain how multiple Langflow flows and AstraDB can be integrated to create a multi-agent application. For this project, the application will assist a researcher in finding websites about a particular topic in 3 steps:

  1. Examine the user's request to determine whether or not it is a safe request.
  2. Find web pages that correspond to the user's request.
  3. Summarize the contents of each web page.

In previous posts, I create two flows that checked the user's topic for safety and also searched the web for websites related to that topic. Then I modified the web search agent to verify that urls found were not already stored in an AstraDB database.

Web Content Summarizer

In this part of the project, I create a new agent that reads the content of a website and summarizes the content and provides the output in a standard format.

Note: It's possible to include the summarizer function as part of the web search agent. However, for this project, my desire is to separate the different steps so the user can become the orchestrator. For example, each flow/agent will be controlled by a Python script, allowing the user to choose which URLs to include in the database. Later the user will also be able to use the data to create different types of content such as articles, podcasts, etc.

To begin, this is the flow of the web summarizer agent in Langflow:

Web Summarizer Agent Flow
Image description

Note that this flow is similar to the web search flow, however I used a different search tool to make it easier to demonstrate that many tool types are available and can be integrated together.

For this flow, a simple prompt provided the output that I needed:

Web Summarizer Agent Prompt
Image description

This flow and prompt provided the output that I wanted:

Web Summarizer Agent Results
Image description

Image description

Image description

At this point in the project, I have a flow that checks my user's input for safety. I also have an agent that returns a list of websites and compares those websites to those already stored in a database. Another agent summarizes the content of each website.

The URLs and summaries will be stored in an AstraDB database (the same database used to verify that the web search agent found new URLs). At this time, Langflow does not directly write to a database (unless it's a vector db). So, this step will be handled through Python code.

The next post in the series will demonstrate how a Langflow agent can pull the summaries from the AstraDB database and perform different functions on the data.

Top comments (0)