Inspiration

Market strategists from different asset management firms are publishing their views on U.S. economic and markets on various social medias, and most of the articles are published weekly. These articles have a lot of valuable insights and are prepared by a group of smart and talented market researchers. However, most of us don't read them because it is usually long, and most of us are not wealthy enough to get a chance to consult a market strategist. We want to come up with a solution so the average investors can ask numerous questions and get insights from the market strategist.

What it does

This chatbot use the multi shot learning with the latest market insight material on the internet, and can answer questions like a market strategist. We can chain the questions and answers to form a conversation.

How we built it

  • This POC app use langchain, openAI embedding model, and LLM either Dolly or OpenAI. For Demo purpose, I use OpenAI.
  • We first collect the market insight articles published on May from LinkedIn, and the articles focus on debt ceiling, possibility of 2023 recession, and recommended 2023 asset allocation .
  • We use langchain's in memory vector store and openAI embedding model to build the vector store of the articles with the chunk size of 1000
  • We use vector store's similar search to get the related context for the query, and then fire off the query to the LLM (dolly or OpenAI) to get answer
  • We chain the chat history using langchain's chain functionality to build a conversation

Challenges we ran into

  1. Collecting articles from social media required manual copy and paste. This is the biggest challenge if we want to scale.
  2. Not enough details on langchain usage documentation. A lot of google search (chatapi does not know anything about langchain) and digging into the code base of langchain were needed to write a few lines of langchain code to do the job. This will be an issue on support and wider adoption of langchain.

Accomplishments that we're proud of

With a small number of market insight articles, the market strategist chatbot accurately reflect the view and answers the question on recession and asset class to invest in for year 2023.

What we learned

  • Data collection and transformation is the most difficult and time consuming task.
  • LLM can extend its knowledge with very small set of context information.
  • The vector similar search is great, but need a scalable solution to store larger amount of vector context data. Google Scan can be an option

What's next for U.S. Market Pro Chat Bot

  • Remove the manual step to collect market insight data
  • Use a vector store to store larger volume of data
  • Build a web and mobile UI for regular user to interact with

Built With

  • jupyter
  • langchain
  • openai
Share this project:

Updates