Hosting a Chatbot Program in AWS Lambda
up vote
1
down vote
favorite
I am a developer and new to the system engineering part, so still getting my concept clear.
I need to deploy my chatbot in Lambda and host it using API Gateway, but following conceptual problem is arising.
I have a chatbot built using simple AIML. I created it on python and its working properly.
For those who don't know of AIML, here I create an image of the AIML kernel : k = aiml.Kernel()
and then as the conversation flow happens this kernel image is important for the conversation.
In my system, at an instance I just have one image of the kernel and things are good. But when I host this python program to Lambda and deploy it using API Gateway, for each request I will have a new image of the kernel
, and my program will not function properly.
In a chatbot the conversation is happening at runtime, and and past conversation data is important, but if I am using API Gateway to trigger the Lambda function each time the user writes a new line, then every time a new image will be created of the kernel.
One option which I found was storing the user's session and conversation in a database. But in runtime if I am chatting, then the retrieval of past conversation and have the past conversation in the new image of kernel doesn't sounds a good way to go.
Or, even if we store the past conversation and send to the Lambda function using some JSON payload, then also since a new image of Kernel will be created by API Gateway, I have to run all the past conversation first and then only get the response for the new dialogue in the chat.
IN SHORT : How can I have one image of the kernel in the Lambda function, and get output using API Gateway, where the API is called multiple time for the same image of lambda function.
Or even if you know the general idea, how most online chatbots process and give responses, then that will also be very helpful.
amazon-web-services aws-lambda
add a comment |
up vote
1
down vote
favorite
I am a developer and new to the system engineering part, so still getting my concept clear.
I need to deploy my chatbot in Lambda and host it using API Gateway, but following conceptual problem is arising.
I have a chatbot built using simple AIML. I created it on python and its working properly.
For those who don't know of AIML, here I create an image of the AIML kernel : k = aiml.Kernel()
and then as the conversation flow happens this kernel image is important for the conversation.
In my system, at an instance I just have one image of the kernel and things are good. But when I host this python program to Lambda and deploy it using API Gateway, for each request I will have a new image of the kernel
, and my program will not function properly.
In a chatbot the conversation is happening at runtime, and and past conversation data is important, but if I am using API Gateway to trigger the Lambda function each time the user writes a new line, then every time a new image will be created of the kernel.
One option which I found was storing the user's session and conversation in a database. But in runtime if I am chatting, then the retrieval of past conversation and have the past conversation in the new image of kernel doesn't sounds a good way to go.
Or, even if we store the past conversation and send to the Lambda function using some JSON payload, then also since a new image of Kernel will be created by API Gateway, I have to run all the past conversation first and then only get the response for the new dialogue in the chat.
IN SHORT : How can I have one image of the kernel in the Lambda function, and get output using API Gateway, where the API is called multiple time for the same image of lambda function.
Or even if you know the general idea, how most online chatbots process and give responses, then that will also be very helpful.
amazon-web-services aws-lambda
Lambda won't be the correct tool here as it is stateless. What are the reasons you have chosen to use Lambda for your solution?
– TenorFlyy
2 hours ago
@TenorFlyy Chosen Lambda because I don't have to worry about other server issues and just needed this as a POC without worrying about the traffic, as only few request will happen in a day.
– arqam
2 hours ago
Why not just pack the BOT and put it inside an ECS container?
– TenorFlyy
2 hours ago
@TenorFlyy Is it compatible with AWS API Gateway, to get the response output as an API?
– arqam
2 hours ago
I think this is the easiest way to go: aws.amazon.com/blogs/compute/…
– TenorFlyy
2 hours ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am a developer and new to the system engineering part, so still getting my concept clear.
I need to deploy my chatbot in Lambda and host it using API Gateway, but following conceptual problem is arising.
I have a chatbot built using simple AIML. I created it on python and its working properly.
For those who don't know of AIML, here I create an image of the AIML kernel : k = aiml.Kernel()
and then as the conversation flow happens this kernel image is important for the conversation.
In my system, at an instance I just have one image of the kernel and things are good. But when I host this python program to Lambda and deploy it using API Gateway, for each request I will have a new image of the kernel
, and my program will not function properly.
In a chatbot the conversation is happening at runtime, and and past conversation data is important, but if I am using API Gateway to trigger the Lambda function each time the user writes a new line, then every time a new image will be created of the kernel.
One option which I found was storing the user's session and conversation in a database. But in runtime if I am chatting, then the retrieval of past conversation and have the past conversation in the new image of kernel doesn't sounds a good way to go.
Or, even if we store the past conversation and send to the Lambda function using some JSON payload, then also since a new image of Kernel will be created by API Gateway, I have to run all the past conversation first and then only get the response for the new dialogue in the chat.
IN SHORT : How can I have one image of the kernel in the Lambda function, and get output using API Gateway, where the API is called multiple time for the same image of lambda function.
Or even if you know the general idea, how most online chatbots process and give responses, then that will also be very helpful.
amazon-web-services aws-lambda
I am a developer and new to the system engineering part, so still getting my concept clear.
I need to deploy my chatbot in Lambda and host it using API Gateway, but following conceptual problem is arising.
I have a chatbot built using simple AIML. I created it on python and its working properly.
For those who don't know of AIML, here I create an image of the AIML kernel : k = aiml.Kernel()
and then as the conversation flow happens this kernel image is important for the conversation.
In my system, at an instance I just have one image of the kernel and things are good. But when I host this python program to Lambda and deploy it using API Gateway, for each request I will have a new image of the kernel
, and my program will not function properly.
In a chatbot the conversation is happening at runtime, and and past conversation data is important, but if I am using API Gateway to trigger the Lambda function each time the user writes a new line, then every time a new image will be created of the kernel.
One option which I found was storing the user's session and conversation in a database. But in runtime if I am chatting, then the retrieval of past conversation and have the past conversation in the new image of kernel doesn't sounds a good way to go.
Or, even if we store the past conversation and send to the Lambda function using some JSON payload, then also since a new image of Kernel will be created by API Gateway, I have to run all the past conversation first and then only get the response for the new dialogue in the chat.
IN SHORT : How can I have one image of the kernel in the Lambda function, and get output using API Gateway, where the API is called multiple time for the same image of lambda function.
Or even if you know the general idea, how most online chatbots process and give responses, then that will also be very helpful.
amazon-web-services aws-lambda
amazon-web-services aws-lambda
edited 1 hour ago
asked 4 hours ago
arqam
1,01321233
1,01321233
Lambda won't be the correct tool here as it is stateless. What are the reasons you have chosen to use Lambda for your solution?
– TenorFlyy
2 hours ago
@TenorFlyy Chosen Lambda because I don't have to worry about other server issues and just needed this as a POC without worrying about the traffic, as only few request will happen in a day.
– arqam
2 hours ago
Why not just pack the BOT and put it inside an ECS container?
– TenorFlyy
2 hours ago
@TenorFlyy Is it compatible with AWS API Gateway, to get the response output as an API?
– arqam
2 hours ago
I think this is the easiest way to go: aws.amazon.com/blogs/compute/…
– TenorFlyy
2 hours ago
add a comment |
Lambda won't be the correct tool here as it is stateless. What are the reasons you have chosen to use Lambda for your solution?
– TenorFlyy
2 hours ago
@TenorFlyy Chosen Lambda because I don't have to worry about other server issues and just needed this as a POC without worrying about the traffic, as only few request will happen in a day.
– arqam
2 hours ago
Why not just pack the BOT and put it inside an ECS container?
– TenorFlyy
2 hours ago
@TenorFlyy Is it compatible with AWS API Gateway, to get the response output as an API?
– arqam
2 hours ago
I think this is the easiest way to go: aws.amazon.com/blogs/compute/…
– TenorFlyy
2 hours ago
Lambda won't be the correct tool here as it is stateless. What are the reasons you have chosen to use Lambda for your solution?
– TenorFlyy
2 hours ago
Lambda won't be the correct tool here as it is stateless. What are the reasons you have chosen to use Lambda for your solution?
– TenorFlyy
2 hours ago
@TenorFlyy Chosen Lambda because I don't have to worry about other server issues and just needed this as a POC without worrying about the traffic, as only few request will happen in a day.
– arqam
2 hours ago
@TenorFlyy Chosen Lambda because I don't have to worry about other server issues and just needed this as a POC without worrying about the traffic, as only few request will happen in a day.
– arqam
2 hours ago
Why not just pack the BOT and put it inside an ECS container?
– TenorFlyy
2 hours ago
Why not just pack the BOT and put it inside an ECS container?
– TenorFlyy
2 hours ago
@TenorFlyy Is it compatible with AWS API Gateway, to get the response output as an API?
– arqam
2 hours ago
@TenorFlyy Is it compatible with AWS API Gateway, to get the response output as an API?
– arqam
2 hours ago
I think this is the easiest way to go: aws.amazon.com/blogs/compute/…
– TenorFlyy
2 hours ago
I think this is the easiest way to go: aws.amazon.com/blogs/compute/…
– TenorFlyy
2 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203337%2fhosting-a-chatbot-program-in-aws-lambda%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Lambda won't be the correct tool here as it is stateless. What are the reasons you have chosen to use Lambda for your solution?
– TenorFlyy
2 hours ago
@TenorFlyy Chosen Lambda because I don't have to worry about other server issues and just needed this as a POC without worrying about the traffic, as only few request will happen in a day.
– arqam
2 hours ago
Why not just pack the BOT and put it inside an ECS container?
– TenorFlyy
2 hours ago
@TenorFlyy Is it compatible with AWS API Gateway, to get the response output as an API?
– arqam
2 hours ago
I think this is the easiest way to go: aws.amazon.com/blogs/compute/…
– TenorFlyy
2 hours ago