Option 1: Robo Advisor for Retirement Plans
A bot RoboAdvisor is built for retirement planning on Amazon Lex.
Scenario 1: when the provided age falls between 0 and 65 with an investment of at least $5000
Scenario 2: when investing less than $5000 or the age provided falls outside the range of 0 to 65
Two more utterances are added to those provided in the instructions as follows:
- How to retire early and take {riskLevel} risk
- I need {investmentAmount} by {age} to retire
Recommendations are built under the recommend_portfolio(intent_request)
function as follows:
"""
Performs dialog management and fulfillment for recommending a portfolio.
"""
risk_level = get_slots(intent_request)["riskLevel"]
# define investment portfolio recommendations
"""
Responses based on selected risk levels.
"""
risk = {
"None": "100% bonds (AGG), 0% equities (SPY)",
"Very Low": "80% bonds (AGG), 20% equities (SPY)",
"Low": "60% bonds (AGG), 40% equities (SPY)",
"Medium": "40% bonds (AGG), 60% equities (SPY)",
"High": "20% bonds (AGG), 80% equities (SPY)",
"Very High": "0% bonds (AGG), 100% equities (SPY)"
}
with initial recommendation
# Get the initial investment recommendation
initial_recommendation = risk[risk_level]
Results (click me):
Test Files (provided)
- Construct post-confirmation intents using
get_slots
onriskLevel
responses. In the current version, theConfirmation Prompt
box was unchecked on Amazon Lex intent builder as it "short-circuit" the trigger to selectriskLevel
.- If ordering becomes an issue, define a separate function
recommended_portfolios(risk)
shown below could be an alternative to the current risk dictionary defined under the functionrecommend_portfolio(intent_request)
:
- If ordering becomes an issue, define a separate function
Click me for details on an alternative function:
# define investment portfolio recommendations
def recommended_portfolios(risk):
"""
Responses based on selected risk levels.
"""
risk = {
"None": "100% bonds (AGG), 0% equities (SPY)",
"Very Low": "80% bonds (AGG), 20% equities (SPY)",
"Low": "60% bonds (AGG), 40% equities (SPY)",
"Medium": "40% bonds (AGG), 60% equities (SPY)",
"High": "20% bonds (AGG), 80% equities (SPY)",
"Very High": "0% bonds (AGG), 100% equities (SPY)"
}
return risk[risk_level]
It follows that the initial_recommendation
defined under the current recommend_portfolio(intent_request)
function becomes:
# Get the initial investment recommendation
initial_recommendation = recommended_portfolios(risk)
-
Add additional slots to respond based on feedbacks
- Allow customers to go back and re-select their risk levels
- Provide more customized recommendations, e.g. more variety under each
riskLevel
-
Deploy RoboAdvisor on Facebook or Slack on
Channels
tab using Amazon Lex Documentations- Graphic analyzers are available under
Monitoring
tab on Lex
- Graphic analyzers are available under
- Columbia University GitLab Repository
- https://docs.aws.amazon.com/lex/latest/dg/gs2-prepare.html
- https://docs.aws.amazon.com/lex/latest/dg/additional-exercises.html
- https://hackernoon.com/building-a-serverless-chatbot-with-aws-lex-lambda-and-amazon-aurora-part-1-5406e8db6123
- https://chatbotsmagazine.com/quick-start-develop-a-chat-bot-with-aws-lex-lambda-part-1-b6f7c80ebba6
- https://medium.com/velotio-perspectives/amazon-lex-aws-lambda-beyond-hello-world-1403c1825e72
- https://docs.aws.amazon.com/lex/latest/dg/example1.html
- https://docs.aws.amazon.com/lex/latest/dg/gs-cli-publish-bot.html
- https://docs.aws.amazon.com/lex/latest/dg/fb-bot-association.html
- https://www.iconfinder.com/
- CloudApp - Screen Recorder
- QuickTime Player