InvestRock: Your AI-Powered Mutual Fund Investment Assistant
AI Assistant

InvestRock: Your AI-Powered Mutual Fund Investment Assistant

Introduction

Investing in mutual funds can be daunting, especially for individual investors overwhelmed by the vast amount of available data and the complexity of making informed decisions. InvestRock is an AI Assistant designed to simplify mutual fund investments using advanced Retrieval-Augmented Generation (RAG) technology. InvestRock offers personalized solutions to help investors select the most suitable mutual funds for their portfolios, enhancing decision-making and overall investment experience.

Problem Statement

Individual investors often face several challenges:

?Information Overload: The sheer volume of data on mutual funds makes it difficult to find relevant information.

?Complex Decision-Making: Selecting the right investment involves analyzing multiple fund characteristics, which can be overwhelming.

?Educational Gap: Many investors lack the financial literacy to understand investment strategies and make informed decisions.

?Portfolio Diversification: Building a well-diversified portfolio is often misunderstood and challenging.

?Personalization Need: Generic financial advice fails to meet individual investors' unique financial goals and risk preferences.

Solution

InvestRock addresses these challenges through a comprehensive AI-driven approach:

??Utilizing RAG Technology: InvestRock uses RAG technology to effectively filter and deliver the most relevant mutual fund information.

??Personalized Recommendations: InvestRock analyzes user inputs to recommend mutual funds that align with the investor’s specific financial goals and risk tolerance.

??Educational Support: InvestRock provides contextual educational content about mutual funds and investment strategies, enhancing financial literacy.

??Customized Investment Strategies: The AI assistant generates personalized investment strategies based on individual risk profiles and objectives.

??Portfolio Diversification Assistance: InvestRock helps users construct diversified portfolios tailored to manage risk and enhance returns.

Technology Used

InvestRock leverages cutting-edge AI technologies to deliver its services:

  • Retrieval-Augmented Generation (RAG): Retrieval-augmented generation (RAG) is the process of optimizing the output of a large language model so it references an authoritative knowledge base outside of its training data sources before generating a response. Large Language Models (LLMs) are trained on vast volumes of data and use billions of parameters to generate original output for tasks like answering questions, translating languages, and completing sentences. RAG extends the already powerful capabilities of LLMs to specific domains or an organization's internal knowledge base, all without the need to retrain the model. It is a cost-effective approach to improving LLM output so it remains relevant, accurate, and useful in various contexts.
  • Amazon Bedrock: Amazon Bedrock is a fully managed service that offers a choice of high-performing foundation models and a broad set of capabilities to build generative AI applications while simplifying development and maintaining privacy and security. With knowledge bases for Amazon Bedrock, you can connect FMs to your data sources for RAG in just a few clicks. Vector conversions, retrievals, and improved output generation are all handled automatically.
  • Amazon S3 and Open Search: These tools store and retrieve large volumes of financial data.
  • Streamlit: Streamlit is an open-source Python framework used by data scientists and AI/ML engineers to deliver dynamic data apps with only a few lines of code.

?? You will incur costs associated with the AWS resources and services used. It's important to review the pricing information for Amazon Bedrock and any other AWS services utilized.

Architecture

Architecture of the solution

InvestRock's architecture integrates several components to function seamlessly:

  1. User Interface: The Streamlit web application where users interact with InvestRock.
  2. Bedrock Assistant Agent: Processes user queries using large language models and provides context for the search.
  3. Knowledge Base: Powered by Amazon Bedrock, it stores and retrieves relevant information.
  4. Amazon Open Search: This service retrieves necessary data by connecting to various data feeds, including mutual funds documents stored in Amazon S3.
  5. Response Generation: Combines retrieved data to generate personalized responses for the users.

Steps

??Creating Data Source

Created an Amazon S3 bucket, our data source, and uploaded the mutual funds' pdf file into that bucket.

??Activating Model Access

For this use case, I have activated the models Anthropic> Claude 3 sonnet and Cohere Embed model in the Amazon Bedrock console.

Refer to this official document to enable access to specific models. docs.aws.amazon.com/bedrock/latest/userguid..

??Creating a Knowledge Base

In the AWS console, Go to Amazon Bedrock console.

  • Select Knowledge base from the left navigation pane under Orchestration.
  • In the Knowledge bases section, select Create knowledge base.
  • On the Provide knowledge base details page, set up the following configurations:

??In the Knowledge base details section, provide a name or description for your knowledge base or use default.

??In the IAM permissions section, choose Create and use a new service role, and Service role name will have an IAM role that starts with AmazonBedrockExecutionRoleForKnowledgeBase.

??Select Next.

  • On the Set up data source page, provide the information for the data source to add to the knowledge base:

??Provide URI or browse S3 to navigate to the Amazon S3 folder you created earlier.

??Under Advanced Settings, select Use default KMS key and select Default chunking for Chunking strategy.

Default chunking—By default, Amazon Bedrock automatically splits your source data into chunks, each containing a maximum of 300 tokens. If a document contains less than 300 tokens, it is not split further.

