DEV Community

Cover image for Co-Researcher | A Medical Research tool | Multi-Agent and Real-time data
Mohamed Ashiq Sultan
Mohamed Ashiq Sultan

Posted on • Edited on

Co-Researcher | A Medical Research tool | Multi-Agent and Real-time data

n8n and Bright Challenge: Unstoppable Workflow

This is a submission for the AI Agents Challenge powered by n8n and Bright Data

What I Built

I built a Co-Research app to help scientists in healthcare and medicine get their work done faster in drug discovery. It’s uses by multiple n8n AI Agent nodes each having brightdata as their tool to retrive real-time data from internet

Each agent takes care of a specific job, like pulling in Clinical Trial data, checking literatures, analysis of safety concerns and then a final agent ties it all together into a neat summary with insights.

Demo

Main Workflow
Main workflow doing research
Sub Workflow
Sub workflow bright data doing google ai search

Live App You can try the app in the below link.

https://co-researcher.vercel.app

n8n Workflow

Technical Implementation

I have created two workflows.

  1. Main Workflow: This is where the actual research workflow happens. It uses multiple AI agents, with each agent handling a specific part of the research process.

  2. Sub Workflow: To search the internet using BrightData Think of this like a resuable helper function. It handles web searching tasks and is designed to work with any existing or new workflows. In this project, three different agents use this same sub workflow as their search tool.

LLM Model: Well, I used Gemini Flash due to their free tier.
Memory: I used simple memory provided by n8n
Tools: Well, the BrightData search

This is simply the tech stack

  • Next.js: Web app
  • n8n: Research Automation
  • BrightData: For Searching Web
  • AirTable: Storage
  • Gemini: LLM

Bright Data Verified Node

I have used couple of bright data nodes

  • Webscrapper Node with Google AI search
  • Monitor Snapshot
  • Download Snapshot

Journey

This project is an inspiration from James Zou talk on Virtual Lab of AI Scientists. Since this is just a hackathon project, I didn't capture his complete version, rather adapted the core ideas he outlined so credits to him.

Okay now about my actual journey

I'm completely new to both n8n and brightdata so had to watch some YouTube videos to get an overall understanding. Also as person who likes to avoid tooling and loves to code everything, this entire concept seemed too good to be true. What I personally liked is the easy integration with the various platforms with just API keys and also the orchestration of AI Agent tool, this is super cool coz If I had to code this I would easily sit at least a week on this.

I started experimenting with BrightData on n8n, and initially tried using it directly as a tool in an agent node. But that didn't really work for me cox the results would get stored in a BrightData snapshot, which made it pretty tricky to orchestrate the whole process properly.

So I had this idea to create a separate workflow instead and call that as a tool. Turns out this approach worked really well for me, What I ended up with was this reusable web searching workflow that I can basically plug in anywhere I need it I pretty much liked this neat solution.

Now all I needed is a place to store the records, I wanted to keep it simple and went with Airtable. Finally I created a Next.js app to make it accessible and view the results.

You can find the code along with n8n workflow jsons in the below GitHub repo.
GitHub

If you have read it till here, a like would be great, thank you.

...

Top comments (2)

Collapse
 
ashiqsultan profile image
Mohamed Ashiq Sultan • Edited

Thanks for the people who tried the live app. I can see some got valid results while some got results like "JSON Schema scuccessful" 😅, Its due to the Agent's output structure tool in n8n trying to clean the output json, hope some prompt tuning and a good model should fix this but yeah I'm using Gemini flash-lite free tier so cant expect much ¯_(ツ)_/¯.

Collapse
 
saarustuff profile image
Shahriyar Alam

This is solid for a hackathon. Splitting agents by task and making BrightData a reusable sub-workflow is smart. Gemini’s fine for prototyping but will hit limits fast.