Investors make use of Asset Management companies to efficiently manage their assets on their behalf without having any concerns, therefore choosing the correct company is very important which means investors need to query what they want to know in order to make a decision. Asset Management companies want to make sure that they can appeal to investors by providing them with information through their websites. Finding an asset management company that suits your needs and convincing investors to choose your asset management company to assist can be daunting for both parties. AI can alleviate this for both the investor and the asset management company by making sure the investor's questions are answered and the asset management company can answer questions without human interaction.
Asset Management companies rely on their website to provide information about their investment and financial services so that investors are willing to choose them, but how does an investor simplify the process of obtaining answers about an asset management company? This can be resolved with MindsDB's integration with LlamaIndex by creating a Q&A model.
MindsDB is an AI Automation platform for building AI/ML powered features and applications. It works by connecting any data source with any AI/ML model or framework and automating how real-time data flows between them. MindsDB is integrated with LlamaIndex, which makes use of its data framework for connecting custom data sources to large language models. LlamaIndex data ingestion allows you to connect to data sources like PDF’s, webpages, etc., provides data indexing and a query interface that takes input prompts from your data and provides knowledge-augmented responses, thus making it easy to Q&A over documents and webpages.
For this case, let's explore how to create a Q&A model for the Asset Management company Blackrock that can help investors obtain information seamlessly. This can be done using LlamaIndex, OpenAI as the LLM, and Blackrock’s About-Us webpage.
Blackrock is an asset management company that provides services to investors for investment, advisory and risk management solutions and makes a great example of how creating a Q&A model with MindsDB’s integration with LlamaIndex can be beneficial.
How to create a Q&A model using MindsDB and LlamaIndex.
MindsDB has a great SQL Editor in it's Cloud GUI for you to use. If you would like to sign up for a demo Cloud account, you can do so here.
To create a model, you will have to create the ML engine using the CREATE ML_ENGINE
syntax in the SQL Editor.
CREATE ML_ENGINE engine_name
FROM llama_index
You can provide the name llamaindex
to the ML_ENGINE.
On execution, you get:
We will make use of a file that has been uploaded into the GUI. If you would like to know how to upload a file, you can check the documentation here.. You can find a sample dataset here.
To upload the file, navigate to the 'Add Icon' on the MindsDB Gui and Upload File.
You can ensure that the data has been uploaded by selecting the file.
Run the following syntax:
SELECT * FROM files.about_blackrock LIMIT 10;
On execution, you get:
Once you have created the engine and successfully uploaded your file, you can create the model with the CREATE MODEL
syntax.
CREATE MODEL model_name
FROM datasource
(SELECT * FROM table_name)
PREDICT column_to_be_predicted
USING
engine = 'llamaindex',
index_class = 'vector_store_index',
reader = 'reader_type',
source_url_link = 'source_url_link',
input_column = 'column_name',
openai_api_key = 'your_api_key';
To ensure that the model is created based on the LlamaIndex engine, the USING
clause is used to include the engine
which is the ml_engine LlamaIndex, index_class
is used to define the type of index class used, reader
to define the type of reader for the data scrapping, source_url_link
defines the URL link used to get the answers from, input_column
defines the column used to prompt the model, and openai_api_key
is defined with your OpenAI key to gain access to OpenAI models.
CREATE MODEL qa_blackrock
FROM files
(SELECT * FROM about_blackrock)
PREDICT Answers
USING
engine = 'llamaindex',
index_class = 'GPTVectorStoreIndex',
reader = 'DFReader',
source_url_link = 'https://www.blackrock.com/za/individual/about-us',
input_column = 'Questions',
openai_api_key = 'your_api_key';
On execution, you get:
Where:
Expression | Description |
---|---|
qa_blackrock |
The name provided to the model. |
engine |
The engine used, which is Llamaindex. |
qa_blackrock |
The name provided of the model. |
engine |
The engine name - here, LlamaIndex. |
index_class |
The vector store index used. |
reader |
The reader that reads the data/webpage. |
input_column |
prompt provided as a question to the model. |
openai_api_key |
API key of the LLM OpenAI. |
source_url_link |
The webpage link. |
input_column |
The column that stores prompt to the model. |
openai_api_key |
OpenAI API key. |
The status of the model can be verified that it has trained successfully into a complete status by using the DESCRIBE
syntax.
DESCRIBE qa_blackrock
On execution, you get:
Querying the Q&A model
The Q&A model has been successfully created and can now be prompted with questions with the SELECT
statement.
SELECT Questions,Answers
FROM mindsdb.qa_blackrock
WHERE Questions = 'What is the best long term investment with minimal risks for private investors';
On execution, you get:
The answer provided is:
The best long-term investment with minimal risks for private investors is a diversified portfolio of low-cost index funds. These funds typically track a broad market index, such as the S&P 500, and provide exposure to a wide variety of publicly traded companies with minimal risk. Blackrock is one of the largest asset management companies in the world, and offers a range of index funds, exchange-traded funds, and other investment products for private investors.
You can also query batch predictions using the JOIN
clause.
SELECT a.Questions,b.Answers
FROM mindsdb.qa_blackrock as b
JOIN files.about_blackrock as a;
On execution, you get:
The Q&A model has successfully retrieved information from the webpage and answered the questions prompted
How can Investors and Asset Management companies incorporate a Q&A model?
Not only can the investors create this Q&A model for themself for decision-making about multiple asset management companies, but also the asset management company can use it to make sure that possible clients are equipped to have their questions answered.
Asset Management companies can embed this Q&A model into their webpage which allows a reader/investor to prompt the model questions about the given webpage, therefore sparing time of having to read through the whole webpage and allowing investors to obtain the information they are looking for.
You check out MindsDB by signing up for a demo account. If you would like to learn more you can visit MindsDB's Documentation. If you want to contribute to MindsDB, visit their Github repository and if you like it give it a star. MindsDB has a vibrant Slack Community and amazing team that provides technical support, if you would like to join you can sign up here.
Twitter:Chan_vdw
Github: chandrevdw31
Top comments (1)
Very informative article. Loved reading it. 👌