The LangChain Research Assistant is a Python project that leverages the power of the LangChain library and the OpenAI API to conduct research on a given topic, keyword, question, or statement. The project aims to understand the user's scenario, ask relevant questions, and generate a Mermaid code, which is then converted into a flowchart for clear and concise representation of the research findings.
Note: This project utilizes Mermaid.js to create flowchart images.
- Topic analysis and understanding.
- Intelligent question generation based on user input.
- Automatic generation of Mermaid code for a flowchart representation.
- Integration with the OpenAI API for enhanced natural language processing.
Before running the project, ensure that you have an OpenAI API key. You can obtain one here.
-
Clone the repository:
git clone https://github.com/PratikSingh121/ResearchPlot.git cd ResearchPlot
-
Set up your OpenAI API key:
Obtain an OpenAI API key by following the steps below:
- Visit OpenAI's API Key page.
- Create an account or log in if you already have one.
- Generate a new API key and copy it.
Replace
OPENAI_API_KEY
in the.env
file with the API key you obtained.# .env OPENAI_API_KEY = 'OPENAI_API_KEY'
-
Install dependencies:
-
Ensure you have the required Python dependencies by running the following command:
pip install -r requirements.txt
-
Install Mermaid.js using npm. Run the following command:
npm install -g @mermaid-js/mermaid-cli
- Run the main script:
-
Execute the following command in your terminal:
python main.py
- Execute the main script.
- Enter the topic, keyword, question, or statement when prompted.
- ResearchPlot will analyze the input, ask relevant questions, provide Mermaid code for a flowchart and the flowchart itself.
- Visualize the flowchart to represent the research findings.
- Image is saved in outputs folder.