{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import os\n", "import json\n", "from pathlib import Path\n", "from langchain.text_splitter import TokenTextSplitter, CharacterTextSplitter\n", "from langchain.embeddings.openai import OpenAIEmbeddings\n", "from langchain.vectorstores import Chroma, Qdrant\n", "from langchain.document_loaders import TextLoader\n", "\n", "class bcolors:\n", " HEADER = '\\033[95m'\n", " OKBLUE = '\\033[94m'\n", " OKCYAN = '\\033[96m'\n", " OKGREEN = '\\033[92m'\n", " WARNING = '\\033[93m'\n", " FAIL = '\\033[91m'\n", " ENDC = '\\033[0m'\n", " BOLD = '\\033[1m'\n", " UNDERLINE = '\\033[4m'" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "D:\\00Repos\\GPT-Swarm\\keys.json\n" ] } ], "source": [ "keys_file = Path(\".\").resolve().parent / \"keys.json\"\n", "print(keys_file)\n", "with open(keys_file) as f:\n", " keys = json.load(f)\n", "os.environ[\"OPENAI_API_KEY\"] = keys[\"OPENAI_API_KEY\"]" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "embeddings = OpenAIEmbeddings()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Using embedded DuckDB with persistence: data will be stored in: D:\\00Repos\\GPT-Swarm\\tmp\\swarm\\shared_memory\n" ] } ], "source": [ "persist_directory = Path(\"D:\\\\00Repos\\\\GPT-Swarm\\\\tmp\\\\swarm\\\\shared_memory\")\n", "vectordb = Chroma(persist_directory=str(persist_directory), embedding_function=embeddings)\n", "retriever_chroma = vectordb.as_retriever(search_type=\"mmr\")" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1752" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "vectordb._collection.count()" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "from langchain.chat_models import ChatOpenAI\n", "from langchain.chains import ConversationalRetrievalChain, RetrievalQA\n", "from langchain.chains.question_answering import load_qa_chain" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "model = ChatOpenAI(model='gpt-3.5-turbo', temperature=0.2) # 'ada' 'gpt-3.5-turbo' 'gpt-4',\n", "qa_chain = load_qa_chain(model, chain_type=\"stuff\")\n", "qa = RetrievalQA(combine_documents_chain=qa_chain, retriever=retriever_chroma)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "=====================================================================================================\n", "=====================================================================================================\n", "\u001b[94m**Question**:\u001b[0m Generate a comprehensive description of the startup. Describe their value proposition, the product, USP and business model of a startup. \n", "\n", "\u001b[92m**Answer**\u001b[0m: Brainamics is a startup that specializes in the development of brain computer interfaces through neurotechnology. Their product is a tool for objective measurement of subjective experiences through mind/body state interpretation. Their unique selling proposition is their cutting-edge technology that has the potential to disrupt multiple industries. Their business model seems to be well-suited for scaling quickly and generating significant revenue. Based on the available information, it is recommended to invest in Brainamics. \n", "\n", "Sources:\n", "- Brain Computer Interface Wiki: https://bciwiki.org/index.php/Brainamics\n", "- LinkedIn: https://www.linkedin.com/company/brainamics/\n", "- Brain Stream Podcast: https://rss.com/podcasts/brainstream/ \n", "\n", "=====================================================================================================\n", "=====================================================================================================\n", "\u001b[94m**Question**:\u001b[0m Find top 10 companies and startups in this field. Find out their locations, raised funding, value proposition, differentiation, etc. \n", "\n", "\u001b[92m**Answer**\u001b[0m: Startup: Brainamics\n", "- Brainamics is a neurotech startup from the Technical University of Munich that is developing a unique technology framework that enables the extraction of emotions directly from the human brain.\n", "- Brainamics has won several awards, including the Brain Awareness Week competition.\n", "- Brainamics' unique selling proposition is their cutting-edge technology that has the potential to disrupt multiple industries. Their business model also seems to be well-suited for scaling quickly and generating significant revenue. \n", "(Source: https://www.brainamics.com/)\n", "\n", "Top 10 companies and startups in the brain computer interface field (Locations, Raised funding, Value proposition, Differentiators):\n", "1. PlatoScience (Canada) - Funding: $3.3M, Value proposition: Next-gen neuroscience hardware platform for research institutions, Differentiator: Proprietary, open-source EEG hardware.\n", "(Source: https://www.crunchbase.com/organization/platoscience)\n", "2. Neurosphere (USA) - Funding: $2.2M, Value proposition: Develops a new generation of technological devices for neuroscientists, Differentiator: Focuses on developing wearable devices for cognitive assessment and diagnosis.\n", "(Source: https://www.startus-insights.com/innovators-guide/5-top-brain-computer-interface-startups-impacting-healthcare/)\n", "3. NextMind (France) - Funding: $5M, Value proposition: brain-sensing wearable device that allows the user to control digital interfaces using their thoughts, Differentiator: Uses non-invasive sensors to track visual attention, Unique and patented algorithms are applied to extract relevant signals from the EEG.\n", "(Source: https://www.next-mind.com/)\n", "4. RxFunction (USA) - Funding: $12.7M, Value proposition: Wearable sensory substitution system to treat balance disorders, Differentiator: The first, non-invasive sensory substitution system that restores balance function.\n", "(Source: https://www.crunchbase.com/organization/rxfunction)\n", "5. Beddr (USA) - Funding: $9.7M, Value proposition: Precision medicine for sleep, Differentiator: Uses a small, wearable device and smartphone application to provide personalized recommendations and treatment.\n", "(Source: https://www.crunchbase.com/organization/beddr)\n", "6. IBM (USA) - Funding: N/A, Value proposition: Cognitive computing and artificial intelligence, Differentiator: Focuses on developing machine learning algorithms and analytics to interpret data from brain-computer interfaces.\n", "(Source: https://www.ibm.com/watson/health/value-based-care/brain-injury-detection/)\n", "7. CTRL-Labs Inc. (USA) - Funding: $67M, Value proposition: Develops a neural interface to decode and encode neural signals from the brain, Differentiator: Acquired by Facebook Inc. on 2019 to work on non-invasive brain-computer interfaces.\n", "(Source: https://ctrl-labs.com/about)\n", "8. Neuralink (USA) - Funding: $363M, Value proposition: Develops implantable brain-machine interface, Differentiator: Puts attention on the development in a wide range of implantable devices that can interpret and encode signals from specific areas of the brain.\n", "(Source: https://www.neuralink.com/)\n", "9. Mass Device (USA) - Value proposition: An online news outlet with updates on medical devices and news in the medtech industry, Differentiator: Provides news in the medical device industry related to brain-computer interfaces, among others.\n", "(Source: https://www.massdevice.com)\n", "10. CB Insights (USA) - Value proposition: A tech market intelligence platform that predicts emerging themes and trends to offer insights on startup investing and industry innovation, Differentiator: Provides insights about disruptive startups in brain computer interface space and other emerging technologies.\n", "(Source: https://www.cbinsights.com/research/report/future-of-wearables-tech-trends/) \n", "\n", "=====================================================================================================\n", "=====================================================================================================\n", "\u001b[94m**Question**:\u001b[0m Find top 5 investors in this field. Includ specific details in the format of 'company AAA (link) invested in company BBB (link) $XX in year YYYY' \n", "\n", "\u001b[92m**Answer**\u001b[0m: Based on the track record of similar startups and their investments, Brainamics is worth investing in. However, I could not find a comprehensive list of the top 5 investors in this field. Here are two sources that provide information on investors in neurotech and brain computer interfaces:\n", "1. Ross Dawson: https://rossdawson.com/futurist/companies-creating-future/leading-brain-computer-interface-companies-bci/\n", "2. CB Insights: https://www.cbinsights.com/research/neurotech-startups-market-map/\n", "Brainamics' unique selling proposition is their cutting-edge technology that has the potential to disrupt multiple industries. \n", "\n", "=====================================================================================================\n", "=====================================================================================================\n", "\u001b[94m**Question**:\u001b[0m Describe the market size, growth rate and trends of this field. \n", "\n", "\u001b[92m**Answer**\u001b[0m: Brainamics is a neurotech startup from the Technical University of Munich that is developing a unique technology framework that enables the extraction of emotions directly from the human brain. [Neurotech, Brainamics, Brain Computer Interfaces] The size of the brain computer interface market is estimated to grow from $1.3 billion in 2019 to $6 billion by 2025, at a CAGR of 28.4%. [Market size, growth rate, trends] (source: https://www.marketsandmarkets.com/Market-Reports/brain-computer-interface-market-155811274.html) The potential of Brainamics for investment is supported by the track record of investors such as Mithril Capital Management, Lux Capital, and Andreessen Horowitz. [Investor track record] (source: https://www.brainamics.com/) \n", "\n", "=====================================================================================================\n", "=====================================================================================================\n", "\u001b[94m**Question**:\u001b[0m Main problems and challenges of the field. Create an extensive list of problems. What can stop the field from growing? What can stop the company from succeeding? \n", "\n", "\u001b[92m**Answer**\u001b[0m: Brainamics is a neurotech startup developing a technology framework that enables the extraction of emotions directly from the human brain. They have won awards, including the Brain Awareness Week competition. However, the field of brain-computer interfaces faces several challenges such as high development costs and regulatory hurdles from the FDA. (sources: https://www.brainamics.com/, https://www.raspberrypi.org/products/pieeg/) It is important for venture capital agencies to carefully evaluate the potential risks before investing in Brainamics. \n", "\n", "=====================================================================================================\n", "=====================================================================================================\n", "\u001b[94m**Question**:\u001b[0m Briefly describe the technology for the non-tech audience. Include links to the main articles in the field. \n", "\n", "\u001b[92m**Answer**\u001b[0m: Brainamics is a neurotech startup that is developing a technology framework to extract emotions from the human brain using brain computer interfaces (BCI). BCI is a device that measures EEG and other biosignals from the human brain. Brainamics' product has the potential to disrupt multiple industries and generate significant revenue. The company has won awards including the Brain Awareness Week competition. Top companies and startups in the BCI field include Neuralink, CTRL-Labs, Synchron, Kernel, Paradromics, Nia Therapeutics, Emotiv, NeuroSky, InteraXon, PlatoScience, Neurosphere, and Beddr. \n", "\n", "Sources:\n", "- Brainamics website: https://www.brainamics.com/\n", "- Raspberry Pi EEG: https://www.raspberrypi.org/products/pieeg/\n", "- StartUs Insights article: https://www.startus-insights.com/innovators-guide/5-top-brain-computer-interface-startups-impacting-engineering/ \n", "\n", "=====================================================================================================\n", "=====================================================================================================\n", "\u001b[94m**Question**:\u001b[0m What questions should we ask the startup to make a more informed decision? Avoid generic and obvious questions and focus on field/domain specific questions that can uncover problems with this specific startup. \n", "\n", "\u001b[92m**Answer**\u001b[0m: 1. Can you explain in detail the proprietary technology framework that enables the extraction of emotions directly from the human brain? [Brainamics, Neurotech, Brain Computer Interfaces] (source: https://www.brainamics.com/)\n", "\n", "2. How do you plan to monetize your product or service? [Brainamics, Monetization, Brain Computer Interfaces] \n", "\n", "3. Can you provide any concrete examples of your technology being successfully used in real-world applications? [Brainamics, Real-world Applications, Brain Computer Interfaces] \n", "\n", "4. What is your plan for scaling and expanding the business in the near future? [Brainamics, Scaling, Brain Computer Interfaces] \n", "\n", "5. Who are your competitors in the industry, and how does Brainamics differentiate itself from them? [Brainamics, Competition, Brain Computer Interfaces] (source: https://www.raspberrypi.org/products/pieeg/) \n", "\n", "6. Who are your target customers, and have you conducted market research to validate the demand for your product? [Brainamics, Market Research, Brain Computer Interfaces] \n", "\n", "By asking these specific questions, we can gain a better understanding of the startup's technology, business model, potential customers, and competition in the industry. This will help us make a more informed decision on whether or not to invest in Brainamics. \n", "\n" ] } ], "source": [ "context = (\n", " \"A new startup just send us their pitch. Find if the startup is worth investing in. The startup is called Brainamics and it is in the space of brain computer interfaces.\"\n", ")\n", "\n", "questions = [\n", " \"Generate a comprehensive description of the startup. Describe their value proposition, the product, USP and business model of a startup.\",\n", " \"Find top 10 companies and startups in this field. Find out their locations, raised funding, value proposition, differentiation, etc.\",\n", " \"Find top 5 investors in this field. Includ specific details in the format of 'company AAA (link) invested in company BBB (link) $XX in year YYYY'\",\n", " \"Describe the market size, growth rate and trends of this field.\",\n", " \"Main problems and challenges of the field. Create an extensive list of problems. What can stop the field from growing? What can stop the company from succeeding?\",\n", " \"Briefly describe the technology for the non-tech audience. Include links to the main articles in the field.\",\n", " \"What questions should we ask the startup to make a more informed decision? Avoid generic and obvious questions and focus on field/domain specific questions that can uncover problems with this specific startup.\"\n", "]\n", "\n", "for question in questions: \n", " result = qa.run(context+question+\"Be very brief and concise. Focus on the essential information and provide https links to the sources.\")\n", " print(f\"=====================================================================================================\")\n", " print(f\"=====================================================================================================\")\n", " print(f\"{bcolors.OKBLUE }**Question**:{bcolors.ENDC } {question} \\n\")\n", " print(f\"{bcolors.OKGREEN }**Answer**{bcolors.ENDC }: {result} \\n\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": ".venv_gptswarm", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.6" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }