Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 18, 2023 02:21 pm GMT

AI-Powered Selection of Asset Management Companies using MindsDB and LlamaIndex

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 PDFs, 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 Blackrocks 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 MindsDBs 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_nameFROM llama_index

You can provide the name llamaindex to the ML_ENGINE.

On execution, you get:

Image description

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.

Image description

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:

Image description

Once you have created the engine and successfully uploaded your file, you can create the model with the CREATE MODEL syntax.

CREATE MODEL model_nameFROM datasource    (SELECT * FROM table_name)PREDICT column_to_be_predictedUSING  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_blackrockFROM files    (SELECT * FROM about_blackrock)PREDICT AnswersUSING  engine = 'llamaindex',  index_class = 'GPTVectorStoreIndex',  reader = 'DFReader',  source_url_link = '',  input_column = 'Questions',  openai_api_key = 'your_api_key';

On execution, you get:

Image description


qa_blackrockThe name provided to the model.
engineThe engine used, which is Llamaindex.
qa_blackrockThe name provided of the model.
engineThe engine name - here, LlamaIndex.
index_classThe vector store index used.
readerThe reader that reads the data/webpage.
input_columnprompt provided as a question to the model.
openai_api_keyAPI key of the LLM OpenAI.
source_url_linkThe webpage link.
input_columnThe column that stores prompt to the model.
openai_api_keyOpenAI 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:

Image description

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,AnswersFROM mindsdb.qa_blackrockWHERE Questions = 'What is the best long term investment with minimal risks for private investors';

On execution, you get:

Image description

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.AnswersFROM mindsdb.qa_blackrock as bJOIN files.about_blackrock as a;

On execution, you get:

Image description

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.

Github: chandrevdw31

Original Link:

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To