top of page

Leveraging Amazon Bedrock and Large Language Models (LLMs) for Real-Time Financial Insights

  • dotsincloud
  • Mar 30
  • 3 min read

Background: This project details setup process of an application that will use an agent on Amazon Bedrock. This will include setting up Amazon S3 buckets, a knowledge base, action group, AWS Lambda function, and an Amazon EC2 instance within an AWS environment. We will use the Streamlit framework for the user interface(Optional). The agent is designed to create an ROI company portfolio automatically. We will also create Q&A capability by setting up an internal knowledge base that references several open committee meeting reports. This workshop will also provide partial functionality for a send email capability, but will not be fully enabled. This is to simply show the art of the possible. Additionally, you have access to another sectoin of the workshop that covers Amazon Bedrock multi-agent collaboration.


Architecture:



ree

Hands on exercise:

 

Listed are the activities for proposed solution.

 

1.             Login to AWS console

2.             Grant LLM access

3.             Deploy Resources via Cloudformation

4.             Create Knowledge base, then add to agent

5.             Setup and Run Streamlit App on EC2


I.                           Log into AWS Console



II.                         Grant LLM’s access



ree


Enable Base models and Anthropic (cloud3 Haiku) models.

Review the configuration and submit. Here is what you will see.

 


ree

 

Anthropic – Clade3 Haiku

 


ree

 

 

III. DEPLOY RESOURCES VIA CLOUD FORMATION

 

Create and S3 bucket with FOMC reports.



ree

ree

ree

ree

Leave default options in – Configure stack options.


ree

Submit the stack creation request.

S3 bucket is created.


ree

 The S3 bucket is created with the 6 publicly FOMC reports released by Federal Bank.  


ree

Next, repeat the same for next stack. The next stack will create a will create an Amazon bedrock agent, action group, with an associated Lambda function.


ree


ree


II.                         Create a knowledge base, then add to agent.

 

 


ree


ree


Provide the name of the Knowledge base. A default populate name can be selected. In this case it was prefixed with fomc-s3 for easy distinguishability. However, it’s your choice.


ree

Create a service role.

 


ree

Select datasource as S3. Leave rest all default and click next.

 

ree

 

In Configure datasource, provide the S3 URI. Just to mention, the S3 bucket consists of the FOMC reports.

 


ree

In Configure datastorage and processing, For the embedding model, choose Titan Embeddings G1 - Text V1.2. Leave the other options as default and scroll down to select Next.

 


ree

On the next screen, review your work, then select Create knowledge base

 


ree


Scroll to the top, and you should see a blue banner saying the vector database is being prepared. When complete, you will see a green message saying the setup was successful, like below:

 


ree

 

Next, scroll down to the Data source section, select your knowledge base, then Sync the data. You will see another blue banner at the top saying that your data is being synced.

 


Next, we will sync the knowledge base with the Amazon Bedrock agent. On the left under Builder tools, select Agents, then the agent that was created on deployment.

 


ree

At the top, select the orange button Edit in Agent Builder. While in edit mode, scroll down to Knowledge base and select Add.

 


ree


ree

When integrating the KB with the agent, you will need to provide basic instructions on how to handle the knowledge base so the agent knows when to leverage it. For example, use the following:

 

“This knowledge base contains information for understanding data sets related to economic trends, company financials, and policy decisions made during Federal Open Market Committee meetings.”


ree


 

Alright, we are ready now to prompt and test.

 

You can now use the prompts below to test your app from the Amazon Bedrock management console!

 

Example prompts for Knowledge base:

 

1

Give me a summary of financial market developments and open market operations in January 2023

 

2

Tell me the participants view on economic conditions and economic outlook

 

3

Provide any important information I should know about inflation, or rising prices

 

 

Here is an example of final output when queried in the Chatbot.

 

 


ree


 

Comments


Post: Blog2_Post
  • LinkedIn

©2021 by Dots in Cloud. Proudly created with Wix.com

bottom of page