Skip to content

eleva/serverless-memory-strands-agent

Repository files navigation

🧵 Serverless Memory Strands Agent

This is a simple serverless agent built with Strands Agents SDK using mem0_memory tool to persist context across different calls.

⚙️ Prerequisites

⚙️ Setup

Run the following commands to set up the project:

npm install

🧪 Test the function locally

Use the Serverless Framework to invoke the function locally. You can use the --data flag to pass a JSON object with action, user_id and content fields.

Use the following command to store the content for a specific user:

sls invoke local -f memory --data '{"content": "I like apples and grapefruit, I do not like oranges and bananas","action":"store","user_id":"1"}'

Use the following command to list memories for a specific user:

sls invoke local -f memory --data '{"action":"list","user_id":"1"}'

Use the following command to chat with the agent and get a response based on the stored memories for a specific user:

sls invoke local -f memory --data '{"content":"What fruit do i like?","action":"chat","user_id":"1"}'

🚀 Deploy on AWS

Make sure you have configured your AWS credentials and have the necessary permissions to deploy Lambda functions.

You can read more about configuring AWS credentials in the AWS CLI documentation or use the aws configure command to set them up interactively.

You can also use serverless framework to set up your AWS credentials by running:

sls config credentials --provider aws --key YOUR_AWS_ACCESS_KEY_ID --secret YOUR_AWS_SECRET_ACCESS_KEY

Then, run the following command to deploy the function to AWS:

sls deploy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages