UPDATE THIS PRESENTATION HEADER IN SLIDE MASTER
AWS UG Torino
Meetup 2024 #3
1 8 / 06 / 2 0 2 4
UPDATE THIS PRESENTATION HEADER IN SLIDE MASTER
AWS USER GROUP TORINO
ENTRA NEL GRUPPO WHATSAPP!
UPDATE THIS PRESENTATION HEADER IN SLIDE MASTER
© 2024, Amazon Web Services, Inc. or its affiliates. Allrights reserved. Amazon Confidential and Trademark.
Calendario 2024:
AWS UG TORINO MEETUP:
• 19/02/2024 ✓
• 16/04/2024 ✓
• 18/06/2024 oggi
• 02/10/2024
• 19/11/2024
UPDATE THIS PRESENTATION HEADER IN SLIDE MASTER
Rinfresco &
Networking
Agenda di oggi
AWS UG Torino Meetup 2024 #3
Carlo Peluso
AI Agents on AWS: Deep-
dive on Amazon Bedrock
Agents
Davide De Sio
Serverless e DevOps per
migliorare la DevXP
UPDATE THIS PRESENTATION HEADER IN SLIDE MASTER
© 2024, Amazon Web Services, Inc. or its affiliates. Allrights reserved. Amazon Confidential and Trademark.
Davide De Sio
Serverless e DevOps per
migliorare la DevXP
AW S UG TO R IN O M E E TU P 2 0 2 4 # 3
Superpower REST API DX
with Serverless and
DevOps Best Practices on
AWS
Come ridurre la complessità dell’infrastruttura con
AWS e migliorare la DevExperience attraverso pratiche
DevOps
Elev a
Srl
Chi Sono
Davide De Sio
Development Tech Lead @Eleva
AWS Solutions Architect (Professional)
Senior Full Stack Developer
“The essence of the serverless trend is the absence
of the server concept during software development.”
Tomasz Janczuk, VP at Auth0
Serverless Enthusiast
AWS UG Lead - Pavia
Use Case 1
Mobile Backend
Use Case 2
Single Page Application
Perché Serverless?
Cosa mi aspetto?
Voglio che l’architettura
scali in automatico (auto-scaling)
Voglio che gli sviluppatori
si concentrino nello scrivere
la business logic
Non voglio pagare
quando non utilizzo risorse (idle)
Voglio che il team di sviluppo si concentri su quello che conta
davvero, potendo far affidamento su una piattaforma di
sviluppo che massimizzi la Developer Experience e la renda
semplice, piacevole, ripetibile e manutenibile.
Infrastructure as code
Infrastruttura dichiarata come codice
Documentation as code
Documentazione dichiarata come codice
Automated Testing
Test automatici basati sulla documentazione
CI/CD
Pipelines di distribuzione automatizzate
DR
Procedure di Disaster Recovery
Versioning
Versionamento del singolo micro-servizio
API Architecture
Pratiche DevOps
Security By Design
Best practices di sicurezza
Monitoring
Monitoraggio continuo
Provisioning (senza overhead)
Esposizione tramite Amazon API Gateway, Amazon Cloudfront
e Amazon Route 53
Esecuzione su funzioni serverless tramite AWS Lambda
CI/CD
Release tramite strumenti di infrastracture as code
(AWS Cloudformation/SAM/CDK/Serverless Framework)
Esecuzione del rilascio e dei test su pipeline per CI/CD
(AWS Codepipeline e AWS Codebuild) a partire da commit su
branch finalizzati al versionamento e al rilascio di repo Git
API Architecture
Key points
API Architecture
Key points
Doc first / Doc generation
Documentazione come codice secondo standard Open API V3 (via Serverless
Framework)
Generazione della documentazione su pagine statiche (via Redocly) storicizzate
su Amazon S3 e integrazione nella pipeline di distribuzione
Automated Testing
Implementazione di test che validano le API in base alle specifiche Open API V3
generate
Security first e monitoring
Messa in sicurezza con Managed Services
AWS IAM / VPC / WAF / Guard Duty
Monitoraggio tramite AWS X-Ray e Cloudwatch
(dashboard e allarmi)
Show me
the (infra) code!
CloudFormation per estensioni (security -
cognito)
Documentazione integrata
(doc-as-code)
Serverless files
Infrastructure as Code
Plugin per monitoraggio
(slic-watch)
Plugin per local environment
(serverless-offline)
CloudFormation per architettura
a supporto e CI/CD come codice
(buildspec) su CodePipeline e
CodeBuild
Talk is cheap
Show me the code
Serverless Skeletons
Open Source
Node.js PHP Python
Textract: Example Use Case
EU-Driving Licences OCR
Bonus
«Non tutte le ciambelle vengono col buco»
https://www.primevideotech.com/video-streaming/scaling-up-the-prime-video-audio-video-monitoring-
service-and-reducing-costs-by-90
Bonus
«Don't get locked up into avoiding lock-in»
https://martinfowler.com/articles/oss-lockin.html
• Vendor Lock-In
• Product Lock-in
• Version lock-in
• Architecture lock-in
• Platform lock-in
• Skills lock-in
• Legal lock-in
• Mental Lock-in
UPDATE THIS PRESENTATION HEADER IN SLIDE MASTER
© 2024, Amazon Web Services, Inc. or its affiliates. Allrights reserved. Amazon Confidential and Trademark.
Carlo Peluso
AI Agents on AWS: Deep-
dive on Amazon Bedrock
Agents
AW S UG TO R IN O M E E TU P 2 0 24 # 3
AI AGENTS ON
AMAZON BEDROCK
Carlo Peluso | Solutions Architect @ Storm Reply
INTRODUCTION
ABOUT ME
2018 – Started working as Backend Engineer
2020 – Bachelor’s Degree in Computer Science Engineering
2022 – Master’s Degree in Data Science and Engineering
2022 – Started working as Solutions Architect @ Storm Reply
2022 – Q1 Publication on Transformers for Healthcare
INTRODUCTION
TODAY’S TOPIC: AI AGENTS
WHAT
are AI agents?
WHY
AI agents
are useful?
HOW
AI agents
can be
implemented?
ARTIFICIAL INTELLIGENCE
FROM SHALLOW ARCHITECTURES TO LARGE LANGUAGE MODELS
Increasing number of hidden layers…
NEURAL NETWORKS & CNNs
AlexNet, ResNet, …
TRANSFORMERS & LLMs
BERT, Claude, Mistral, GPT-3, …
SHALLOW ARCHITECTURES
Support Vector Machines, Decision Trees, …
DEEP NEURAL NETWORKS
TRAINING COMPLEXITIES
HIGH NUMBER OF
HIDDEN LAYERS
LOTS OF DATA AND
HIGHLY PERFORMANT
COMPUTATIONAL
RESOURCES
BILLIONS OF
TRAINING
PARAMETERS
IMPLY REQUIRE
CAN WE
EXPLOIT PRE-TRAINED AI MODELS
FOR DATA SPECIFIC FROM OUR DOMAIN?
EXPLOIT PRE-TRAINED AI MODELS
FINETUNING
PRE-TRAINED MODELS CAN BE FINETUNED
(i.e., SMOOTHLY RETRAINED)
ON DATA FROM AN UNKNOWN DOMAIN
STILL…
WITH GENERATIVE AI MODELS
WE CAN USE A MORE
STRAIGHTFORWARD APPROACH!
EXPLOIT PRE-TRAINED AI MODELS
IN-CONTEXT LEARNING
COLLECT UNKNOWN DOMAIN DATA
WITHIN A KNOWLEDGE BASE
INPUT CONTEXT INFORMATION
FROM THE KNOWLEDGE BASE
TO THE GENERATIVE AI MODEL
EXPLOIT PRE-TRAINED AI MODELS
IN-CONTEXT LEARNING
THE GENERATIVE AI MODEL CAN
COMPENSATE THE
MISSING DOMAIN KNOWLEDGE
BY EXPLOITING
IN-CONTEXT INFORMATION
Qual è
la capitale
della Grecia?
IN-CONTEXT LEARNING
EXAMPLE
La capitale della Francia è Parigi.
La capitale dell’Italia è Roma.
La capitale della Spagna è Madrid.
La capitale della Grecia è Atene.
La capitale
della Grecia
è Atene.
Semantic search
Provide in-context information to the LLM
1
2
3
4
1
2
3
4
The user asks a question.
The question is used to retrieve from the knowledge base
the documents semantically closer to the question.
The documents retrieved are fed to the LLM, alongside the original
question and a system prompt (that describes how the LLM should
respond).
The LLM, based on the context provided and the system prompt,
answers the question.
SEAMLESSLY BUILD AND MAINTAIN
VECTOR DATABASES USING
DOCUMENTS FROM YOUR DOMAIN
EASILY INTEGRATE LEADING LLMs,
DELEGATING INFRASTRUCTURE
MANAGEMENT
GENERATIVE AI ON AWS
AMAZON BEDROCK
FOUNDATION MODELS
KNOWLEDGE BASES
AMAZON BEDROCK
KNOWLEDGE BASES
AMAZON BEDROCK
KNOWLEDGE BASES
Textual documents, PDFs,
CSVs, JSON, …
AMAZON S3
AMAZON
RDS
AMAZON
OPENSEARCH
Text to vector representations
IN-CONTEXT LEARNING
EXAMPLE USING AMAZON BEDROCK
La capitale della Francia è Parigi.
La capitale dell’Italia è Roma.
La capitale della Spagna è Madrid.
La capitale della Grecia è Atene.
AMAZON BEDROCK
KNOWLEDGE BASES
AMAZON BEDROCK
FOUNDATION MODELS
Qual è
la capitale
della Grecia?
1
1 The user asks a question.
IN-CONTEXT LEARNING
EXAMPLE USING AMAZON BEDROCK
La capitale della Francia è Parigi.
La capitale dell’Italia è Roma.
La capitale della Spagna è Madrid.
La capitale della Grecia è Atene.
AMAZON BEDROCK
KNOWLEDGE BASES
AMAZON BEDROCK
FOUNDATION MODELS
Qual è
la capitale
della Grecia?
API call: knowledgeBase.retrieve(question)
1
2
1
2
The user asks a question.
The question is used to retrieve from the knowledge base
the documents semantically closer to the question.
IN-CONTEXT LEARNING
EXAMPLE USING AMAZON BEDROCK
La capitale della Francia è Parigi.
La capitale dell’Italia è Roma.
La capitale della Spagna è Madrid.
La capitale della Grecia è Atene.
AMAZON BEDROCK
KNOWLEDGE BASES
AMAZON BEDROCK
FOUNDATION MODELS
Qual è
la capitale
della Grecia?
API call: knowledgeBase.retrieve(question)
API call: bedrock.invoke_model(context)
1
2
3
1
2
3
The user asks a question.
The question is used to retrieve from the knowledge base
the documents semantically closer to the question.
The documents retrieved are fed to the LLM, alongside the original
question and a system prompt (that describes how the LLM should
respond).
IN-CONTEXT LEARNING
EXAMPLE USING AMAZON BEDROCK
La capitale della Francia è Parigi.
La capitale dell’Italia è Roma.
La capitale della Spagna è Madrid.
La capitale della Grecia è Atene.
AMAZON BEDROCK
KNOWLEDGE BASES
AMAZON BEDROCK
FOUNDATION MODELS
Qual è
la capitale
della Grecia?
La capitale
della Grecia
è Atene.
API call: knowledgeBase.retrieve(question)
API call: bedrock.invoke_model(context)
1
2
3
4
1
2
3
4
The user asks a question.
The question is used to retrieve from the knowledge base
the documents semantically closer to the question.
The documents retrieved are fed to the LLM, alongside the original
question and a system prompt (that describes how the LLM should
respond).
The LLM, based on the context provided and the system prompt,
answers the question.
STILL,
RETRIEVE AND GENERATE
APPLICATIONS ARE SOMEHOW
“STATIC”
FOUNDATION MODELS
ORCHESTRATE TASKS BY
EXPLOTING A KNOWLEDGE BASE
AND
DYNAMICALLY INVOKING APIs
AI AGENTS
AI AGENTS ON AMAZON BEDROCK
ACTION GROUPS
DEFINE ACTIONS THAT THE AGENT CAN PERFORM
AI AGENTS ON AMAZON BEDROCK
ACTION GROUPS
LAMBDA FUNCTIONS
DEFINE HOW THE AGENT HANDLES
THE PARAMETERS IT RECEIVES
OPENAPI SCHEMAS
DEFINE THE PARAMETERS THE
AGENT MUST EXTRACT FOR THE
ACTION TO BE EXECUTED
AI AGENTS ON AMAZON BEDROCK
ACTION GROUPS
AI AGENTS
WORKFLOW
AI AGENT IS INPUT VALID?
PREPROCESSING
PROMPT
1
1 The agent verifies that the user input is not malicious.
AI AGENTS
WORKFLOW
AI AGENT IS INPUT VALID?
SEARCH WITHIN THE
KNOWLEDGE BASE
CALL AN API
ORCHESTRATION
PROMPT
WHICH ACTION
SHOULD I TAKE?
PREPROCESSING
PROMPT
1 2
1
2
The agent verifies that the user input is not malicious.
The agent creates an orchestration prompt using:
• User’s input
• Conversation history
• Information about knowledge bases and available APIs
• Instructions provided by the system developer
AI AGENTS
WORKFLOW
AI AGENT IS INPUT VALID?
PERFORM ACTION
SEARCH WITHIN THE
KNOWLEDGE BASE
CALL AN API
RESPONSE
ORCHESTRATION
PROMPT
WHICH ACTION
SHOULD I TAKE?
PREPROCESSING
PROMPT
1 2
3
1
2
3
The agent verifies that the user input is not malicious.
The agent creates an orchestration prompt using:
• User’s input
• Conversation history
• Information about knowledge bases and available APIs
• Instructions provided by the system developer
The Foundation Model choose which action should be taken.
AI AGENTS
WORKFLOW
AI AGENT IS INPUT VALID?
PERFORM ACTION
SEARCH WITHIN THE
KNOWLEDGE BASE
CALL AN API
RESPONSE
ORCHESTRATION
PROMPT
WHICH ACTION
SHOULD I TAKE?
OBSERVATION
PREPROCESSING
PROMPT
1 2
3
4
1
2
3
4
The agent verifies that the user input is not malicious.
The agent creates an orchestration prompt using:
• User’s input
• Conversation history
• Information about knowledge bases and available APIs
• Instructions provided by the system developer
The Foundation Model choose which action should be taken.
The action’s output is an observation that is used to enrich
the orchestration prompt.
AI AGENTS
WORKFLOW
AI AGENT IS INPUT VALID?
PERFORM ACTION
SEARCH WITHIN THE
KNOWLEDGE BASE
CALL AN API
RESPONSE
ORCHESTRATION
PROMPT
WHICH ACTION
SHOULD I TAKE?
OBSERVATION
PREPROCESSING
PROMPT
1 2
3
4
5
1
2
3
4
5
The agent verifies that the user input is not malicious.
The agent creates an orchestration prompt using:
• User’s input
• Conversation history
• Information about knowledge bases and available APIs
• Instructions provided by the system developer
The Foundation Model choose which action should be taken.
The action’s output is an observation that is used to enrich
the orchestration prompt.
Looping and refinement until the Agent has all the necessary
informations to answer.
TRACING
DETAIL THE STEPS ORCHESTRATED
BY THE AGENT, HELPING TO
FOLLOW THE AGENT’S REASONING
PROCESS
GUARDRAILS
IMPLEMENT SAFEGUARDS FOR
GENERATIVE AI APPLICATIONS
AI AGENTS ON AMAZON BEDROCK
GUARDRAILS & TRACING
ACTION GROUP
IMPLEMENT AN API FOR
RETRIEVING THE QUANTITY
OF AVAILABLE PUPPETS
KNOWLEDGE BASE
CONTAINS DESCRIPTIONS
ABOUT POKEMON PUPPETS
AI AGENTS ON AMAZON BEDROCK
USE-CASE
POKEMON PUPPETS INVENTORY ASSISTANT
ACTION GROUPS
ARE BASED ON
LAMBDA FUNTIONS
KNOWLEDGE BASE
IS HOSTED ON
AMAZON OPENSEARCH
FOUNDATION
MODEL
IS CLAUDE 2.1
AI AGENTS ON AMAZON BEDROCK
USE-CASE
UPDATE THIS PRESENTATION HEADER IN SLIDE MASTER
PROSSIMO APPUNTAMENTO
AWS UG Torino Meetup 2024 #4
CALL FOR SPEAKERS
02/10/2024 – 18.30
Toolbox Coworking
Via Agostino da Montefeltro, 2, Torino
Si possono presentare propri progetti, case study,
best practice e altro.

