AWS Builder Center

Weekend Showcase Challenge: Serverless Smart AI Task Assistant

A serverless smart AI task assistant built using AWS Bedrock and AWS Lambda for rapid natural language processing without managing infrastructure.

Vision & Overview The Serverless Smart AI Task Assistant is an intelligent, automated agent designed to simplify daily developer workflows and prompt execution using AWS Bedrock and AWS Lambda. Built during the AWS Summer Build Series, it offers rapid AI text processing without managing any server infrastructure.
How It Was Built & Process
  1. Foundational Layer: Integrated AWS Bedrock using  boto3  SDK in Python for LLM capabilities.
  1. Compute & Execution: Deployed the model handling logic into AWS Lambda with an IAM execution role granting  AmazonBedrockFullAccess .
  1. API & Connectivity: Enabled AWS Lambda Function URL to allow direct execution via public HTTP request triggers.
AWS Services Used
  • AWS Bedrock: Handles natural language tasks and returns real-time responses.
  • AWS Lambda: Hosts and runs the agent code in a fully serverless environment.
  • AWS IAM: Secures permissions between Lambda compute and Bedrock foundation models.
What I Learned Across the Summer Building this project taught me how seamlessly serverless architecture integrates with generative AI models. Eliminating server management accelerated development time drastically, allowing me to ship a functional AI agent within hours.
import boto3
import json
bedrock = boto3.client(service_name='bedrock-runtime', region_name='us-east-1')
def run_ai_agent(user_prompt):
payload = {
"prompt": f"\n\nHuman: {user_prompt}\n\nAssistant:",
"max_tokens_to_sample": 300,
"temperature": 0.7
}
response = bedrock.invoke_model(
modelId='anthropic.claude-v2',
contentType='application/json',
accept='application/json',
body=json.dumps(payload)
)
result = json.loads(response['body'].read())
return result.get('completion')
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article