ResearchMind is a multi-agent research assistant that searches the web, scrapes a relevant page, writes a structured report, and then critiques that report. The project has two parts:
- A Python backend that runs the research pipeline.
- A React frontend that provides a polished landing page and calls the backend through HTTP.
The system is built around a simple idea: each agent does one job well, and the output of one stage becomes the input of the next stage.
When you enter a topic such as Impact of USA-Iran war on India, the pipeline does the following:
- Searches the web for recent and reliable sources.
- Extracts the first useful URL from the search output.
- Scrapes the selected page for deeper text content.
- Uses an LLM to write a structured research report.
- Uses another LLM pass to critique the report.
The frontend sends the topic to the backend, the backend runs the full pipeline, and the response is rendered in the UI.
MultiAgent/
├── app.py
├── agents.py
├── pipeline.py
├── tools.py
├── requirements.txt
├── README.md
├── frontend/
│ ├── package.json
│ ├── vite.config.js
│ └── src/
│ ├── App.jsx
│ ├── main.jsx
│ └── styles.css
This is the FastAPI backend entrypoint.
What it does:
- Creates the web API server.
- Enables CORS so the React app can talk to it during development.
- Exposes a health check route.
- Exposes a research route that accepts a topic and runs the pipeline.
Important routes:
GET /healthreturns{"status": "ok"}.POST /api/researchaccepts JSON like{"topic": "..."}and returns the full research output.
This is the main research workflow.
What it does:
- Calls the search tool to get recent sources.
- Extracts a URL from the search result text.
- Scrapes the selected page.
- Sends the combined research data to the writer chain.
- Sends the generated report to the critic chain.
- Returns a dictionary with all intermediate and final outputs.
Returned keys:
search_resultsscraped_contentreportfeedback
This file configures the LLM and the LangChain chains.
What it does:
- Loads environment variables.
- Builds the LLM with Groq by default.
- Falls back to OpenAI if you explicitly change the provider.
- Creates the search agent and reader agent.
- Defines the writer chain.
- Defines the critic chain.
Key behavior:
LLM_PROVIDERdefaults togroq.GROQ_API_KEYis used when Groq is selected.GROQ_MODELdefaults tollama-3.1-8b-instant.OPENAI_API_KEYandOPENAI_MODELare only needed if you switch providers.
This file defines the helper tools used by the pipeline.
What it does:
- Uses Tavily to search the web.
- Uses
requestsand BeautifulSoup to scrape a page.
Tools:
web_search(query)searches the web and returns titles, URLs, and snippets.scrape_url(url)fetches a page and returns cleaned text.
This file lists the Python dependencies.
Important packages:
fastapianduvicornfor the API server.langchain,langchain-core,langchain-community,langchain-groq, andlangchain-openaifor the agents and chains.tavily-pythonfor search.beautifulsoup4,requests, andlxmlfor scraping.python-dotenvfor loading environment variables.
Request:
curl -X POST http://127.0.0.1:8000/api/research \
-H "Content-Type: application/json" \
-d '{"topic":"Impact of USA-Iran war on India"}'Response fields:
search_resultsscraped_contentreportfeedback
This means JSX is being compiled without a React binding in scope. The current frontend imports React in App.jsx, so this should already be fixed.
This means the search tool output did not contain a URL in the expected format. The pipeline extracts URLs with a regex from the search text.
Make sure the Tavily key is present in .env and that the search service is enabled.
Make sure GROQ_API_KEY is set. If you want to switch to OpenAI instead, set LLM_PROVIDER=openai and provide an OpenAI key.
Make sure the backend is running on port 8000 and the frontend is running from the frontend directory.
- The project is currently optimized for local development.
- The frontend is connected to the backend through a Vite proxy.
- The backend returns all intermediate pipeline results so the UI can show each stage.
If you want to extend the project later, the most useful upgrades would be:
- Add streaming status updates from the backend.
- Save completed reports to disk or a database.
- Add source cards with clickable links.
- Add a stop/cancel button for long-running pipelines.
- Add authentication if this is exposed publicly.