AWS User Group Torino 2024 #3 - 18/06/2024

  • 1.
    UPDATE THIS PRESENTATIONHEADER IN SLIDE MASTER AWS UG Torino Meetup 2024 #3 1 8 / 06 / 2 0 2 4
  • 2.
    UPDATE THIS PRESENTATIONHEADER IN SLIDE MASTER AWS USER GROUP TORINO ENTRA NEL GRUPPO WHATSAPP!
  • 3.
    UPDATE THIS PRESENTATIONHEADER IN SLIDE MASTER © 2024, Amazon Web Services, Inc. or its affiliates. Allrights reserved. Amazon Confidential and Trademark. Calendario 2024: AWS UG TORINO MEETUP: • 19/02/2024 ✓ • 16/04/2024 ✓ • 18/06/2024 oggi • 02/10/2024 • 19/11/2024
  • 4.
    UPDATE THIS PRESENTATIONHEADER IN SLIDE MASTER Rinfresco & Networking Agenda di oggi AWS UG Torino Meetup 2024 #3 Carlo Peluso AI Agents on AWS: Deep- dive on Amazon Bedrock Agents Davide De Sio Serverless e DevOps per migliorare la DevXP
  • 5.
    UPDATE THIS PRESENTATIONHEADER IN SLIDE MASTER © 2024, Amazon Web Services, Inc. or its affiliates. Allrights reserved. Amazon Confidential and Trademark. Davide De Sio Serverless e DevOps per migliorare la DevXP AW S UG TO R IN O M E E TU P 2 0 2 4 # 3
  • 6.
    Superpower REST APIDX with Serverless and DevOps Best Practices on AWS Come ridurre la complessità dell’infrastruttura con AWS e migliorare la DevExperience attraverso pratiche DevOps Elev a Srl
  • 7.
    Chi Sono Davide DeSio Development Tech Lead @Eleva AWS Solutions Architect (Professional) Senior Full Stack Developer “The essence of the serverless trend is the absence of the server concept during software development.” Tomasz Janczuk, VP at Auth0 Serverless Enthusiast AWS UG Lead - Pavia
  • 8.
  • 9.
    Use Case 2 SinglePage Application
  • 10.
    Perché Serverless? Cosa miaspetto? Voglio che l’architettura scali in automatico (auto-scaling) Voglio che gli sviluppatori si concentrino nello scrivere la business logic Non voglio pagare quando non utilizzo risorse (idle) Voglio che il team di sviluppo si concentri su quello che conta davvero, potendo far affidamento su una piattaforma di sviluppo che massimizzi la Developer Experience e la renda semplice, piacevole, ripetibile e manutenibile.
  • 12.
    Infrastructure as code Infrastrutturadichiarata come codice Documentation as code Documentazione dichiarata come codice Automated Testing Test automatici basati sulla documentazione CI/CD Pipelines di distribuzione automatizzate DR Procedure di Disaster Recovery Versioning Versionamento del singolo micro-servizio API Architecture Pratiche DevOps Security By Design Best practices di sicurezza Monitoring Monitoraggio continuo
  • 13.
    Provisioning (senza overhead) Esposizionetramite Amazon API Gateway, Amazon Cloudfront e Amazon Route 53 Esecuzione su funzioni serverless tramite AWS Lambda CI/CD Release tramite strumenti di infrastracture as code (AWS Cloudformation/SAM/CDK/Serverless Framework) Esecuzione del rilascio e dei test su pipeline per CI/CD (AWS Codepipeline e AWS Codebuild) a partire da commit su branch finalizzati al versionamento e al rilascio di repo Git API Architecture Key points
  • 14.
    API Architecture Key points Docfirst / Doc generation Documentazione come codice secondo standard Open API V3 (via Serverless Framework) Generazione della documentazione su pagine statiche (via Redocly) storicizzate su Amazon S3 e integrazione nella pipeline di distribuzione Automated Testing Implementazione di test che validano le API in base alle specifiche Open API V3 generate Security first e monitoring Messa in sicurezza con Managed Services AWS IAM / VPC / WAF / Guard Duty Monitoraggio tramite AWS X-Ray e Cloudwatch (dashboard e allarmi)
  • 15.
    Show me the (infra)code! CloudFormation per estensioni (security - cognito) Documentazione integrata (doc-as-code) Serverless files Infrastructure as Code Plugin per monitoraggio (slic-watch) Plugin per local environment (serverless-offline) CloudFormation per architettura a supporto e CI/CD come codice (buildspec) su CodePipeline e CodeBuild
  • 16.
    Talk is cheap Showme the code
  • 17.
  • 18.
    Textract: Example UseCase EU-Driving Licences OCR
  • 21.
    Bonus «Non tutte leciambelle vengono col buco» https://www.primevideotech.com/video-streaming/scaling-up-the-prime-video-audio-video-monitoring- service-and-reducing-costs-by-90
  • 22.
    Bonus «Don't get lockedup into avoiding lock-in» https://martinfowler.com/articles/oss-lockin.html • Vendor Lock-In • Product Lock-in • Version lock-in • Architecture lock-in • Platform lock-in • Skills lock-in • Legal lock-in • Mental Lock-in
  • 23.
    UPDATE THIS PRESENTATIONHEADER IN SLIDE MASTER © 2024, Amazon Web Services, Inc. or its affiliates. Allrights reserved. Amazon Confidential and Trademark. Carlo Peluso AI Agents on AWS: Deep- dive on Amazon Bedrock Agents AW S UG TO R IN O M E E TU P 2 0 24 # 3
  • 24.
    AI AGENTS ON AMAZONBEDROCK Carlo Peluso | Solutions Architect @ Storm Reply
  • 25.
    INTRODUCTION ABOUT ME 2018 –Started working as Backend Engineer 2020 – Bachelor’s Degree in Computer Science Engineering 2022 – Master’s Degree in Data Science and Engineering 2022 – Started working as Solutions Architect @ Storm Reply 2022 – Q1 Publication on Transformers for Healthcare
  • 26.
    INTRODUCTION TODAY’S TOPIC: AIAGENTS WHAT are AI agents? WHY AI agents are useful? HOW AI agents can be implemented?
  • 27.
    ARTIFICIAL INTELLIGENCE FROM SHALLOWARCHITECTURES TO LARGE LANGUAGE MODELS Increasing number of hidden layers… NEURAL NETWORKS & CNNs AlexNet, ResNet, … TRANSFORMERS & LLMs BERT, Claude, Mistral, GPT-3, … SHALLOW ARCHITECTURES Support Vector Machines, Decision Trees, …
  • 28.
    DEEP NEURAL NETWORKS TRAININGCOMPLEXITIES HIGH NUMBER OF HIDDEN LAYERS LOTS OF DATA AND HIGHLY PERFORMANT COMPUTATIONAL RESOURCES BILLIONS OF TRAINING PARAMETERS IMPLY REQUIRE
  • 29.
    CAN WE EXPLOIT PRE-TRAINEDAI MODELS FOR DATA SPECIFIC FROM OUR DOMAIN?
  • 30.
    EXPLOIT PRE-TRAINED AIMODELS FINETUNING PRE-TRAINED MODELS CAN BE FINETUNED (i.e., SMOOTHLY RETRAINED) ON DATA FROM AN UNKNOWN DOMAIN
  • 31.
    STILL… WITH GENERATIVE AIMODELS WE CAN USE A MORE STRAIGHTFORWARD APPROACH!
  • 32.
    EXPLOIT PRE-TRAINED AIMODELS IN-CONTEXT LEARNING COLLECT UNKNOWN DOMAIN DATA WITHIN A KNOWLEDGE BASE INPUT CONTEXT INFORMATION FROM THE KNOWLEDGE BASE TO THE GENERATIVE AI MODEL
  • 33.
    EXPLOIT PRE-TRAINED AIMODELS IN-CONTEXT LEARNING THE GENERATIVE AI MODEL CAN COMPENSATE THE MISSING DOMAIN KNOWLEDGE BY EXPLOITING IN-CONTEXT INFORMATION
  • 34.
    Qual è la capitale dellaGrecia? IN-CONTEXT LEARNING EXAMPLE La capitale della Francia è Parigi. La capitale dell’Italia è Roma. La capitale della Spagna è Madrid. La capitale della Grecia è Atene. La capitale della Grecia è Atene. Semantic search Provide in-context information to the LLM 1 2 3 4 1 2 3 4 The user asks a question. The question is used to retrieve from the knowledge base the documents semantically closer to the question. The documents retrieved are fed to the LLM, alongside the original question and a system prompt (that describes how the LLM should respond). The LLM, based on the context provided and the system prompt, answers the question.
  • 35.
    SEAMLESSLY BUILD ANDMAINTAIN VECTOR DATABASES USING DOCUMENTS FROM YOUR DOMAIN EASILY INTEGRATE LEADING LLMs, DELEGATING INFRASTRUCTURE MANAGEMENT GENERATIVE AI ON AWS AMAZON BEDROCK FOUNDATION MODELS KNOWLEDGE BASES
  • 36.
    AMAZON BEDROCK KNOWLEDGE BASES AMAZONBEDROCK KNOWLEDGE BASES Textual documents, PDFs, CSVs, JSON, … AMAZON S3 AMAZON RDS AMAZON OPENSEARCH Text to vector representations
  • 37.
    IN-CONTEXT LEARNING EXAMPLE USINGAMAZON BEDROCK La capitale della Francia è Parigi. La capitale dell’Italia è Roma. La capitale della Spagna è Madrid. La capitale della Grecia è Atene. AMAZON BEDROCK KNOWLEDGE BASES AMAZON BEDROCK FOUNDATION MODELS Qual è la capitale della Grecia? 1 1 The user asks a question.
  • 38.
    IN-CONTEXT LEARNING EXAMPLE USINGAMAZON BEDROCK La capitale della Francia è Parigi. La capitale dell’Italia è Roma. La capitale della Spagna è Madrid. La capitale della Grecia è Atene. AMAZON BEDROCK KNOWLEDGE BASES AMAZON BEDROCK FOUNDATION MODELS Qual è la capitale della Grecia? API call: knowledgeBase.retrieve(question) 1 2 1 2 The user asks a question. The question is used to retrieve from the knowledge base the documents semantically closer to the question.
  • 39.
    IN-CONTEXT LEARNING EXAMPLE USINGAMAZON BEDROCK La capitale della Francia è Parigi. La capitale dell’Italia è Roma. La capitale della Spagna è Madrid. La capitale della Grecia è Atene. AMAZON BEDROCK KNOWLEDGE BASES AMAZON BEDROCK FOUNDATION MODELS Qual è la capitale della Grecia? API call: knowledgeBase.retrieve(question) API call: bedrock.invoke_model(context) 1 2 3 1 2 3 The user asks a question. The question is used to retrieve from the knowledge base the documents semantically closer to the question. The documents retrieved are fed to the LLM, alongside the original question and a system prompt (that describes how the LLM should respond).
  • 40.
    IN-CONTEXT LEARNING EXAMPLE USINGAMAZON BEDROCK La capitale della Francia è Parigi. La capitale dell’Italia è Roma. La capitale della Spagna è Madrid. La capitale della Grecia è Atene. AMAZON BEDROCK KNOWLEDGE BASES AMAZON BEDROCK FOUNDATION MODELS Qual è la capitale della Grecia? La capitale della Grecia è Atene. API call: knowledgeBase.retrieve(question) API call: bedrock.invoke_model(context) 1 2 3 4 1 2 3 4 The user asks a question. The question is used to retrieve from the knowledge base the documents semantically closer to the question. The documents retrieved are fed to the LLM, alongside the original question and a system prompt (that describes how the LLM should respond). The LLM, based on the context provided and the system prompt, answers the question.
  • 41.
  • 42.
    FOUNDATION MODELS ORCHESTRATE TASKSBY EXPLOTING A KNOWLEDGE BASE AND DYNAMICALLY INVOKING APIs AI AGENTS AI AGENTS ON AMAZON BEDROCK
  • 43.
    ACTION GROUPS DEFINE ACTIONSTHAT THE AGENT CAN PERFORM AI AGENTS ON AMAZON BEDROCK ACTION GROUPS
  • 44.
    LAMBDA FUNCTIONS DEFINE HOWTHE AGENT HANDLES THE PARAMETERS IT RECEIVES OPENAPI SCHEMAS DEFINE THE PARAMETERS THE AGENT MUST EXTRACT FOR THE ACTION TO BE EXECUTED AI AGENTS ON AMAZON BEDROCK ACTION GROUPS
  • 45.
    AI AGENTS WORKFLOW AI AGENTIS INPUT VALID? PREPROCESSING PROMPT 1 1 The agent verifies that the user input is not malicious.
  • 46.
    AI AGENTS WORKFLOW AI AGENTIS INPUT VALID? SEARCH WITHIN THE KNOWLEDGE BASE CALL AN API ORCHESTRATION PROMPT WHICH ACTION SHOULD I TAKE? PREPROCESSING PROMPT 1 2 1 2 The agent verifies that the user input is not malicious. The agent creates an orchestration prompt using: • User’s input • Conversation history • Information about knowledge bases and available APIs • Instructions provided by the system developer
  • 47.
    AI AGENTS WORKFLOW AI AGENTIS INPUT VALID? PERFORM ACTION SEARCH WITHIN THE KNOWLEDGE BASE CALL AN API RESPONSE ORCHESTRATION PROMPT WHICH ACTION SHOULD I TAKE? PREPROCESSING PROMPT 1 2 3 1 2 3 The agent verifies that the user input is not malicious. The agent creates an orchestration prompt using: • User’s input • Conversation history • Information about knowledge bases and available APIs • Instructions provided by the system developer The Foundation Model choose which action should be taken.
  • 48.
    AI AGENTS WORKFLOW AI AGENTIS INPUT VALID? PERFORM ACTION SEARCH WITHIN THE KNOWLEDGE BASE CALL AN API RESPONSE ORCHESTRATION PROMPT WHICH ACTION SHOULD I TAKE? OBSERVATION PREPROCESSING PROMPT 1 2 3 4 1 2 3 4 The agent verifies that the user input is not malicious. The agent creates an orchestration prompt using: • User’s input • Conversation history • Information about knowledge bases and available APIs • Instructions provided by the system developer The Foundation Model choose which action should be taken. The action’s output is an observation that is used to enrich the orchestration prompt.
  • 49.
    AI AGENTS WORKFLOW AI AGENTIS INPUT VALID? PERFORM ACTION SEARCH WITHIN THE KNOWLEDGE BASE CALL AN API RESPONSE ORCHESTRATION PROMPT WHICH ACTION SHOULD I TAKE? OBSERVATION PREPROCESSING PROMPT 1 2 3 4 5 1 2 3 4 5 The agent verifies that the user input is not malicious. The agent creates an orchestration prompt using: • User’s input • Conversation history • Information about knowledge bases and available APIs • Instructions provided by the system developer The Foundation Model choose which action should be taken. The action’s output is an observation that is used to enrich the orchestration prompt. Looping and refinement until the Agent has all the necessary informations to answer.
  • 50.
    TRACING DETAIL THE STEPSORCHESTRATED BY THE AGENT, HELPING TO FOLLOW THE AGENT’S REASONING PROCESS GUARDRAILS IMPLEMENT SAFEGUARDS FOR GENERATIVE AI APPLICATIONS AI AGENTS ON AMAZON BEDROCK GUARDRAILS & TRACING
  • 51.
    ACTION GROUP IMPLEMENT ANAPI FOR RETRIEVING THE QUANTITY OF AVAILABLE PUPPETS KNOWLEDGE BASE CONTAINS DESCRIPTIONS ABOUT POKEMON PUPPETS AI AGENTS ON AMAZON BEDROCK USE-CASE POKEMON PUPPETS INVENTORY ASSISTANT
  • 52.
    ACTION GROUPS ARE BASEDON LAMBDA FUNTIONS KNOWLEDGE BASE IS HOSTED ON AMAZON OPENSEARCH FOUNDATION MODEL IS CLAUDE 2.1 AI AGENTS ON AMAZON BEDROCK USE-CASE
  • 53.
    UPDATE THIS PRESENTATIONHEADER IN SLIDE MASTER PROSSIMO APPUNTAMENTO AWS UG Torino Meetup 2024 #4 CALL FOR SPEAKERS 02/10/2024 – 18.30 Toolbox Coworking Via Agostino da Montefeltro, 2, Torino Si possono presentare propri progetti, case study, best practice e altro.