??Select Next.

  • In the Embeddings model section, choose Embed English by Cohere embeddings model to convert the knowledge base from your data into an embedding.
  • In the Vector database section, choose Quick create a new vector store in the following options.

Quick create a new vector store – Amazon Bedrock creates an Amazon OpenSearch Serverless vector search collection, automatically configures the settings for embedding your data sources, and manages the collection for you.

  • Select Next.

  • On the Review and create page, check the configuration and details of your knowledge base. Select Edit in any section that you need to modify. When you are satisfied, select Create knowledge base.
  • The knowledge base creation process begins, and the Status of the source becomes In progress. The time it takes to create the knowledge base depends on the amount of data you provide. When the knowledge base is finished being created, a green success banner will appear, and the status of the knowledge base will change to Ready.


  • Select Sync your data source in the knowledge base. It takes a minute or two.


??Creating an Amazon Bedrock agent

  • In Amazon Bedrock console, select Agents from the left navigation pane under Orchestration.
  • In the Agents section, choose Create Agent.
  • On the Provide Agent details, set up the following configurations:

??For the Agent name section, enter the agent name and an optional description.

??Choose Create and use a new service role for the Agent Resource role section. This lets Amazon Bedrock create the service role and set up the required permissions on your behalf.

??For Select model, choose Anthropic model provider and then choose Claude 3 Sonnet model in the dropdown menu.

??In Instructions for the Agent, enter details to tell the agent what it should do and how it should interact with users.

??For the rest, leave it as default.


  • On the Agent builder page, click Add under the Knowledge base section to associate Knowledge bases to your agents.
  • On the Add knowledge bases page, associate knowledge bases with your agent.

??Choose the knowledge base you created in the previous section from the dropdown menu.

??Enter instructions describing how the agent should use the knowledge base in the Knowledge base instructions for the agent.

  • You have now finished configuring your agent. Select Save and exit on the top right corner to return to the Agent Details page.
  • On the Test window on the right plane, select Prepare.
  • To test the agent, enter a message and choose Run.

??Configuring the Project environment

Prerequisites

  • AWS CLI
  • Python 3
  • Create a project directory.
  • Create a python environment.

python -m venv <environment-name>
        

  • Activate the environment(In windows)

.\<environment-name>\Scripts\activate.ps1
        

  • Clone the GitHub repo.

git clone https://github.com/Sudarkodi-Muthiah-repo/amazon-bedrock-agent-test-ui
        

  • Install dependencies.

pip install -r requirements
        

  • Set the following environment variables:

?? BEDROCK_AGENT_ID - The ID of the agent

?? BEDROCK_AGENT_ALIAS_ID - The ID of the agent alias. The default TSTALIASID will be used if it is not set.

?? The AWS environment variables provide the credentials to your account. The principal must have the necessary permissions to invoke the Bedrock agent.

  • Run the following command to start the Streamlit app.

streamlit run app.py --server.port=8080 --server.address=localhost
        
InvestRock AI Assistant

We successfully created the InvestRock AI Assistant.

Clean-up the AWS resources:

Follow the steps below to delete your Agent.

  • In the Amazon Bedrock console, select Agents from the left navigation pane.
  • To delete an agent, choose the option button next to the agent you want to delete.
  • A dialog box appears, warning you about the consequences of deletion. To confirm that you want to delete the agent, enter delete in the input field and then select Delete.
  • When deletion is complete, a success banner appears.

Follow the steps below to delete your Knowledge base.

  • In Amazon Bedrock console, select Knowledge Base from the left navigation pane.
  • Choose a knowledge base or select the radio button next to a knowledge base. Then choose Delete.
  • Review the warnings for deleting a knowledge base. If you accept these conditions, enter delete in the input box and select Delete to confirm.
  • To fully delete the vector embeddings for your knowledge base, you must delete the vector index containing the data embeddings.

Real-Time Applications

InvestRock can be applied in various real-time scenarios:

  1. Investment Assistance Companies: Enhancing services by providing clients with personalized investment recommendations and real-time market analysis.
  2. Mutual Fund Advisors: Offering tailored advice and detailed fund comparisons to clients.
  3. Mutual Fund Customer Support: Acting as a customer support chatbot to answer inquiries and guide investment strategies.
  4. Bank Customer Support: Assisting clients with investment-related queries and offering real-time responses and personalized recommendations.

Conclusion

InvestRock revolutionizes the way individual investors approach mutual fund investments. Leveraging advanced AI technologies provides personalized, accurate, and educational support, making it easier for investors to navigate the complexities of mutual funds and achieve their financial goals.

Gayathri Gnanam

Actively seeking a full-time opportunity | Experienced Software Engineer | AWS Certified Cloud Practitioner | Data Analyst | Data Science | Business Intelligence | AI/ML

2 个月

Excellent work Sudarkodi

要查看或添加评论,请登录

Sudarkodi Muthiah的更多文章

社区洞察

其他会员也浏览了