A sophisticated multi-agent AI system designed to assist with research tasks using LangChain and various specialized tools. This system employs multiple AI agents working in concert to handle different aspects of the research process.
This system is built on a multi-agent architecture where each agent specializes in a specific aspect of the research process. The workflow is managed through LangChain's StateGraph, allowing for flexible and dynamic research processes.
-
Hypothesis Agent
- Entry point for research tasks
- Formulates and refines research hypotheses
- Guides the initial direction of research
-
Process Agent
- Orchestrates the research workflow
- Delegates tasks to specialized agents
- Makes decisions about next steps in the research process
-
Search Agent
- Performs web searches and information gathering
- Utilizes web scraping capabilities
- Collects relevant research materials
-
Code Agent
- Handles code-related tasks
- Implements technical solutions
- Manages code execution and testing
-
Visualization Agent
- Creates visual representations of data
- Generates charts, graphs, and other visualizations
- Helps in data interpretation
-
Report Agent
- Compiles research findings
- Generates comprehensive reports
- Synthesizes information from other agents
-
Quality Review Agent
- Ensures quality control
- Reviews outputs from other agents
- Maintains research standards
-
Note Agent
- Maintains research documentation
- Records important findings
- Manages knowledge base
-
Refiner Agent
- Improves and iterates on results
- Refines research outputs
- Enhances quality of deliverables
- Advanced web scraping using multiple methods:
- WebBaseLoader for basic scraping
- FireCrawlLoader for enhanced scraping
- Fallback mechanisms for reliable data collection
- Search functionality with rate limiting (5 searches per session)
- CAPTCHA handling capabilities
The system follows a flexible workflow that can be customized based on research needs:
- Initial hypothesis formation
- Human review and direction
- Iterative process through various agents
- Quality review checkpoints
- Refinement and improvement cycles
- Final human review
The workflow can be modified in the core/workflow.py file to adapt to different research requirements.
-
Refiner Agent Enhancement Needed
- Current implementation could be improved
- Needs better refinement strategies
-
Code Execution Issues
- Some limitations in code execution capabilities
- May need additional error handling
-
Search Limitations
- Google Search currently limited to 5 searches per session due to CAPTCHA
- Consider implementing alternative search methods
- Potential to adjust max searches in code
Create a .env file in the root directory with the following configuration:
# Working Directory
WORKING_DIRECTORY=data
# Anaconda Configuration (required)
CONDA_PATH=USER\miniconda3
CONDA_ENV=conda
# ChromeDriver Configuration (required)
CHROMEDRIVER_PATH=chromedriver-win32\chromedriver-win32\chromedriver.exe
# API Keys
# FireCrawl API Key (optional)
FIRECRAWL_API_KEY=fc-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# OpenAI API Key (required)
# Warning: This key is essential; the program will not run without it
OPENAI_API_KEY=sk-proj-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# LangChain API Key (optional)
# Used for monitoring the processing
LANGCHAIN_API_KEY=lsv2_pt_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx- Clone the repository:
git clone https://github.com/HeyChriss/AI-Agent-Research.git
cd AI-Agent-Research- Set up Conda environment:
conda create -n your_env_name python=3.10
conda activate your_env_name- Install dependencies:
pip install -r requirements.txt-
Configure your environment:
- Copy the
.env.examplefile to.env - Fill in your API keys and paths in the
.envfile - Make sure ChromeDriver is installed and the path is correctly set
- Copy the
-
Run the application:
python main.pyEnsure you have sufficient OpenAI API credits, as the system will make multiple API calls. The system may take some time to complete the entire research process, depending on the complexity of the task. WARNING: The agent system may modify the data being analyzed. It is highly recommended to backup your data before using this system.
- LangChain
- Selenium
- BeautifulSoup4
- Other required packages [To be listed based on your requirements file]
Contributions are welcome! Please feel free to submit pull requests, particularly for known limitation areas.
Link of the presentation https://cdnapisec.kaltura.com/index.php/extwidget/preview/partner_id/1157612/uiconf_id/42438192/entry_id/1_k25h8fcq/embed/dynamic
MIT License
Copyright (c) 2025 Christian
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.