+
+Inspired by [gpt-researcher](https://github.com/assafelovic/gpt-researcher). This project endeavors to develop an AI research assistant capable of **generating research reports** effortlessly for researchers. For instance, researchers can request the AI research assistant to compose a report on *the latest advancements in the field of superconductors as of 2023*, which is currently a trending topic. The AI research assistant will subsequently compile a report based on the relevant information obtained from the internet. Now, AIRA also offers support for **academic English polishing**.
+
+
+| Example1-1 | Example1-2 | Example1-3 |
+| :----------------------------------: | :----------------------------------: | :----------------------------------: |
+| | | |
+
+The currently supported agents encompass a wide range of fields, including *finance, business analysis, clinical medicine, basic medicine, travel, academic research and sociology*.
+
+In addition to official api, this project offers an alternative approach to generating research reports by utilizing a third-party API. For access to this third-party API, please refer to [chimeragpt](https://chimeragpt.adventblocks.cc/) or [GPT-API-free](https://github.com/chatanywhere/GPT_API_free). Before running the project, kindly ensure that you set the environment variables `OPENAI_API_KEY` and `OPENAI_API_BASE`.
+
+```shell
+$ export OPENAI_API_KEY = your_api_key
+$ export OPENAI_API_BASE = your_api_base
+```
+
+or you can set the api key and base in `.env` file.
+
+
+## Installation
+
+1. Clone the repository
+
+ ```shell
+ $ git clone git@github.com:paradoxtown/ai_research_assistant.git
+ $ cd ai_research_assistant
+ ```
+
+2. Install the dependencies
+
+ ```shell
+ $ pip install -r requirements.txt
+ ```
+
+3. Export evnironment variables
+
+ ```shell
+ $ export OPENAI_API_KEY = your_api_key
+ $ export OPENAI_API_BASE = your_api_base
+ ```
+ or modify the `.env` file.
+
+4. Run the project
+
+ ```shell
+ $ python app.py
+ ```
+
+## TODO
+
+- [x] Switch Google Search to DuckDuckGo
+- [ ] Literature review
+- [x] Third-party API
+- [ ] Prettify report
+- [x] Add medical agent and social agent
+- [ ] Add option for users to customize the number of words and temperature
+- [ ] Copy and download buttons
+- [ ] Allows the user to choose the degree of research.
+- [ ] Wikipedia Understanding
+
+---
+
+
Happy researching! 🚀
\ No newline at end of file
diff --git a/__pycache__/aira.cpython-311.pyc b/__pycache__/aira.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8dfeb3420566bb1b85073745e2fddbc552df775f
Binary files /dev/null and b/__pycache__/aira.cpython-311.pyc differ
diff --git a/__pycache__/aira.cpython-39.pyc b/__pycache__/aira.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..5857f99c4a3ca1af55e086b7c33ec5b1f33ff339
Binary files /dev/null and b/__pycache__/aira.cpython-39.pyc differ
diff --git a/__pycache__/app.cpython-311.pyc b/__pycache__/app.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..d32e4a8a7918546aee79838a645c29b76e0d9948
Binary files /dev/null and b/__pycache__/app.cpython-311.pyc differ
diff --git a/__pycache__/app.cpython-39.pyc b/__pycache__/app.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c85977c372fa24cd29a94a5fa3fc17a7bb7b6341
Binary files /dev/null and b/__pycache__/app.cpython-39.pyc differ
diff --git a/__pycache__/components.cpython-311.pyc b/__pycache__/components.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..2140931b916fd14652ab6f995345b3680b95678f
Binary files /dev/null and b/__pycache__/components.cpython-311.pyc differ
diff --git a/__pycache__/home.cpython-311.pyc b/__pycache__/home.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..5c542dc6c1d5a9e41f75ecb75c8a39b9bc2fac10
Binary files /dev/null and b/__pycache__/home.cpython-311.pyc differ
diff --git a/__pycache__/main.cpython-311.pyc b/__pycache__/main.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..0e934e595dce91d6e099663c6db4e9718eece240
Binary files /dev/null and b/__pycache__/main.cpython-311.pyc differ
diff --git a/__pycache__/main.cpython-39.pyc b/__pycache__/main.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..17174c0576b116123047ab963e18dfd65676f0ca
Binary files /dev/null and b/__pycache__/main.cpython-39.pyc differ
diff --git a/__pycache__/style.cpython-311.pyc b/__pycache__/style.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..04c61a745b9d0d991511b1c61917ad08e732596f
Binary files /dev/null and b/__pycache__/style.cpython-311.pyc differ
diff --git a/__pycache__/test.cpython-311.pyc b/__pycache__/test.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b73da4c44ffcee4ca069aab4ab3e0cd492de4103
Binary files /dev/null and b/__pycache__/test.cpython-311.pyc differ
diff --git a/__pycache__/test2.cpython-311.pyc b/__pycache__/test2.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c561ecfe51696a213bdcddb698f14b798c1403ea
Binary files /dev/null and b/__pycache__/test2.cpython-311.pyc differ
diff --git a/__pycache__/test3.cpython-311.pyc b/__pycache__/test3.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ec44db7bc64e51fd3481571aa3858597ae2d3493
Binary files /dev/null and b/__pycache__/test3.cpython-311.pyc differ
diff --git a/actions/__pycache__/duck_search.cpython-311.pyc b/actions/__pycache__/duck_search.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..3b504340adae05408e57270d4c24d719c7759063
Binary files /dev/null and b/actions/__pycache__/duck_search.cpython-311.pyc differ
diff --git a/actions/__pycache__/google_search.cpython-311.pyc b/actions/__pycache__/google_search.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..191e723601337cc78a6786a1396dad3d6826045c
Binary files /dev/null and b/actions/__pycache__/google_search.cpython-311.pyc differ
diff --git a/actions/__pycache__/web_scrape.cpython-311.pyc b/actions/__pycache__/web_scrape.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..abd45c694d68a910754ca5a5502d0d0b22134b36
Binary files /dev/null and b/actions/__pycache__/web_scrape.cpython-311.pyc differ
diff --git a/actions/__pycache__/web_scrape.cpython-39.pyc b/actions/__pycache__/web_scrape.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..6146659a15f4fde0ebb2bb10144bd022dccc8d05
Binary files /dev/null and b/actions/__pycache__/web_scrape.cpython-39.pyc differ
diff --git a/actions/__pycache__/web_search.cpython-311.pyc b/actions/__pycache__/web_search.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..7d18bcade699ffaae51a79177cee60d3f1258687
Binary files /dev/null and b/actions/__pycache__/web_search.cpython-311.pyc differ
diff --git a/actions/__pycache__/web_search.cpython-39.pyc b/actions/__pycache__/web_search.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..5035276602742b421ce68a1bc179b7d782f373fc
Binary files /dev/null and b/actions/__pycache__/web_search.cpython-39.pyc differ
diff --git a/actions/duck_search.py b/actions/duck_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..d324475f5c82105dd76a603a01fae72e1a352f2b
--- /dev/null
+++ b/actions/duck_search.py
@@ -0,0 +1,11 @@
+from duckduckgo_search import DDGS
+
+
+def duckduckgo_search(query, max_search_result=3):
+ with DDGS() as ddgs:
+ responses = list()
+ for i, r in enumerate(ddgs.text(query, region='wt-wt', safesearch='off', timelimit='y')):
+ if i == max_search_result:
+ break
+ responses.append(r)
+ return responses
\ No newline at end of file
diff --git a/actions/google_search.py b/actions/google_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..1943a37ff3d2a9ba5c8fab7be99e2898f34c3d49
--- /dev/null
+++ b/actions/google_search.py
@@ -0,0 +1,63 @@
+import requests
+from bs4 import BeautifulSoup
+
+
+def get_urls(query, proxies=None):
+ query = query
+ url = f"https://www.google.com/search?q={query}"
+ headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36'}
+ response = requests.get(url, headers=headers, proxies=proxies)
+ soup = BeautifulSoup(response.content, 'html.parser')
+ results = []
+ for g in soup.find_all('div', class_='g'):
+ anchors = g.find_all('a')
+ if anchors:
+ link = anchors[0]['href']
+ if link.startswith('/url?q='):
+ link = link[7:]
+ if not link.startswith('http'):
+ continue
+ title = g.find('h3').text
+ item = {'title': title, 'link': link}
+ results.append(item)
+
+ return results
+
+def scrape_text(url, proxies=None) -> str:
+ """Scrape text from a webpage
+
+ Args:
+ url (str): The URL to scrape text from
+
+ Returns:
+ str: The scraped text
+ """
+ headers = {
+ 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36',
+ 'Content-Type': 'text/plain',
+ }
+ try:
+ response = requests.get(url, headers=headers, proxies=proxies, timeout=8)
+ if response.encoding == "ISO-8859-1": response.encoding = response.apparent_encoding
+ except:
+ return "Unable to connect to the server"
+ soup = BeautifulSoup(response.text, "html.parser")
+ for script in soup(["script", "style"]):
+ script.extract()
+ text = soup.get_text()
+ lines = (line.strip() for line in text.splitlines())
+ chunks = (phrase.strip() for line in lines for phrase in line.split(" "))
+ text = "\n".join(chunk for chunk in chunks if chunk)
+ return text
+
+
+if __name__ == '__main__':
+ txt = "What is LSTM?"
+ proxies = None
+ urls = get_urls(txt, proxies)
+ max_search_result = 10
+
+ for url in urls[:max_search_result]:
+ print(url)
+ print(scrape_text(url['link'], proxies))
+ print("\n\n")
diff --git a/agent/__init__.py b/agent/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/agent/__pycache__/__init__.cpython-311.pyc b/agent/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b9bf3fad6991fd9749799648103bd772f2ead98c
Binary files /dev/null and b/agent/__pycache__/__init__.cpython-311.pyc differ
diff --git a/agent/__pycache__/llm_utils.cpython-311.pyc b/agent/__pycache__/llm_utils.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ab7dc5619acb35d06bd49c90f3c7f57996a8b07e
Binary files /dev/null and b/agent/__pycache__/llm_utils.cpython-311.pyc differ
diff --git a/agent/__pycache__/llm_utils.cpython-39.pyc b/agent/__pycache__/llm_utils.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b98f13b47cb5cd1fec0bb5bc3eb70ed16e0df4c3
Binary files /dev/null and b/agent/__pycache__/llm_utils.cpython-39.pyc differ
diff --git a/agent/__pycache__/prompts.cpython-311.pyc b/agent/__pycache__/prompts.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c69ffff633f544493cb5e82c4bbf57adb7b424c2
Binary files /dev/null and b/agent/__pycache__/prompts.cpython-311.pyc differ
diff --git a/agent/__pycache__/prompts.cpython-39.pyc b/agent/__pycache__/prompts.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e6970af3ca63f554bdd017b09d839efd44e68c70
Binary files /dev/null and b/agent/__pycache__/prompts.cpython-39.pyc differ
diff --git a/agent/__pycache__/research_agent.cpython-311.pyc b/agent/__pycache__/research_agent.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..42120edabc0cbacd742962c26e4f0d493c8519b7
Binary files /dev/null and b/agent/__pycache__/research_agent.cpython-311.pyc differ
diff --git a/agent/__pycache__/research_agent.cpython-39.pyc b/agent/__pycache__/research_agent.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c87ab085cca74877c63d36ede550686c8c84e7db
Binary files /dev/null and b/agent/__pycache__/research_agent.cpython-39.pyc differ
diff --git a/agent/__pycache__/run.cpython-311.pyc b/agent/__pycache__/run.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..68ab3334c61558e3499edbe0f2c9eabf5e563d25
Binary files /dev/null and b/agent/__pycache__/run.cpython-311.pyc differ
diff --git a/agent/__pycache__/run.cpython-39.pyc b/agent/__pycache__/run.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..136989cb7b504f9c915ceb028d59d0f80a27369a
Binary files /dev/null and b/agent/__pycache__/run.cpython-39.pyc differ
diff --git a/agent/__pycache__/toolkits.cpython-311.pyc b/agent/__pycache__/toolkits.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..61b3bd35446535119d0012371645dadb33bb6494
Binary files /dev/null and b/agent/__pycache__/toolkits.cpython-311.pyc differ
diff --git a/agent/llm_utils.py b/agent/llm_utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..0810a66ba41d76e48c4afe3d123b266f902b2e10
--- /dev/null
+++ b/agent/llm_utils.py
@@ -0,0 +1,39 @@
+from __future__ import annotations
+from config import Config
+import openai
+
+CFG = Config()
+
+openai.api_key = CFG.openai_api_key
+openai.api_base = CFG.openai_api_base
+
+from typing import Optional
+
+def llm_response(model,
+ messages,
+ temperature: float = CFG.temperature,
+ max_tokens: Optional[int] = None):
+ return openai.ChatCompletion.create(
+ model=model,
+ messages=messages,
+ temperature=temperature,
+ max_tokens=max_tokens,
+ ).choices[0].message["content"]
+
+
+def llm_stream_response(model,
+ messages,
+ temperature: float = CFG.temperature,
+ max_tokens: Optional[int] = None):
+ response = ""
+ for chunk in openai.ChatCompletion.create(
+ model=model,
+ messages=messages,
+ temperature=temperature,
+ max_tokens=max_tokens,
+ stream=True,
+ ):
+ content = chunk["choices"][0].get("delta", {}).get("content")
+ if content is not None:
+ response += content
+ yield response
diff --git a/agent/prompts.py b/agent/prompts.py
new file mode 100644
index 0000000000000000000000000000000000000000..382cd55fc01f5b330fe28769b017f69851b0b41d
--- /dev/null
+++ b/agent/prompts.py
@@ -0,0 +1,137 @@
+def generate_agent_role_prompt(agent):
+ """ Generates the agent role prompt.
+ Args: agent (str): The type of the agent.
+ Returns: str: The agent role prompt.
+ """
+ prompts = {
+ "Finance Agent": "You are a seasoned finance analyst AI assistant. Your primary goal is to compose comprehensive, astute, impartial, and methodically arranged financial reports based on provided data and trends.",
+
+ "Travel Agent": "You are a world-travelled AI tour guide assistant. Your main purpose is to draft engaging, insightful, unbiased, and well-structured travel reports on given locations, including history, attractions, and cultural insights.",
+
+ "Academic Research Agent": "You are an AI academic research assistant. Your primary responsibility is to create thorough, academically rigorous, unbiased, and systematically organized reports on a given research topic, following the standards of scholarly work.",
+
+ "Business Analyst Agent": "You are an experienced AI business analyst assistant. Your main objective is to produce comprehensive, insightful, impartial, and systematically structured business reports based on provided business data, market trends, and strategic analysis.",
+ "Computer Security Analyst Agent": "You are an AI specializing in computer security analysis. Your principal duty is to generate comprehensive, meticulously detailed, impartial, and systematically structured reports on computer security topics. This includes Exploits, Techniques, Threat Actors, and Advanced Persistent Threat (APT) Groups. All produced reports should adhere to the highest standards of scholarly work and provide in-depth insights into the complexities of computer security.",
+
+ "Clinical Medicine Agent": "You are an AI specializing in clinical medicine analysis. Your primary role is to compose comprehensive, well-researched, impartial, and methodically organized reports on various aspects of clinical medicine. This includes in-depth studies on medical conditions, treatments, medical advancements, patient care, and healthcare practices. Your reports should follow the highest standards of medical research and provide critical insights into the complexities of the clinical medicine field. Whether it's analyzing medical data, conducting literature reviews, or evaluating the efficacy of medical interventions, your goal is to deliver insightful and evidence-based reports to assist medical professionals and researchers in making informed decisions.",
+
+ "Basic Medicine Agent": "You are an AI specializing in basic medicine. Your goal is to provide comprehensive, unbiased reports on essential healthcare topics. Deliver clear insights into general health practices, common medical conditions, preventive measures, first aid procedures, and healthy lifestyle choices. Aim to be accessible to non-medical professionals and offer evidence-based recommendations for overall well-being.",
+
+ "Social Science Research Agent": "You are an AI social science research assistant with a focus on providing comprehensive, well-researched, and unbiased reports on various topics within the social sciences. Your primary goal is to delve into the complexities of human behavior, society, and culture to produce insightful and methodically organized reports. Whether it's sociology, psychology, anthropology, economics, or any other social science discipline, you excel in critically analyzing data, academic literature, and historical trends to offer valuable insights into the subject matter. Your reports are crafted to meet the highest standards of scholarly work, adhering to objectivity and academic rigor while presenting information in a clear and engaging manner. With your expertise, you can delve into societal issues, cultural dynamics, economic trends, and other relevant areas within the realm of social sciences.",
+
+ "Default Agent": "You are an AI critical thinker research assistant. Your sole purpose is to write well written, critically acclaimed, objective and structured reports on given text."
+ }
+
+ return prompts.get(agent, "No such agent")
+
+
+def generate_report_prompt(question, research_summary):
+ """ Generates the report prompt for the given question and research summary.
+ Args: question (str): The question to generate the report prompt for
+ research_summary (str): The research summary to generate the report prompt for
+ Returns: str: The report prompt for the given question and research summary
+ """
+
+ return f'"""{research_summary}""" Using the above information, answer the following'\
+ f' question or topic: "{question}" in a detailed report --'\
+ " The report should focus on the answer to the question, should be well structured, informative, detailed" \
+ " in depth, with facts and numbers if available, a minimum of 2,400 words and with markdown syntax and apa format. "\
+ "Write all source urls at the end of the report in apa format."
+
+
+def generate_search_queries_prompt(question):
+ """ Generates the search queries prompt for the given question.
+ Args: question (str): The question to generate the search queries prompt for
+ Returns: str: The search queries prompt for the given question
+ """
+
+ return f'Write 5 google search queries to search online that form an objective opinion from the following: "{question}"\n'\
+ 'You must respond with a list of strings in the following json format: {"Q1": query1, "Q2": query2, "Q3": query3, "Q4": query4, "Q5": query5}'
+
+
+def generate_resource_report_prompt(question, research_summary):
+ """Generates the resource report prompt for the given question and research summary.
+
+ Args:
+ question (str): The question to generate the resource report prompt for.
+ research_summary (str): The research summary to generate the resource report prompt for.
+
+ Returns:
+ str: The resource report prompt for the given question and research summary.
+ """
+ return f'"""{research_summary}""" Based on the above information, generate a bibliography recommendation report for the following' \
+ f' question or topic: "{question}". The report should provide a detailed analysis of each recommended resource,' \
+ ' explaining how each source can contribute to finding answers to the research question.' \
+ ' Focus on the relevance, reliability, and significance of each source.' \
+ ' Ensure that the report is well-structured, informative, in-depth, and follows Markdown syntax.' \
+ ' Include relevant facts, figures, and numbers whenever available.' \
+ ' The report should have a minimum length of 1,200 words.'
+
+
+def generate_outline_report_prompt(question, research_summary):
+ """ Generates the outline report prompt for the given question and research summary.
+ Args: question (str): The question to generate the outline report prompt for
+ research_summary (str): The research summary to generate the outline report prompt for
+ Returns: str: The outline report prompt for the given question and research summary
+ """
+
+ return f'"""{research_summary}""" Using the above information, generate an outline for a research report in Markdown syntax'\
+ f' for the following question or topic: "{question}". The outline should provide a well-structured framework'\
+ ' for the research report, including the main sections, subsections, and key points to be covered.' \
+ ' The research report should be detailed, informative, in-depth, and a minimum of 1,200 words.' \
+ ' Use appropriate Markdown syntax to format the outline and ensure readability.'
+
+
+def generate_concepts_prompt(question, research_summary):
+ """ Generates the concepts prompt for the given question.
+ Args: question (str): The question to generate the concepts prompt for
+ research_summary (str): The research summary to generate the concepts prompt for
+ Returns: str: The concepts prompt for the given question
+ """
+
+ return f'"""{research_summary}""" Using the above information, generate a list of 5 main concepts to learn for a research report'\
+ f' on the following question or topic: "{question}". The outline should provide a well-structured framework'\
+ 'You must respond with a list of strings in the following format: ["concepts 1", "concepts 2", "concepts 3", "concepts 4, concepts 5"]'
+
+
+def generate_lesson_prompt(concept):
+ """
+ Generates the lesson prompt for the given question.
+ Args:
+ concept (str): The concept to generate the lesson prompt for.
+ Returns:
+ str: The lesson prompt for the given concept.
+ """
+
+ prompt = f'generate a comprehensive lesson about {concept} in Markdown syntax. This should include the definition'\
+ f'of {concept}, its historical background and development, its applications or uses in different'\
+ f'fields, and notable events or facts related to {concept}.'
+
+ return prompt
+
+
+def get_report_by_type(report_type):
+ report_type_mapping = {
+ 'Research Report': generate_report_prompt,
+ 'Resource Report': generate_resource_report_prompt,
+ 'Outline Report': generate_outline_report_prompt
+ }
+ return report_type_mapping[report_type]
+
+
+def generate_english_polishing_prompt(content):
+ """ Generates the english polishing prompt for the given content.
+ Inspired by project gpt_academic
+ Args: question (str):
+ Returns: str: The english polishing prompt for the given content
+ """
+ return f'Below is a paragraph from an academic paper. Polish the writing to meet the academic style and improve the spelling, grammar, clarity, concision, and overall readability. When necessary, rewrite the whole sentence. Furthermore, list all modifications and explain the reasons for doing so in the markdown table. \n {content}'
+
+
+def generate_summarize_prompt(content):
+ """ Generates the summarize prompt for the given content.
+ Inspired by project gpt_academic
+ Args: question (str):
+ Returns: str: The summarize prompt for the given content
+ """
+ return f'The following information is crawled from the Internet and will be used in writing the research report. Please clear the junk information and summarize the useful information in depth. Include all factual information, numbers, stats etc if available. \n {content}'
\ No newline at end of file
diff --git a/agent/research_agent.py b/agent/research_agent.py
new file mode 100644
index 0000000000000000000000000000000000000000..365d2e562a5a70902f55d1eadf09a6ced1b21684
--- /dev/null
+++ b/agent/research_agent.py
@@ -0,0 +1,109 @@
+import json
+from actions.duck_search import duckduckgo_search
+from processing.text import read_txt_files
+from agent.llm_utils import llm_response, llm_stream_response
+from config import Config
+from agent import prompts
+import os
+import string
+
+CFG = Config()
+
+
+class ResearchAgent:
+ def __init__(self, question, agent):
+ """ Initializes the research assistant with the given question.
+ Args: question (str): The question to research
+ Returns: None
+ """
+
+ self.question = question
+ self.agent = agent
+ self.visited_urls = set()
+ self.search_summary = ""
+ self.directory_name = ''.join(c for c in question if c.isascii() and c not in string.punctuation)[:100]
+ self.dir_path = os.path.dirname(f"./outputs/{self.directory_name}/")
+
+ def call_agent(self, action):
+ messages = [{
+ "role": "system",
+ "content": prompts.generate_agent_role_prompt(self.agent),
+ }, {
+ "role": "user",
+ "content": action,
+ }]
+ return llm_response(
+ model=CFG.fast_llm_model,
+ messages=messages,
+ )
+
+ def call_agent_stream(self, action):
+ messages = [{
+ "role": "system",
+ "content": prompts.generate_agent_role_prompt(self.agent),
+ }, {
+ "role": "user",
+ "content": action,
+ }]
+ yield from llm_stream_response(
+ model=CFG.fast_llm_model,
+ messages=messages
+ )
+
+ def create_search_queries(self):
+ """ Creates the search queries for the given question.
+ Args: None
+ Returns: list[str]: The search queries for the given question
+ """
+ result = self.call_agent(prompts.generate_search_queries_prompt(self.question))
+ return json.loads(result)
+
+ def search_single_query(self, query):
+ """ Runs the async search for the given query.
+ Args: query (str): The query to run the async search for
+ Returns: list[str]: The async search for the given query
+ """
+ return duckduckgo_search(query, max_search_result=3)
+
+ def run_search_summary(self, query):
+ """ Runs the search summary for the given query.
+ Args: query (str): The query to run the search summary for
+ Returns: str: The search summary for the given query
+ """
+ responses = self.search_single_query(query)
+
+ print(f"Searching for {query}")
+ query = hash(query)
+ file_path = f"./outputs/{self.directory_name}/research-{query}.txt"
+ os.makedirs(os.path.dirname(file_path), exist_ok=True)
+ with open(file_path, "w") as f:
+ json.dump(responses, f)
+ print(f"Saved {query} to {file_path}")
+ return responses
+
+ def search_online(self):
+ """ Conducts the search for the given question.
+ Args: None
+ Returns: str: The search results for the given question
+ """
+
+ self.search_summary = read_txt_files(self.dir_path) if os.path.isdir(self.dir_path) else ""
+
+ if not self.search_summary:
+ search_queries = self.create_search_queries()
+ for _, query in search_queries.items():
+ search_result = self.run_search_summary(query)
+ self.search_summary += f"=Query=:\n{query}\n=Search Result=:\n{search_result}\n================\n"
+
+ return self.search_summary
+
+ def write_report(self, report_type):
+ """ Writes the report for the given question.
+ Args: None
+ Returns: str: The report for the given question
+ """
+ # yield "Searching online..."
+
+ report_type_func = prompts.get_report_by_type(report_type)
+
+ yield from self.call_agent_stream(report_type_func(self.question, self.search_online()))
diff --git a/agent/toolkits.py b/agent/toolkits.py
new file mode 100644
index 0000000000000000000000000000000000000000..29e7ee8ad5d83e2b5a6ca1aba9c689eb8f319641
--- /dev/null
+++ b/agent/toolkits.py
@@ -0,0 +1,15 @@
+from agent import prompts, llm_utils
+from config import Config
+
+CFG = Config()
+
+def english_polishing(content):
+ prompt = prompts.generate_english_polishing_prompt(content)
+ messages = [{
+ "role": "user",
+ "content": prompt,
+ }]
+
+ yield from llm_utils.llm_stream_response(
+ model=CFG.fast_llm_model,
+ messages=messages)
diff --git a/app.py b/app.py
new file mode 100644
index 0000000000000000000000000000000000000000..aa048a3b9e2ae65c8139717f220f15f810451241
--- /dev/null
+++ b/app.py
@@ -0,0 +1,103 @@
+import gradio as gr
+
+from config import check_openai_api_key
+from agent.research_agent import ResearchAgent
+from agent.toolkits import english_polishing
+from statics.style import *
+
+
+check_openai_api_key()
+report_history_buffer = ""
+report_history_num = 0
+report_history_tasks = []
+polish_history_buffer = ""
+
+def run_agent(task, agent, report_type):
+ global report_history_num, report_history_tasks
+ report_history_num += 1
+ report_history_tasks.append(task)
+ assistant = ResearchAgent(task, agent)
+ yield from assistant.write_report(report_type)
+
+
+with gr.Blocks(theme=gr.themes.Base(),
+ title="AI Research Assistant",
+ css=css) as demo:
+ gr.HTML(top_bar)
+ with gr.Tab(label="🔦Report"):
+ with gr.Column():
+ gr.HTML(report_html)
+ report = gr.Markdown(value=" Report will appear here...",
+ elem_classes="output")
+ with gr.Row():
+ agent_type = gr.Dropdown(label="# Agent Type",
+ value="Default Agent",
+ interactive=True,
+ allow_custom_value=False,
+ choices=["Default Agent",
+ "Business Analyst Agent",
+ "Finance Agent",
+ "Travel Agent",
+ "Academic Research Agent",
+ "Computer Security Analyst Agent",
+ "Clinical Medicine Agent",
+ "Basic Medicine Agent",
+ "Social Science Research Agent"])
+ report_type = gr.Dropdown(label="# Report Type",
+ value="Research Report",
+ interactive=True,
+ allow_custom_value=False,
+ choices=["Research Report",
+ "Resource Report",
+ "Outline Report"])
+
+ input_box = gr.Textbox(label="# What would you like to research next?", placeholder="Enter your question here")
+ submit_btn = gr.Button("Generate Report", elem_id="primary-btn")
+
+ gr.Examples(["Should I invest in the Large Language Model industry in 2023?",
+ "Is it advisable to make investments in the electric car industry during the year 2023?",
+ "What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023?",
+ "What are the most recent advancements in the domain of superconductors as of 2023?"],
+ inputs=input_box)
+
+ with gr.Accordion(label="# Report History", elem_id="history", open=False):
+ report_history = gr.Markdown()
+
+ def store_report(content):
+ global report_history_num, report_history_tasks, report_history_buffer
+ report_history_buffer += f' \
+ Research History {report_history_num}: \
+ {report_history_tasks[-1]} \
+
{content}
\
+ '
+ return report_history_buffer
+
+ submit_btn.click(run_agent, inputs=[input_box, agent_type, report_type], outputs=report)\
+ .then(store_report, inputs=[report], outputs=report_history)
+
+ with gr.Tab("✒️English Polishing"):
+ gr.HTML(english_polishing_html)
+ polished_result = gr.Markdown(" Polished result will appear here...", elem_classes="output")
+ sentences = gr.Textbox(label="# What would you like to polish?", placeholder="Enter your sentence here")
+
+ with gr.Row():
+ polish_btn = gr.Button("Polish", elem_id="primary-btn")
+
+ with gr.Accordion(label="# Polishing History", elem_id="history", open=False):
+ polish_history = gr.Markdown()
+
+ def store_polished_result(origin, result):
+ global polish_history_buffer
+ polish_history_buffer += f' \
+ {origin} \
+
{result}
\
+ '
+ return polish_history_buffer
+
+ polish_btn.click(english_polishing, inputs=[sentences], outputs=polished_result) \
+ .then(store_polished_result, inputs=[sentences, polished_result], outputs=polish_history)
+
+ with gr.Tab("📑Literature Review"):
+ gr.HTML(literature_review_html)
+
+demo.queue().launch()
\ No newline at end of file
diff --git a/config/__init__.py b/config/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..704ba0f8fd18eac290da02e5b1d22d4be54b235f
--- /dev/null
+++ b/config/__init__.py
@@ -0,0 +1,9 @@
+from config.config import Config, check_openai_api_key
+from config.singleton import AbstractSingleton, Singleton
+
+__all__ = [
+ "check_openai_api_key",
+ "AbstractSingleton",
+ "Config",
+ "Singleton",
+]
diff --git a/config/__pycache__/__init__.cpython-311.pyc b/config/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..165bd58174e76663b605c5ee5f8d229e24bb8273
Binary files /dev/null and b/config/__pycache__/__init__.cpython-311.pyc differ
diff --git a/config/__pycache__/__init__.cpython-39.pyc b/config/__pycache__/__init__.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..d0ca3cf70d859246d918c1055084039a03772852
Binary files /dev/null and b/config/__pycache__/__init__.cpython-39.pyc differ
diff --git a/config/__pycache__/config.cpython-311.pyc b/config/__pycache__/config.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..adfce64030d3315a253b67f0a21334383ba2c5ee
Binary files /dev/null and b/config/__pycache__/config.cpython-311.pyc differ
diff --git a/config/__pycache__/config.cpython-39.pyc b/config/__pycache__/config.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..7db2e57d52019da07128e5652cf8f38627d081ae
Binary files /dev/null and b/config/__pycache__/config.cpython-39.pyc differ
diff --git a/config/__pycache__/singleton.cpython-311.pyc b/config/__pycache__/singleton.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..562f78dad1cf29f462cf745c966d908b8c08f1bb
Binary files /dev/null and b/config/__pycache__/singleton.cpython-311.pyc differ
diff --git a/config/__pycache__/singleton.cpython-39.pyc b/config/__pycache__/singleton.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e4ee71f050a9ff565e0fb759f32f3569de319664
Binary files /dev/null and b/config/__pycache__/singleton.cpython-39.pyc differ
diff --git a/config/config.py b/config/config.py
new file mode 100644
index 0000000000000000000000000000000000000000..97f1d2190585b966e70d5280d968330cd5aec932
--- /dev/null
+++ b/config/config.py
@@ -0,0 +1,82 @@
+"""Configuration class to store the state of bools for different scripts access."""
+import os
+
+import openai
+from colorama import Fore
+from dotenv import load_dotenv
+
+from config.singleton import Singleton
+
+load_dotenv(verbose=True)
+
+
+class Config(metaclass=Singleton):
+ """
+ Configuration class to store the state of bools for different scripts access.
+ """
+
+ def __init__(self) -> None:
+ """Initialize the Config class"""
+ self.debug_mode = False
+ self.allow_downloads = False
+
+ self.selenium_web_browser = os.getenv("USE_WEB_BROWSER", "chrome")
+ self.fast_llm_model = os.getenv("FAST_LLM_MODEL", "gpt-3.5-turbo")
+ self.smart_llm_model = os.getenv("SMART_LLM_MODEL", "gpt-4")
+ self.fast_token_limit = int(os.getenv("FAST_TOKEN_LIMIT", 8000))
+ self.smart_token_limit = int(os.getenv("SMART_TOKEN_LIMIT", 8000))
+ self.browse_chunk_max_length = int(os.getenv("BROWSE_CHUNK_MAX_LENGTH", 8192))
+
+ self.openai_api_key = os.getenv("OPENAI_API_KEY")
+ self.openai_api_base = os.getenv("OPENAI_API_BASE", openai.api_base)
+ self.temperature = float(os.getenv("TEMPERATURE", "1"))
+
+ self.user_agent = os.getenv(
+ "USER_AGENT",
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36"
+ " (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36",
+ )
+
+ self.memory_backend = os.getenv("MEMORY_BACKEND", "local")
+ # Initialize the OpenAI API client
+ openai.api_key = self.openai_api_key
+
+ def set_fast_llm_model(self, value: str) -> None:
+ """Set the fast LLM model value."""
+ self.fast_llm_model = value
+
+ def set_smart_llm_model(self, value: str) -> None:
+ """Set the smart LLM model value."""
+ self.smart_llm_model = value
+
+ def set_fast_token_limit(self, value: int) -> None:
+ """Set the fast token limit value."""
+ self.fast_token_limit = value
+
+ def set_smart_token_limit(self, value: int) -> None:
+ """Set the smart token limit value."""
+ self.smart_token_limit = value
+
+ def set_browse_chunk_max_length(self, value: int) -> None:
+ """Set the browse_website command chunk max length value."""
+ self.browse_chunk_max_length = value
+
+ def set_openai_api_key(self, value: str) -> None:
+ """Set the OpenAI API key value."""
+ self.openai_api_key = value
+
+ def set_debug_mode(self, value: bool) -> None:
+ """Set the debug mode value."""
+ self.debug_mode = value
+
+
+def check_openai_api_key() -> None:
+ """Check if the OpenAI API key is set in config.py or as an environment variable."""
+ cfg = Config()
+ if not cfg.openai_api_key:
+ print(
+ Fore.RED
+ + "Please set your OpenAI API key in .env or as an environment variable."
+ )
+ print("You can get your key from https://platform.openai.com/account/api-keys")
+ exit(1)
diff --git a/config/singleton.py b/config/singleton.py
new file mode 100644
index 0000000000000000000000000000000000000000..55b2aeea120bbe51ca837265fcb7fbff467e55f2
--- /dev/null
+++ b/config/singleton.py
@@ -0,0 +1,24 @@
+"""The singleton metaclass for ensuring only one instance of a class."""
+import abc
+
+
+class Singleton(abc.ABCMeta, type):
+ """
+ Singleton metaclass for ensuring only one instance of a class.
+ """
+
+ _instances = {}
+
+ def __call__(cls, *args, **kwargs):
+ """Call method for the singleton metaclass."""
+ if cls not in cls._instances:
+ cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
+ return cls._instances[cls]
+
+
+class AbstractSingleton(abc.ABC, metaclass=Singleton):
+ """
+ Abstract singleton class for ensuring only one instance of a class.
+ """
+
+ pass
diff --git a/outputs/Is Apple stock stable/research--1807787156852143573.txt b/outputs/Is Apple stock stable/research--1807787156852143573.txt
new file mode 100644
index 0000000000000000000000000000000000000000..82e70b0276b9b2e3c35c2cc55e538f3df94742f9
--- /dev/null
+++ b/outputs/Is Apple stock stable/research--1807787156852143573.txt
@@ -0,0 +1 @@
+[{"title": "Apple Inc. (AAPL) Stock Historical Prices & Data - Yahoo Finance", "href": "https://finance.yahoo.com/quote/AAPL/history", "body": "Discover historical prices for AAPL stock on Yahoo Finance. View daily, weekly or monthly format back to when Apple Inc. stock was issued."}, {"title": "Apple - 43 Year Stock Price History | AAPL | MacroTrends", "href": "https://www.macrotrends.net/stocks/charts/AAPL/apple/stock-price-history", "body": "Market Cap. Historical daily share price chart and data for Apple since 1980 adjusted for splits and dividends. The latest closing stock price for Apple as of August 02, 2023 is 192.58. The all-time high Apple stock closing price was 196.45 on July 31, 2023. The Apple 52-week high stock price is 198.23, which is 2.9% above the current share price."}, {"title": "Apple (AAPL) Historical Data | Nasdaq", "href": "https://www.nasdaq.com/market-activity/stocks/aapl/historical", "body": "Back to AAPL Overview. Get up to 10 years of daily historical stock prices & volumes. The \"Close/Last\" is the \"adjust consolidated close price\". Data provided by Edgar Online . The net and ..."}]
\ No newline at end of file
diff --git a/outputs/Is Apple stock stable/research--5414072335408872885.txt b/outputs/Is Apple stock stable/research--5414072335408872885.txt
new file mode 100644
index 0000000000000000000000000000000000000000..8f6875ae0e78b00ef1059a54e10f721274073bd3
--- /dev/null
+++ b/outputs/Is Apple stock stable/research--5414072335408872885.txt
@@ -0,0 +1 @@
+[{"title": "Is Apple Stock a Buy Now? | The Motley Fool", "href": "https://www.fool.com/investing/2023/06/29/is-apple-stock-a-buy-now/", "body": "Key Points. Apple shares have soared over 40% this year. Apple's history of reliability has led Wall Street to see its stock as a haven during uncertain market conditions. Apple continues to grow ..."}, {"title": "Apple Inc. : Analyst Recommendations and Opinions - MarketScreener.com", "href": "https://www.marketscreener.com/quote/stock/APPLE-INC-4849/news-broker-research/", "body": "Piper Sandler Adjusts Price Target on Apple to $220 From $180, Maintains Overweight Rating. Jul. 31. MT. Bernstein Adjusts Apple's Price Target to $195 From $175, Keeps Market Perform Rating. Jul. 27. MT. Deutsche Bank Adjusts Apple Price Target to $210 From $180, Maintains Buy Rating. Jul. 24."}, {"title": "Apple Outlook: What Analysts Are Saying About AAPL Stock Now", "href": "https://investorplace.com/2023/03/apple-outlook-what-analysts-are-saying-about-aapl-stock-now/", "body": "Some Wall Street experts are enthusiastic about AAPL stock, but the reviews are mixed and investors must consider Apple's pros and cons. ... of expert opinions on Apple, and perhaps arrive at an ..."}]
\ No newline at end of file
diff --git a/outputs/Is Apple stock stable/research--5887948791887317687.txt b/outputs/Is Apple stock stable/research--5887948791887317687.txt
new file mode 100644
index 0000000000000000000000000000000000000000..7ae481d9736074e7681e2ac2898109b377f326b3
--- /dev/null
+++ b/outputs/Is Apple stock stable/research--5887948791887317687.txt
@@ -0,0 +1 @@
+[{"title": "What Moves Apple's Stock Price? - Investopedia", "href": "https://www.investopedia.com/stock-analysis/061115/what-moves-apples-stock-price-aapl.aspx", "body": "In the meantime, Apple stock prices will likely be driven by the following five factors: iPhone Sales iPhone sales are the largest revenue generator for the company. For 2019, sales of the..."}, {"title": "Apple Stock Predictions: 2023 To 2025 - Forbes", "href": "https://www.forbes.com/sites/qai/2022/12/28/apple-stock-predictions-2023-to-2025/", "body": "There are still many macroeconomic factors impacting major companies and the tech industry. With that said, rumors are swirling that Apple will release a new product category in 2023 in the..."}, {"title": "Investing In Apple: The Risks and Rewards - Investopedia", "href": "https://www.investopedia.com/stock-analysis/021815/investing-apple-risks-rewards-aapl.aspx", "body": "A slowdown in any of the following could materially reduce Apple's multiple and stock price: overall smartphone market growth, iPhone market share growth, or penetration into China."}]
\ No newline at end of file
diff --git a/outputs/Is Apple stock stable/research--8009323857187544909.txt b/outputs/Is Apple stock stable/research--8009323857187544909.txt
new file mode 100644
index 0000000000000000000000000000000000000000..82808098ed72b2c96618d7bd49f8ed1516849f33
--- /dev/null
+++ b/outputs/Is Apple stock stable/research--8009323857187544909.txt
@@ -0,0 +1 @@
+[{"title": "Apple Stock Predictions: 2023 To 2025 - Forbes", "href": "https://www.forbes.com/sites/qai/2022/12/28/apple-stock-predictions-2023-to-2025/", "body": "Analysts predict that the company's stock should go up in 2023. Strong iPhone and Mac computer sales led to Apple reporting a record quarterly revenue of $90.1 billion during a time when many..."}, {"title": "Apple Analyst Expects Stock To Hit $210 On 2024 Earnings Projections ...", "href": "https://markets.businessinsider.com/news/stocks/apple-analyst-expects-stock-to-hit-210-on-2024-earnings-projections-iphone-delay-1032459668?op=1", "body": "AAPL Price Action: Shares of Apple had declined by 0.36% to $193.03 41.10 at the time of publishing Wednesday. See Also: Apple Settles Into 2 Bullish Patterns Mid-Week: The Bull, Bear Case For The ..."}, {"title": "Where Will Apple Stock Be in 2030? | The Motley Fool", "href": "https://www.fool.com/investing/2022/09/13/where-will-apple-stock-be-in-2030/", "body": "In fiscal 2021, Apple generated $366 billion in annual sales. $297 billion, or 81%, came from its products segment, which includes the iPhone, iPad, and Mac. The other $68 billion, or 19%, came..."}]
\ No newline at end of file
diff --git a/outputs/Is Apple stock stable/research-1198675951194370776.txt b/outputs/Is Apple stock stable/research-1198675951194370776.txt
new file mode 100644
index 0000000000000000000000000000000000000000..60ecf574bf39cdc7bdcc434a2a584000178c1c5a
--- /dev/null
+++ b/outputs/Is Apple stock stable/research-1198675951194370776.txt
@@ -0,0 +1 @@
+[{"title": "Apple Competitors and Alternatives 2023 (NASDAQ:AAPL) - MarketBeat", "href": "https://www.marketbeat.com/stocks/NASDAQ/AAPL/competitors-and-alternatives/", "body": "Should you be buying Apple stock or one of its competitors? The main competitors of Apple include Microsoft (MSFT), Alphabet (GOOG), Alphabet (GOOGL), NVIDIA (NVDA), Meta Platforms (META), Dell Technologies (DELL), Super Micro Computer (SMCI), One Stop Systems (OSS), Socket Mobile (SCKT), and Taiwan Semiconductor Manufacturing (TSM)."}, {"title": "Apple Inc. (AAPL) Key Stats Comparison | Seeking Alpha", "href": "https://seekingalpha.com/symbol/AAPL/peers/comparison", "body": "Apple Inc. (AAPL) key stats comparison: compare with other stocks by metrics: valuation, growth, profitability, momentum, EPS revisions, dividends, ratings."}, {"title": "AAPL - Apple Stock Competitors - Barchart.com", "href": "https://www.barchart.com/stocks/quotes/AAPL/competitors", "body": "About Weighted Alpha. Weighted Alpha is a measure of how much a stock has risen or fallen over a one-year period. The original research was restricted to large cap stocks, so the corresponding rise in the S&P 500 index was subtracted; however, as there are a number of interesting stocks that do not fit well into any category, and others that ..."}]
\ No newline at end of file
diff --git a/outputs/Is it advisable to make investments in the electric car industry during the year 2023/research--1651681628346444407.txt b/outputs/Is it advisable to make investments in the electric car industry during the year 2023/research--1651681628346444407.txt
new file mode 100644
index 0000000000000000000000000000000000000000..c93c3a7e066328dd0beef2fec85ee3a789ab4bc9
--- /dev/null
+++ b/outputs/Is it advisable to make investments in the electric car industry during the year 2023/research--1651681628346444407.txt
@@ -0,0 +1 @@
+[{"title": "Trends in electric vehicles: what can we expect in 2023?", "href": "https://evmagazine.com/mobility/trends-in-electric-vehicles-what-can-we-expect-in-2023", "body": "Opinion piece provided by Sammie Eastwood, Guest Editor. A lot has happened in 2022 when it comes to the world of electric vehicles (EVs), and 2023 is set to be even bigger bringing more advancements in the EV market.Technology in the sector is moving in leaps and bounds, and, despite supply chain disruptions putting strain on manufacturers, 2023 is set to be one of the best years for electric ..."}, {"title": "3 Predictions For Electric Vehicles In 2023 - Forbes", "href": "https://www.forbes.com/sites/jamesmorris/2022/12/31/3-predictions-for-electric-vehicles-in-2023/", "body": "Forbes Innovation Sustainability 3 Predictions For Electric Vehicles In 2023 James Morris Contributor I write about the rapidly growing world of electric vehicles Dec 31, 2022,05:00am..."}, {"title": "Issues and Opportunities for the Electric Vehicles Industry in 2023", "href": "https://www.morganlewis.com/pubs/2023/02/issues-and-opportunities-for-the-electric-vehicles-industry-in-2023", "body": "February 27, 2023. Electrification efforts of the US transportation sector are strong and growing. More than 800,000 fully electric vehicles (EVs) were sold in the United States in 2022, nearly 6% of all vehicles sold. In comparison, 3.2% of all vehicles sold in 2021 were fully EVs."}]
\ No newline at end of file
diff --git a/outputs/Is it advisable to make investments in the electric car industry during the year 2023/research--8662589002880032977.txt b/outputs/Is it advisable to make investments in the electric car industry during the year 2023/research--8662589002880032977.txt
new file mode 100644
index 0000000000000000000000000000000000000000..31e8e30b57deb9fefb06bfae1872d300e3d49f1e
--- /dev/null
+++ b/outputs/Is it advisable to make investments in the electric car industry during the year 2023/research--8662589002880032977.txt
@@ -0,0 +1 @@
+[{"title": "Electric vehicles", "href": "https://www2.deloitte.com/us/en/insights/focus/future-of-mobility/electric-vehicle-trends-2030.html", "body": "Since Deloitte last presented a forecast for electric vehicle (EV) sales, in January 2019, the EV market has made great strides, and not just in terms of sales. OEMs have invested billions to deliver new electrified models, from R&D to factory redesign. Consumer attitudes have evolved. Government interventions have pushed forward and pulled back."}, {"title": "Driving into 2025: The Future of Electric Vehicles | J.P. Morgan", "href": "https://www.jpmorgan.com/insights/research/electric-vehicles", "body": "Comparatively, in 2016 just under 1 million vehicles or 1% of global auto sales came from plug-in electric vehicles (PEVs). 1. By 2025, J.P. Morgan estimates this will rise close to 8.4 million vehicles or a 7.7% market share. While this jump is significant, it doesn't compare to the kind of growth expected in HEVs - cars that combine a fuel ..."}, {"title": "Issues and Opportunities for the Electric Vehicles Industry in 2023", "href": "https://www.morganlewis.com/pubs/2023/02/issues-and-opportunities-for-the-electric-vehicles-industry-in-2023", "body": "February 27, 2023 Electrification efforts of the US transportation sector are strong and growing. More than 800,000 fully electric vehicles (EVs) were sold in the United States in 2022, nearly 6% of all vehicles sold. In comparison, 3.2% of all vehicles sold in 2021 were fully EVs."}]
\ No newline at end of file
diff --git a/outputs/Is it advisable to make investments in the electric car industry during the year 2023/research--8816113149947165191.txt b/outputs/Is it advisable to make investments in the electric car industry during the year 2023/research--8816113149947165191.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a6e8cd9e003f21322e68772a75362f587d9b00ea
--- /dev/null
+++ b/outputs/Is it advisable to make investments in the electric car industry during the year 2023/research--8816113149947165191.txt
@@ -0,0 +1 @@
+[{"title": "Issues and Opportunities for the Electric Vehicles Industry in 2023", "href": "https://www.morganlewis.com/pubs/2023/02/issues-and-opportunities-for-the-electric-vehicles-industry-in-2023", "body": "February 27, 2023 Electrification efforts of the US transportation sector are strong and growing. More than 800,000 fully electric vehicles (EVs) were sold in the United States in 2022, nearly 6% of all vehicles sold. In comparison, 3.2% of all vehicles sold in 2021 were fully EVs."}, {"title": "3 Picks & Shovels Ways to Play the EV Sector in 2023", "href": "https://investorplace.com/2023/08/3-picks-shovels-ways-to-play-the-ev-sector-in-2023/", "body": "There are many ways to profit off of this sector, and here are three of the best. The EV market is one of the best sectors to look into and invest in, and here are three of our picks. Lithium ..."}, {"title": "Inside the $455 billion U.S. investment in electric vehicles", "href": "https://pv-magazine-usa.com/2023/01/17/inside-the-455-billion-u-s-investment-in-electric-vehicles/", "body": "Major automaker announcements have included: Ford - $50 billion announced, EV manufacturing in Kentucky, Michigan, Missouri, Ohio, and Tennessee, and Cologne, Germany. General Motors - $35 billion globally by 2030, EV manufacturing in Indiana, Michigan, Ohio, and Tennessee, Canada, and Mexico."}]
\ No newline at end of file
diff --git a/outputs/Is it advisable to make investments in the electric car industry during the year 2023/research-7102211584855250932.txt b/outputs/Is it advisable to make investments in the electric car industry during the year 2023/research-7102211584855250932.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a950405e8f0c98d30d102c63d846d2e26807ceff
--- /dev/null
+++ b/outputs/Is it advisable to make investments in the electric car industry during the year 2023/research-7102211584855250932.txt
@@ -0,0 +1 @@
+[{"title": "Car Market Outlook: What To Expect In 2023", "href": "https://www.forbes.com/wheels/features/car-market-outlook-2023/", "body": "Of all the electric (and non-electric) vehicles on the market in 2023, only the Chevrolet Bolt and Bolt EUV had drastic price cuts. Now $6,000 cheaper, both are some of the first genuinely..."}, {"title": "Electric vehicle production set to surge in 2023 despite low sales", "href": "https://www.reuters.com/business/autos-transportation/electric-vehicles-confront-leap-mass-market-2022-12-15/", "body": "Electric vehicle production set to surge in 2023 despite low sales By Joseph White December 15, 20224:02 PM PSTUpdated 8 months ago DETROIT, Dec 15 (Reuters) - The past year was sobering for..."}, {"title": "Four 2023 Electric Vehicle Trends to Watch - Bloomberg", "href": "https://www.bloomberg.com/news/articles/2022-12-31/four-2023-electric-vehicle-trends-to-watch", "body": "The $100,000+ market isn't slowing down. Plenty of swankier SUVs are in the offing in 2023, including a version of GMC's Hummer EV, with a price tag squarely in six-figure territory; the first ..."}]
\ No newline at end of file
diff --git a/outputs/Is it advisable to make investments in the electric car industry during the year 2023/research-8699972586918080875.txt b/outputs/Is it advisable to make investments in the electric car industry during the year 2023/research-8699972586918080875.txt
new file mode 100644
index 0000000000000000000000000000000000000000..cfe901782cf40375028429d8eaafd70abb5f9a68
--- /dev/null
+++ b/outputs/Is it advisable to make investments in the electric car industry during the year 2023/research-8699972586918080875.txt
@@ -0,0 +1 @@
+[{"title": "Electric vehicle trends | Deloitte Insights", "href": "https://www2.deloitte.com/us/en/insights/focus/future-of-mobility/electric-vehicle-trends-2030.html", "body": "Since Deloitte last presented a forecast for electric vehicle (EV) sales, in January 2019, the EV market has made great strides, and not just in terms of sales. OEMs have invested billions to deliver new electrified models, from R&D to factory redesign. Consumer attitudes have evolved. Government interventions have pushed forward and pulled back."}, {"title": "Electric Vehicle (EV) Trends In 2023 - GreenLancer", "href": "https://www.greenlancer.com/post/ev-market-trends", "body": "The Chevy Silverado EV is set to launch with a price tag of over $100,000. The 2023 Nissan Ariya crossover SUV boasts a range of up to 304 miles. The sleek BMW i5 will have a driving range of 372 miles and a starting cost between $65,000 and $70,000. The futuristic and stylish Hyundai Ioniq 6, with a starting price of $44,000 and a range of 320 ..."}, {"title": "Driving into 2025: The Future of Electric Vehicles | J.P. Morgan", "href": "https://www.jpmorgan.com/insights/research/electric-vehicles", "body": "By 2025, J.P. Morgan estimates this will rise close to 8.4 million vehicles or a 7.7% market share. While this jump is significant, it doesn't compare to the kind of growth expected in HEVs - cars that combine a fuel engine with electric elements. This sector is forecast to swell from just 3% of global market share to more than 25 million ..."}]
\ No newline at end of file
diff --git a/outputs/Should I invest in the Large Language Model industry in 2023/research--2012672616352147449.txt b/outputs/Should I invest in the Large Language Model industry in 2023/research--2012672616352147449.txt
new file mode 100644
index 0000000000000000000000000000000000000000..fe91b31cee0a902133c777d9f70f680fe0d70901
--- /dev/null
+++ b/outputs/Should I invest in the Large Language Model industry in 2023/research--2012672616352147449.txt
@@ -0,0 +1 @@
+[{"title": "Top Investing Trends For 2023 - Forbes Advisor", "href": "https://www.forbes.com/advisor/investing/top-investing-trends-2023/", "body": "With 2022 drawing to a close, the S&P 500 has clawed its way out of bear market territory but remains down 17% as of this writing. As we look ahead to 2023, here are nine investing trends that can ..."}, {"title": "Global Risks Report 2023: the biggest risks facing the world", "href": "https://www.weforum.org/agenda/2023/01/these-are-the-biggest-risks-facing-the-world-global-risks-2023/", "body": "Davos 2023. The World Economic Forum's latest Global Risks Report identifies the key risks facing the world over the next decade. In the next two years, the cost-of-living crisis is seen as the biggest risk, while over the next 10 years environmental risks dominate. The interconnectedness of global risks and crises is giving rise to the threat ..."}, {"title": "Global Risks Report 2023: We know what the risks are - here's what ...", "href": "https://www.weforum.org/agenda/2023/01/global-risks-report-2023-experts-davos2023/", "body": "The urgency of a cost of living crisis dominates 2023's Global Risks Report, which is in danger of deprioritizing other risks. Experts at the World Economic Forum give their insights into how their sectors are seeking to manage risks, build resilience and use new opportunities to shore up defences in 2023."}]
\ No newline at end of file
diff --git a/outputs/What are the most recent advancements in the domain of superconductors as of 2023/research--2821165325009188188.txt b/outputs/What are the most recent advancements in the domain of superconductors as of 2023/research--2821165325009188188.txt
new file mode 100644
index 0000000000000000000000000000000000000000..129501663dfdee57d662cb0835d6786b73d81a09
--- /dev/null
+++ b/outputs/What are the most recent advancements in the domain of superconductors as of 2023/research--2821165325009188188.txt
@@ -0,0 +1 @@
+[{"title": "Physicists discover a new switch for superconductivity - ScienceDaily", "href": "https://www.sciencedaily.com/releases/2023/06/230622120822.htm", "body": "June 22, 2023 Source: Massachusetts Institute of Technology Summary: A study sheds surprising light on how certain superconductors undergo a 'nematic transition' -- unlocking new,..."}, {"title": "Physicists discover a new switch for superconductivity", "href": "https://news.mit.edu/2023/physicists-discover-new-switch-superconductivity-0622", "body": "June 22, 2023 Press Inquiries Caption When some ultrathin materials undergo a \"nematic transition,\" their atomic lattice structure stretches in ways that unlock superconductivity (as this conceptual image shows). MIT physicists have identified how this essential nematic switch occurs in one class of superconductors. Credits Image: iStock"}, {"title": "New Room-Temperature Superconductor Discovered by Scientists - The New ...", "href": "https://www.nytimes.com/2023/03/08/science/room-temperature-superconductor-ranga-dias.html", "body": "New Room-Temperature Superconductor Discovered by Scientists - The New York Times New Room-Temperature Superconductor Offers Tantalizing Possibilities The breakthrough could one day..."}]
\ No newline at end of file
diff --git a/outputs/What are the most recent advancements in the domain of superconductors as of 2023/research--5111118754196914265.txt b/outputs/What are the most recent advancements in the domain of superconductors as of 2023/research--5111118754196914265.txt
new file mode 100644
index 0000000000000000000000000000000000000000..ffcab6950339ab7537b85e4f7947beea9ac3f4b6
--- /dev/null
+++ b/outputs/What are the most recent advancements in the domain of superconductors as of 2023/research--5111118754196914265.txt
@@ -0,0 +1 @@
+[{"title": "LK-99 superconductor breakthrough could mark 'new era' - New York Post", "href": "https://nypost.com/2023/08/02/lk-99-superconductor-breakthrough-could-mark-new-era/", "body": "LK-99 superconductor research breakthrough could mark 'new era for humankind'. Imagine riding a levitating train at speeds of 14,000 miles per hour \u2014 cutting the trip from New York to Los ..."}, {"title": "Superconductor Breakthrough Findings Replicated, Twice, in Preliminary ...", "href": "https://www.tomshardware.com/news/superconductor-breakthrough-replicated-twice", "body": "August 1, 2023 See more But in what's perhaps the most definite sign of a verification, Chinese researchers with the Huazhong University of Science and Technology have claimed to have successfully..."}, {"title": "Research breakthrough could be significant for quantum ... - ScienceDaily", "href": "https://www.sciencedaily.com/releases/2023/06/230628130347.htm", "body": "Summary: Scientists using one of the world's most powerful quantum microscopes have made a discovery that could have significant consequences for the future of computing. Researchers have..."}]
\ No newline at end of file
diff --git a/outputs/What are the most recent advancements in the domain of superconductors as of 2023/research--7173058848746146304.txt b/outputs/What are the most recent advancements in the domain of superconductors as of 2023/research--7173058848746146304.txt
new file mode 100644
index 0000000000000000000000000000000000000000..31804312c3ade9be4247501e54ede09691864bc9
--- /dev/null
+++ b/outputs/What are the most recent advancements in the domain of superconductors as of 2023/research--7173058848746146304.txt
@@ -0,0 +1 @@
+[{"title": "LK-99 superconductor breakthrough could mark 'new era' - New York Post", "href": "https://nypost.com/2023/08/02/lk-99-superconductor-breakthrough-could-mark-new-era/", "body": "Updated Imagine riding a levitating train at speeds of 14,000 miles per hour \u2014 cutting the trip from New York to Los Angeles to just 20 minutes. A team of South Korean researchers say the science..."}, {"title": "Physicists discover a new switch for superconductivity", "href": "https://news.mit.edu/2023/physicists-discover-new-switch-superconductivity-0622", "body": "Publication Date June 22, 2023 Press Inquiries Caption When some ultrathin materials undergo a \"nematic transition,\" their atomic lattice structure stretches in ways that unlock superconductivity (as this conceptual image shows). MIT physicists have identified how this essential nematic switch occurs in one class of superconductors. Credits"}, {"title": "New Room-Temperature Superconductor Discovered by Scientists - The New ...", "href": "https://www.nytimes.com/2023/03/08/science/room-temperature-superconductor-ranga-dias.html", "body": "This week's announcement is the latest attempt in that effort, but it comes from a team that faces wide skepticism because a 2020 paper that described a promising but less practical superconducting..."}]
\ No newline at end of file
diff --git a/outputs/What are the most recent advancements in the domain of superconductors as of 2023/research-1874061891885786097.txt b/outputs/What are the most recent advancements in the domain of superconductors as of 2023/research-1874061891885786097.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1b0567a0b2766ac32a223072387353a54eb93ae3
--- /dev/null
+++ b/outputs/What are the most recent advancements in the domain of superconductors as of 2023/research-1874061891885786097.txt
@@ -0,0 +1 @@
+[{"title": "New Room-Temperature Superconductor Discovered by Scientists - The New ...", "href": "https://www.nytimes.com/2023/03/08/science/room-temperature-superconductor-ranga-dias.html", "body": "Scientists announced this week a tantalizing advance toward the dream of a material that could effortlessly convey electricity in everyday conditions. Such a breakthrough could transform almost any..."}, {"title": "Physicists discover a new switch for superconductivity", "href": "https://phys.org/news/2023-06-physicists-superconductivity.html", "body": "Editors' notes Physicists discover a new switch for superconductivity by Jennifer Chu, Massachusetts Institute of Technology Credit: CC0 Public Domain Under certain conditions\u2014usually..."}, {"title": "Physicists discover a new switch for superconductivity", "href": "https://news.mit.edu/2023/physicists-discover-new-switch-superconductivity-0622", "body": "June 22, 2023 Press Inquiries Caption When some ultrathin materials undergo a \"nematic transition,\" their atomic lattice structure stretches in ways that unlock superconductivity (as this conceptual image shows). MIT physicists have identified how this essential nematic switch occurs in one class of superconductors. Credits Image: iStock"}]
\ No newline at end of file
diff --git a/outputs/What are the most recent advancements in the domain of superconductors as of 2023/research-6554312988458864116.txt b/outputs/What are the most recent advancements in the domain of superconductors as of 2023/research-6554312988458864116.txt
new file mode 100644
index 0000000000000000000000000000000000000000..57c998327d072c312a137a961573ff2869b0b60d
--- /dev/null
+++ b/outputs/What are the most recent advancements in the domain of superconductors as of 2023/research-6554312988458864116.txt
@@ -0,0 +1 @@
+[{"title": "Korea Superconductor Experts Seek to Test Breakthrough Claims", "href": "https://www.bloomberg.com/news/articles/2023-08-03/korea-superconductor-experts-seek-to-test-breakthrough-claims", "body": "August 3, 2023 at 4:23 AM EDT. South Korean experts created a committee to verify claims about a potential breakthrough in superconductor technology that have been driving both excitement and ..."}, {"title": "Viral New Superconductivity Claims Leave Many Scientists Skeptical ...", "href": "https://www.scientificamerican.com/article/viral-new-superconductivity-claims-leave-many-scientists-skeptical/", "body": "By Dan Garisto on July 27, 2023. Demonstration of superconductivity, special material cooled with liquid nitrogen. Credit: Forance/Alamy Stock Photo. If rumor has wings, extraordinary..."}, {"title": "What's an Ambient Superconductor and Why the Buzz About LK-99?", "href": "https://www.washingtonpost.com/business/energy/2023/08/03/room-temperature-superconductor-and-lk-99-what-to-know/ec47ab44-31ce-11ee-85dd-5c3c97d6acda_story.html", "body": "Superconductivity is having a moment. The concept of developing techniques for transporting electricity with no resistance is tantalizing because it has the potential to revolutionize the energy ..."}]
\ No newline at end of file
diff --git a/outputs/What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023/research--1921511018874273162.txt b/outputs/What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023/research--1921511018874273162.txt
new file mode 100644
index 0000000000000000000000000000000000000000..b61ad44a313d2bdaf871117691e6f19459838660
--- /dev/null
+++ b/outputs/What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023/research--1921511018874273162.txt
@@ -0,0 +1 @@
+[{"title": "Is Bitcoin Legal? - Investopedia", "href": "https://www.investopedia.com/ask/answers/121515/bitcoin-legal-us.asp", "body": "As of June 2021, bitcoin was legal in the U.S., Japan, the U.K., and most other developed countries. In general, it is necessary to look at bitcoin laws in specific countries. In the U.S., the IRS ..."}, {"title": "Can Government Regulation Affect Bitcoin Prices? - Investopedia", "href": "https://www.investopedia.com/news/can-government-regulation-affect-bitcoin-prices/", "body": "Government regulation might be one of them. In a June note, analysts at Morgan Stanley suggested that government regulation might be a factor influencing bitcoin prices. According to them ..."}, {"title": "How legal is Bitcoin and Crypto Currencies? - CryptoCompare", "href": "https://www.cryptocompare.com/coins/guides/how-legal-is-bitcoin-and-crypto-currencies", "body": "The use, trading and mining of Bitcoins is considered legal and the Australian Taxation office has announced its intention to incorporate guidelines on capital gains tax and VAT taxes. New Zealand - The Kiwi stance to Bitcoin can be gleamed from the Governor of the Central Banks belief that digital currencies have the potential to supplant cash."}]
\ No newline at end of file
diff --git a/outputs/What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023/research--7815519697487258378.txt b/outputs/What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023/research--7815519697487258378.txt
new file mode 100644
index 0000000000000000000000000000000000000000..32ee79578862dc126e7963d1161ed11a451edc35
--- /dev/null
+++ b/outputs/What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023/research--7815519697487258378.txt
@@ -0,0 +1 @@
+[{"title": "Bitcoin Is In For A Wild Ride In 2023: Here Are The Predictions - Forbes", "href": "https://www.forbes.com/sites/qai/2023/01/05/bitcoin-is-in-for-a-wild-ride-in-2023-here-are-the-predictions/", "body": "Getty Images Key takeaways Bitcoin price predictions range from $250,000 all the way down to $5,000. Inflation is a key factor in Bitcoin's price in 2023. Some believe that this year could..."}, {"title": "Bitcoin (BTC) mid-year update: Market experts predict prices for 2023", "href": "https://www.cnbc.com/2023/07/18/bitcoin-btc-mid-year-update-market-experts-predict-prices-for-2023.html", "body": "After an 80% rally for bitcoin, market experts predict where it's going next in 2023. Published Mon, Jul 17 20238:04 PM EDT Updated Wed, Jul 26 20232:06 PM EDT. Ryan Browne @Ryan_Browne_. Share ..."}, {"title": "Bitcoin Prediction: Will Bitcoin Rise Even More in 2023? - U.S. News", "href": "https://money.usnews.com/investing/cryptocurrency/articles/bitcoin-prediction-will-bitcoin-rise-even-more-in-2023", "body": "As usual, with a closer look at any period of market asset volatility, some context is required. \"Yes, Bitcoin is up 41% between Jan. 1, 2023, and Feb. 28, 2023,\" says Jordan Taylor, an ..."}]
\ No newline at end of file
diff --git a/outputs/What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023/research-3771585635681793337.txt b/outputs/What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023/research-3771585635681793337.txt
new file mode 100644
index 0000000000000000000000000000000000000000..fda1955932bcfc6d3a3c58077a57ec46f49eef1f
--- /dev/null
+++ b/outputs/What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023/research-3771585635681793337.txt
@@ -0,0 +1 @@
+[{"title": "The Biggest Risks Of Investing In Bitcoin - Forbes", "href": "https://www.forbes.com/sites/forbesbusinesscouncil/2021/06/17/the-biggest-risks-of-investing-in-bitcoin/", "body": "Bitcoin isn't money. Another reason that Bitcoin is so risky is that it is a tradeable asset but it is not backed by anything. Bitcoin has value only because the people who are trading it say it ..."}, {"title": "The Top 10 Risks Of Bitcoin Investing (And How To Avoid Them) - Forbes", "href": "https://www.forbes.com/sites/forbesfinancecouncil/2018/12/05/the-top-10-risks-of-bitcoin-investing-and-how-to-avoid-them/", "body": "With a currency that is 100% technology-based, bitcoin owners are more vulnerable to cyberthreats, online fraud and a system that can be shut down. 5. Block Withholding. New bitcoins are created ..."}, {"title": "Here Are Bitcoin's 3 Biggest Risks | The Motley Fool", "href": "https://www.fool.com/investing/2022/05/11/here-are-bitcoins-3-biggest-risks/", "body": "The threat of regulation. Unsurprisingly, perhaps the single largest risk facing Bitcoin, and cryptocurrencies more generally, is the threat of tighter regulation. In 2021, China, the world's ..."}]
\ No newline at end of file
diff --git a/outputs/What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023/research-6414966712890420499.txt b/outputs/What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023/research-6414966712890420499.txt
new file mode 100644
index 0000000000000000000000000000000000000000..eee0adba5ec1f067be5abcaf50593ccd4a940db9
--- /dev/null
+++ b/outputs/What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023/research-6414966712890420499.txt
@@ -0,0 +1 @@
+[{"title": "Key Considerations for Corporate Investment in Bitcoin - MicroStrategy", "href": "https://www.microstrategy.com/en/bitcoin/documents/key-considerations-for-corporate-investment-in-bitcoin", "body": "Download this playbook for a summary of key considerations corporations should keep in mind when investing in bitcoin.---MicroStrategy Bitcoin Initiative - Open Source Documents These documents are being provided to serve as a resource to help as you navigate a corporate bitcoin strategy."}, {"title": "Factors to Consider While Investing in Crypto - The Top Coins", "href": "https://thetopcoins.com/blog/factors-consider-while-investing-crypto", "body": "This blog can be used as a guideline better to assess the current market and potential risks and opportunities. Generally, when you are looking for the best cryptocurrencies to invest in, two main factors that should lure you in: 1) Market capitalisation: 153,000,000 (BTC's Market Cap) 2) Liquidity level: High/Good."}, {"title": "How To Invest In Bitcoin For Beginners", "href": "https://www.forbes.com/sites/qai/2023/02/14/how-to-invest-in-bitcoin-for-beginners/", "body": "getty Key takeaways As cryptocurrency's popularity grows, more and more retail investors have considered adding bitcoin to their portfolios Cryptocurrencies offer unique diversification and..."}]
\ No newline at end of file
diff --git a/outputs/What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023/research-7910004084663060634.txt b/outputs/What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023/research-7910004084663060634.txt
new file mode 100644
index 0000000000000000000000000000000000000000..c89646e73f282b868409cc86cc067e7dc2f5a708
--- /dev/null
+++ b/outputs/What constitutes the optimal approach for investing in the Bitcoin industry during the year 2023/research-7910004084663060634.txt
@@ -0,0 +1 @@
+[{"title": "How To Invest In Bitcoin For Beginners", "href": "https://www.forbes.com/sites/qai/2023/02/14/how-to-invest-in-bitcoin-for-beginners/", "body": "Investing in bitcoin as a beginner requires time and research to understand the asset and set up a crypto wallet If you want to learn how to invest in bitcoin for beginners, Q.ai's Crypto Kit..."}, {"title": "Exploring Bitcoin As a Retirement Investment Avenue", "href": "https://www.entrepreneur.com/finance/exploring-bitcoin-as-a-retirement-investment-avenue/456912", "body": "Market Conditions. When exploring Bitcoin as a retirement investment option, it's essential to carefully analyze the existing market landscape. Bitcoin, renowned for its substantial price ..."}, {"title": "How The Bitcoin Ecosystem Works - Forbes", "href": "https://www.forbes.com/sites/digital-assets/article/how-the-bitcoin-ecosystem-works/", "body": "The most important stakeholders in the decentralized bitcoin ecosystem include node operators, who distribute blockchain data, bitcoin miners, who confirm bitcoin transactions in exchange for..."}]
\ No newline at end of file
diff --git a/outputs/What should I do to improve my writing skill/research--1929572254396490612.txt b/outputs/What should I do to improve my writing skill/research--1929572254396490612.txt
new file mode 100644
index 0000000000000000000000000000000000000000..b705311c1d26a299bdd1c48379b2b8cb2b7a8822
--- /dev/null
+++ b/outputs/What should I do to improve my writing skill/research--1929572254396490612.txt
@@ -0,0 +1 @@
+[{"title": "7 Ways to Improve Your Writing Skills | Coursera", "href": "https://www.coursera.org/articles/writing-skills", "body": "How to improve your writing skills Writing, like any other skill, is something we can get better at with time and practice. Here are some strategies for developing your own written communication: 1. Review grammar and spelling basics. Grammar and spelling form the foundation of good writing."}, {"title": "How to Improve Writing Skills in 15 Easy Steps | Grammarly", "href": "https://www.grammarly.com/blog/how-to-improve-writing-skills/", "body": "8 Stick with simple words. Bestselling author John Grisham said, \"There are three types of words: (1) words we know; (2) words we should know; (3) words nobody knows. Forget those in the third category and use restraint with those in the second.\". There's a difference between having a rich vocabulary and dropping million-dollar words into ..."}, {"title": "5 Steps to Improve Writing Skills - Purdue University Global", "href": "https://www.purdueglobal.edu/blog/general-education/5-steps-improve-writing-skills/", "body": "Step 3: Consider Using a Writing Improvement App. One place to begin improving basic writing skills is using a writing improvement app or add-on such as ProWritingAid, ZohoWriter, or Writing Assistant. Writing improvement apps help people identify and improve basic writing skills deficits while they complete everyday tasks such as emails, texts ..."}]
\ No newline at end of file
diff --git a/outputs/What should I do to improve my writing skill/research--2846960322830385893.txt b/outputs/What should I do to improve my writing skill/research--2846960322830385893.txt
new file mode 100644
index 0000000000000000000000000000000000000000..4e5d36e59c9293b05d6d4804fac7e9a64ae6e6fe
--- /dev/null
+++ b/outputs/What should I do to improve my writing skill/research--2846960322830385893.txt
@@ -0,0 +1 @@
+[{"title": "How to Practice Writing: 10 Tips for Honing Your Writing Skills", "href": "https://www.masterclass.com/articles/how-to-practice-writing", "body": "How to Practice Writing: 10 Tips for Honing Your Writing Skills - 2023 - MasterClass Writing How to Practice Writing: 10 Tips for Honing Your Writing Skills Written by MasterClass Last updated: Sep 6, 2021 \u2022 3 min read Professional authors make the act of writing a regular occurrence\u2014often a daily routine."}, {"title": "How to Improve Writing Skills in 15 Easy Steps | Grammarly", "href": "https://www.grammarly.com/blog/how-to-improve-writing-skills/", "body": "8 Stick with simple words. Bestselling author John Grisham said, \"There are three types of words: (1) words we know; (2) words we should know; (3) words nobody knows. Forget those in the third category and use restraint with those in the second.\". There's a difference between having a rich vocabulary and dropping million-dollar words into ..."}, {"title": "6 Writing Exercises to Practice and Improve Your Writing Skills", "href": "https://www.masterclass.com/articles/writing-exercises-to-practice-and-improve-your-writing-skills", "body": "6 Writing Exercises to Practice and Improve Your Writing Skills. A good writer doesn't become a great writer overnight. Improving your writing skills requires hard work and constant practice on a regular basis. Even the best writers perform various writing exercises to keep their abilities sharp and the creativity flowing."}]
\ No newline at end of file
diff --git a/outputs/What should I do to improve my writing skill/research-1235174067265827772.txt b/outputs/What should I do to improve my writing skill/research-1235174067265827772.txt
new file mode 100644
index 0000000000000000000000000000000000000000..c3d1e1ae5bab519a14e05b4a639b700eb0fc5b86
--- /dev/null
+++ b/outputs/What should I do to improve my writing skill/research-1235174067265827772.txt
@@ -0,0 +1 @@
+[{"title": "7 Ways to Improve Your Writing Skills | Coursera", "href": "https://www.coursera.org/articles/writing-skills", "body": "1. Review grammar and spelling basics. Grammar and spelling form the foundation of good writing. Writing with proper grammar and spelling communicates your professionality and attention to detail to your reader. It also makes your writing easier to understand."}, {"title": "How to Improve Writing Skills in 15 Easy Steps | Grammarly", "href": "https://www.grammarly.com/blog/how-to-improve-writing-skills/", "body": "8 Stick with simple words. Bestselling author John Grisham said, \"There are three types of words: (1) words we know; (2) words we should know; (3) words nobody knows. Forget those in the third category and use restraint with those in the second.\". There's a difference between having a rich vocabulary and dropping million-dollar words into ..."}, {"title": "8 Awesome Resources to Help You Improve Your Writing Skills - TakeLessons", "href": "https://takelessons.com/blog/improve-writing-skills", "body": "There are so many resources out there to help you improve writing skills and vocabulary! Check out our favorites here."}]
\ No newline at end of file
diff --git a/outputs/What should I do to improve my writing skill/research-5995941590975656206.txt b/outputs/What should I do to improve my writing skill/research-5995941590975656206.txt
new file mode 100644
index 0000000000000000000000000000000000000000..953b4334650ae8ae7ca982a9144cf973f3fddb6e
--- /dev/null
+++ b/outputs/What should I do to improve my writing skill/research-5995941590975656206.txt
@@ -0,0 +1 @@
+[{"title": "How to Improve Writing Skills in 15 Easy Steps | Grammarly", "href": "https://www.grammarly.com/blog/how-to-improve-writing-skills/", "body": "8 Stick with simple words. Bestselling author John Grisham said, \"There are three types of words: (1) words we know; (2) words we should know; (3) words nobody knows. Forget those in the third category and use restraint with those in the second.\". There's a difference between having a rich vocabulary and dropping million-dollar words into ..."}, {"title": "7 Ways to Improve Your Writing Skills | Coursera", "href": "https://www.coursera.org/articles/writing-skills", "body": "1. Review grammar and spelling basics. Grammar and spelling form the foundation of good writing. Writing with proper grammar and spelling communicates your professionality and attention to detail to your reader. It also makes your writing easier to understand."}, {"title": "What Are Writing Skills and How Do You Improve Them? | The Muse", "href": "https://www.themuse.com/advice/writing-skills-examples-how-to-improve", "body": "Even if you're not in a job where writing is a core component of your professional duties, you probably use your writing skills every day to communicate with others through text (whether it's over email or Slack, in a monthly or quarterly report, in the form of a project update, or otherwise)."}]
\ No newline at end of file
diff --git a/outputs/What should I do to improve my writing skill/research-698422812247046689.txt b/outputs/What should I do to improve my writing skill/research-698422812247046689.txt
new file mode 100644
index 0000000000000000000000000000000000000000..04b1a372a5392c0c0778e54ced057878d1537bde
--- /dev/null
+++ b/outputs/What should I do to improve my writing skill/research-698422812247046689.txt
@@ -0,0 +1 @@
+[{"title": "How to Become a Better Writer: 20 Hacks and Tips - Reedsy", "href": "https://blog.reedsy.com/how-to-become-a-better-writer/", "body": "1. Start by spending more time writing. In Outliers, Malcolm Gladwell famously claims that it takes 10,000 hours of practice to achieve greatness in any skill. Even if you only put in two hours more per week than usual, any increase in the time you spend writing will accelerate your improvement."}, {"title": "How To Become a Better Writer: 11 Steps for Success", "href": "https://www.indeed.com/career-advice/career-development/how-to-become-a-better-writer", "body": "Amber Krosel Updated February 3, 2023 If you're a new or seasoned writer, improving your writing skill set may help you master your craft, find more job opportunities and create a reputation for quality writing. Writing can take some time to master, but with the right steps, you can start improving your writing almost immediately."}, {"title": "7 Ways to Improve Your Writing Skills | Coursera", "href": "https://www.coursera.org/articles/writing-skills", "body": "Here are some strategies for developing your own written communication: 1. Review grammar and spelling basics. Grammar and spelling form the foundation of good writing. Writing with proper grammar and spelling communicates your professionality and attention to detail to your reader. It also makes your writing easier to understand."}]
\ No newline at end of file
diff --git a/outputs/Why is feature engineering important in financial forecasting/research--7260079429866833403.txt b/outputs/Why is feature engineering important in financial forecasting/research--7260079429866833403.txt
new file mode 100644
index 0000000000000000000000000000000000000000..20fbf143588208a91768a3a94b165e10a5ddb57b
--- /dev/null
+++ b/outputs/Why is feature engineering important in financial forecasting/research--7260079429866833403.txt
@@ -0,0 +1 @@
+[{"title": "Survey of feature selection and extraction techniques for stock market ...", "href": "https://jfin-swufe.springeropen.com/articles/10.1186/s40854-022-00441-7", "body": "In stock market forecasting, the identification of critical features that affect the performance of machine learning (ML) models is crucial to achieve accurate stock price predictions. Several review papers in the literature have focused on various ML, statistical, and deep learning-based methods used in stock market forecasting. However, no survey study has explored feature selection and ..."}, {"title": "Feature Engineering for Predictive Modeling: A Guide - LinkedIn", "href": "https://www.linkedin.com/advice/3/how-do-you-use-feature-engineering-improve", "body": "Encoding, scaling, binning, aggregation, and transformation are some common techniques for creating features. For example, one-hot encoding or label encoding can be used to encode categorical..."}, {"title": "Financial Forecasting: How to Do It with Different Methods, Models ...", "href": "https://blog.hubspot.com/sales/financial-forecasting", "body": "1. What is financial forecasting? Forecasting vs. Budgeting 2. Financial Forecasting Models Top-Down Financial Forecasting Delphi Financial Forecasting Statistical Forecasting Bottom-Up Financial Forecasting 3. Financial Forecasting Methods Straight Line Simple Linear Regression Multiple Linear Regression Moving Average 4."}]
\ No newline at end of file
diff --git a/outputs/Why is feature engineering important in financial forecasting/research--7937428013352407195.txt b/outputs/Why is feature engineering important in financial forecasting/research--7937428013352407195.txt
new file mode 100644
index 0000000000000000000000000000000000000000..81753ae0790dd04a4f686b83705b6d3c587b35bc
--- /dev/null
+++ b/outputs/Why is feature engineering important in financial forecasting/research--7937428013352407195.txt
@@ -0,0 +1 @@
+[{"title": "A Step-by-Step Guide to Feature Engineering for Multivariate Time ...", "href": "https://towardsdatascience.com/a-step-by-step-guide-to-feature-engineering-for-multivariate-time-series-162ccf232e2f", "body": "Automated Feature Engineering. Feature engineering involves extracting and curating explanatory variables. It is a key stage in any data science project. The quality of the features is a central aspect of the performance of models. Because of this, data scientists spend a lot of time in this process. Yet, feature engineering is often an ad-hoc ..."}, {"title": "FP&A Tips: How to Improve Forecasting Accuracy in 2023? - Abacum", "href": "https://www.abacum.io/blog/6-ways-to-improve-forecast-accuracy", "body": "According to FP&A trends, \"The forecast is accurate if the actuals tend to match the forecast within \"small\" variances.\" Another definition they highlighted states, \"The forecast is accurate when all the assumptions and decisions are sound, correctly captured, sized and timed to.\""}, {"title": "A Comparative Study of Demand Forecasting Models for a Multi-Channel ...", "href": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9514716/", "body": "A hybrid genetic algorithm-based XGBoost forecasting methodology is developed. This study empirically demonstrates the significance of feature engineering in forecasting the prices of stocks: Wang et al. To overcome the challenges of predicting rental bike demand on an hourly basis, a data mining technique is used."}]
\ No newline at end of file
diff --git a/outputs/Why is feature engineering important in financial forecasting/research--8497491436117821687.txt b/outputs/Why is feature engineering important in financial forecasting/research--8497491436117821687.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3412ee73de6e0cf27c2e5fc711322e4022e61831
--- /dev/null
+++ b/outputs/Why is feature engineering important in financial forecasting/research--8497491436117821687.txt
@@ -0,0 +1 @@
+[{"title": "Feature Engineering for Predictive Modeling: A Guide - LinkedIn", "href": "https://www.linkedin.com/advice/3/how-do-you-use-feature-engineering-improve", "body": "Learn more \u2014 The LinkedIn Team Last updated on Apr 27, 2023 Feature engineering is a crucial step in predictive modeling, where you transform raw data into meaningful and useful features for..."}, {"title": "Survey of feature selection and extraction ... - Financial Innovation", "href": "https://jfin-swufe.springeropen.com/articles/10.1186/s40854-022-00441-7", "body": "Different types of technical in- dicators, such as stochastic oscillator, moving averages, and relative strength index (RSI), are used in prediction models, and the effectiveness of these input features for future stock market forecasting is studied."}, {"title": "Discrete Wavelet Transform-based feature engineering for ... - Springer", "href": "https://link.springer.com/article/10.1007/s41870-023-01157-2", "body": "CSO is used for the feature selection and to get the optimal feature set. As per the authors' best knowledge none of the existing studies had used CSO for feature selection in financial TS analysis. The proposed feature engineering component is named as DWT-CSO. For stock market trend prediction, ML and DL models are used."}]
\ No newline at end of file
diff --git a/outputs/Why is feature engineering important in financial forecasting/research--8811703707667059559.txt b/outputs/Why is feature engineering important in financial forecasting/research--8811703707667059559.txt
new file mode 100644
index 0000000000000000000000000000000000000000..80980a0525cb282733cf4292ee94938092cd222c
--- /dev/null
+++ b/outputs/Why is feature engineering important in financial forecasting/research--8811703707667059559.txt
@@ -0,0 +1 @@
+[{"title": "Survey of feature selection and extraction ... - Financial Innovation", "href": "https://jfin-swufe.springeropen.com/articles/10.1186/s40854-022-00441-7", "body": "In stock market forecasting, the identification of critical features that affect the performance of machine learning (ML) models is crucial to achieve accurate stock price predictions. Several review papers in the literature have focused on various ML, statistical, and deep learning-based methods used in stock market forecasting."}, {"title": "(PDF) Feature Selection for Forecasting - ResearchGate", "href": "https://www.researchgate.net/publication/369035848_Feature_Selection_for_Forecasting", "body": "This work investigates the importance of feature selection for improving the forecasting performance of machine learning algorithms for financial data. Artificial neural networks (ANN ..."}, {"title": "Stock index trend prediction based on TabNet feature selection ... - PLOS", "href": "https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0269195", "body": "Fig 4 shows feature importance masks mask[i] that indicates feature ... Cui L. Deep learning-based feature engineering for stock price movement prediction. Knowledge-Based Systems. 2019; 164: 163-173. ... Ming LJ, Sumei R, Shuping Z. A hybrid model for financial time series forecasting\u2014integration of EWT, ARIMA with the improved ABC ..."}]
\ No newline at end of file
diff --git a/outputs/Why is feature engineering important in financial forecasting/research-6645279715195215869.txt b/outputs/Why is feature engineering important in financial forecasting/research-6645279715195215869.txt
new file mode 100644
index 0000000000000000000000000000000000000000..726cfd41baffcac05692c01522a920e529996b49
--- /dev/null
+++ b/outputs/Why is feature engineering important in financial forecasting/research-6645279715195215869.txt
@@ -0,0 +1 @@
+[{"title": "Feature Engineering: Processes, Techniques & Benefits in 2023", "href": "https://research.aimultiple.com/feature-engineering/", "body": "In this article, we'll explore what feature engineering is, what are its techniques, and how you can improve feature engineering efficiency. ... Features that are relevant to the problem and appropriate for the model would increase model accuracy. Irrelevant features, on the other hand, would result in \"Garbage in-Garbage out\" situation ..."}, {"title": "Feature Engineering | Snowflake", "href": "https://www.snowflake.com/guides/feature-engineering", "body": "Regardless of how much algorithms continue to improve, feature engineering continues to be a difficult process that requires human intelligence with domain expertise. In the end, the quality of feature engineering often drives the quality of a machine learning model. ... Financial Services. Healthcare & Life Sciences. Manufacturing. Public ..."}, {"title": "What Is Feature Engineering and why should it be automated?", "href": "https://www.explorium.ai/blog/what-is-feature-engineering/", "body": "What is feature engineering, and why should you automate it? In this blog post, we answer these questions and more. Platform. External Data Platform; Integrations; API. Overview; ... working out which features are most relevant to your dataset and which have the biggest impact on the accuracy of your model. It will then present around 50-100 ..."}]
\ No newline at end of file
diff --git a/processing/__init__.py b/processing/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/processing/__pycache__/__init__.cpython-311.pyc b/processing/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..7f38bba09ed46e0ff90e3bd08f28681a96d7fb26
Binary files /dev/null and b/processing/__pycache__/__init__.cpython-311.pyc differ
diff --git a/processing/__pycache__/__init__.cpython-39.pyc b/processing/__pycache__/__init__.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e7869baaaa5fd5d516a3833e9ac027b9f6ae0e43
Binary files /dev/null and b/processing/__pycache__/__init__.cpython-39.pyc differ
diff --git a/processing/__pycache__/html.cpython-311.pyc b/processing/__pycache__/html.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..985cfa4f0d9f93fd9865d217660d30946b17190b
Binary files /dev/null and b/processing/__pycache__/html.cpython-311.pyc differ
diff --git a/processing/__pycache__/html.cpython-39.pyc b/processing/__pycache__/html.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..43df0c711cbfa35be98f5aec9dcdf94638d6380b
Binary files /dev/null and b/processing/__pycache__/html.cpython-39.pyc differ
diff --git a/processing/__pycache__/text.cpython-311.pyc b/processing/__pycache__/text.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..4a05d3e26dc1d595a531d0e4963d13f86c4a4927
Binary files /dev/null and b/processing/__pycache__/text.cpython-311.pyc differ
diff --git a/processing/__pycache__/text.cpython-39.pyc b/processing/__pycache__/text.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..a68d99d52f255a341574af4074a799b17cf6bf11
Binary files /dev/null and b/processing/__pycache__/text.cpython-39.pyc differ
diff --git a/processing/text.py b/processing/text.py
new file mode 100644
index 0000000000000000000000000000000000000000..1431f5a358471025eae12aaf6f4d23264b682dcd
--- /dev/null
+++ b/processing/text.py
@@ -0,0 +1,18 @@
+"""Text processing functions"""
+from typing import Dict, Generator
+
+from config import Config
+import os
+
+CFG = Config()
+
+
+def read_txt_files(directory):
+ all_text = ''
+
+ for filename in os.listdir(directory):
+ if filename.endswith('.txt'):
+ with open(os.path.join(directory, filename), 'r') as file:
+ all_text += file.read() + '\n'
+
+ return all_text
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000000000000000000000000000000000000..11cd16d7e02889809b13a8d8a1e32238297abc6e
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,7 @@
+beautifulsoup4==4.12.2
+colorama==0.4.6
+gradio==3.38.0
+openai==0.27.8
+python-dotenv==1.0.0
+Requests==2.31.0
+duckduckgo-search==3.8.4
diff --git a/statics/README_zh.md b/statics/README_zh.md
new file mode 100644
index 0000000000000000000000000000000000000000..085e72d90959000940039aff30c11b584b3c9150
--- /dev/null
+++ b/statics/README_zh.md
@@ -0,0 +1,41 @@
+