ݺߣ

ݺߣShare a Scribd company logo
8
Most read
16
Most read
20
Most read
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Donghoon Jang
Database Specialist SA
AWS
Neptune Analytics
Vector Similar Search
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
2
Agenda
• Graph Data Model
• Amazon Neptune
• Vector Similarity Search with Neptune
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
3
Graph Model
그래프 데이터 모델은 관계
(Relationships) 를 기반
그래프는 연결된 데이터의
연결 및 패턴을 탐색
Name:
Alice
City:
Anytown
works_with
Name:
Bob
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
4
Graph Model
PROPERTY
GRAPH
RESOURCE
DESCRIPTION
FRAMEWORK (RDF)
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
5
Graph Model Label
Node/Vertex
Property
Rel/Edge
Property
Property graph Model
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
6
Graph Model
부자연스러운
쿼리
비효율적인 처리
데이터 변경에 유연하지
않은 엄격한 스키마
vs.RelationalModel
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
7
Graph Model
UseCases
서로 연결된 데이터를 기반으로
• 데이터 자체만큼 데이터 간의 관계가 중요
• 결과가 관계의 강도, 무게 또는 질에 따라 변화
소셜
네트워크
추천 지식 그래프 사기 감지 생명 과학
네트워크 및 IT
운영
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
8
Neptune Analytics
Amazon Neptune
Amazon Neptune
Neptune
Analytics
Neptune
ML
Neptune
Database
𝑃! 𝑃"
𝑃#
𝑃$
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
9
Neptune Analytics
NeptuneDatabases
Neptune
Workbench
Social
networking
Knowledge
graph
Fraud
detection
1 writer and up to 15 read replicas
6 copies of data
across 3 AZs
Up to 128 TiB Automated backup
and restore
Database fast
clone
Bulk load
from S3
Neptune
Streams
Status
Endpoint
Query Read replica
Profile and auto scaling
Explain
AWS Backup Neptune ML Amazon
OpenSearch
Security Graph
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
10
Neptune Analytics
Ø 그래프 워크로드를 위한 단일 서비스
Ø 고성능 그래프 분석 쿼리 및 그래프 알고리즘
Ø Gen AI 애플리케이션을 위한 벡터 저장 및 검색
사용 사례
• 임시 분석
• 낮은 지연 시간의 분석 쿼리
• 그래프 데이터를 이용한 벡터 검색
클러스터링 분석의 예
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
11
Neptune Analytics
Centrality
Degree
PageRank
Closeness
Path Finding
Breadth First Search
Single Source Shortest Path
topK Hop-Limited BFS
Vector Similarity
topK Search
Vector Distance
Clustering
Weakly Connected Components
Label Propagation
Strongly Connected Components
Similarity
Common Neighbors
Total Neighbors
Overlap Similarity
Jaccard Similarity
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
12
Neptune Analytics
Neptune Database Neptune Analytics
Architecture 인스턴스 기반(단일 라이터, 다중 리더)
서버리스 지원
메모리 최적화(캐싱)
메모리 기반
HPC 스타일 그래프 파티셔닝 사용
Terminology Cluster Graph
Graph Frameworks RDF
Property Graph
Property Graph
Query Languages SPARQL (RDF)
openCypher / Gremlin
openCypher – supports CALL, YIELD
Global Databases 단일 기본 리전, 최대 5개의 리더 리전 아직 지원되지 않음
Data Ingestion Bulk Load
Lambda
Bulk Load (80배 더 빠른 로드)
Data Plane API
Workload Types OLTP (transactional) OLAP (analytical)
메모리 집약적인 그래프 계산을 위해 조정됨
Storage 영구 저장 임시 분석 – 대규모 데이터 세트를 빠르게
로드하고 분석
벡터 지원
Generative AI RAG를 위한 LangChain 통합 RAG를 위한 LangChain 통합
벡터/유사성 검색
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
13
Neptune Analytics
사용 사례 사용을 고려…
그래프 데이터 세트 저장
및 관리
Neptune 데이터베이스는 뛰어난 확장성과 가용성을 위해 설계된 서버리스
그래프 데이터베이스
사용 시기 : Neptune 데이터베이스는 초당 100,000개의 쿼리, 다중 AZ
고가용성 및 다중 지역 배포로 확장해야 하는 그래프 데이터베이스
워크로드를 위한 솔루션
그래프 데이터 세트 분석 Neptune Analytics는 대량의 그래프 데이터를 빠르게 분석하여 통찰력을 얻고
추세를 찾아내는 그래프 분석 데이터베이스 엔진
사용 시기: Neptune Analytics는 널리 사용되는 그래프 분석 알고리즘과 지연
시간이 짧은 분석 쿼리를 사용하여 데이터 레이크에 저장된 기존 그래프
데이터베이스 또는 그래프 데이터 세트를 신속하게 분석하기 위한 솔루션
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
14
Neptune Analytics
// Algorithms
MATCH (n:airport {country: 'US’})
WITH collect(n) as airports, n.region as region
CALL neptune.algos.bfs.levels(n)
YIELD node, level
RETURN node, level
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
15
Neptune Analytics
MATCH (n:Book {name: ‘Travel: Portugal’})
// 1 //
CALL neptune.vectors.topKByNode(n, { topK: 10 } )
YIELD node, score, rank
// 2 //
MATCH p=(node)-[*1..3]->(suspicious)
WHERE (suspicious: seller OR suspicious: lister OR suspicious: buyer)
// 3 //
RETURN n, collect(p), score, rank
ORDER BY rank DESC
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
16
Neptune & Vector Similar Search
Neptune
Analytics
Graph Analytics and Vector Search
Amazon
S3
Generative AI Models (LLM)
Amazon
SageMaker
LangChain
OSS
Amazon
Bedrock
Neptune
Database
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
17
Vector Similarity Search
• 벡터 검색은 암시적 유사성을 찾음
• 그래프는 명시적인 컨텍스트를 찾음
• Gen AI 애플리케이션에 대한 더욱
풍부한 응답 제공
Neptune Analytics
Native vector index
Graph
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
18
Vector Similarity Search
Natural language
queries
Vector similarity
search (VSS)
Vector Embedding
공항과 항로 검색
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
19
Vector Similarity Search
• 읽기 쿼리는 세 가지 기본 부분을 기반으로 함 :
• Find
• Filter
• Format
MATCH (a:airport)-[:route]->(b:airport)
WHERE a.code = 'CZM'
RETURN a.code as Source, b.code AS
Destination
Find
Filter
Format
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
20
Vector Similarity Search
Natural language
queries
VSS and
traversals
Vector Embedding
공항과 항로 검색
import boto3
from langchain.embeddings import BedrockEmbeddings
import pandas as pd
df = pd.read_csv("air-routes-latest-nodes.csv")
bedrock_client = boto3.client(service_name="bedrock-runtime", region_name="<INSERT REGION>")
bedrock_embeddings = BedrockEmbeddings(
model_id="amazon.titan-embed-text-v1", client=bedrock_client
)
for i in df.index:
if df.loc[i]["~label"] == "airport":
json = df.loc[i].to_json()
embedding = bedrock_embeddings.embed_query(json)
df.at[i, "embedding:vector"] = (
str(embedding).replace(", ", ";").replace("[", "").replace("]", "")
)
if i % 25 == 0:
print(f"Embedding row {i}")
df.to_csv("air-routes-latest-nodes.csv", index=False)
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
21
Vector Similarity Search
Natural language
queries
Vector similarity
search (VSS)
Vector Embedding
공항과 항로 검색
// Vector Similarity Distance Algorithms
MATCH (n {code: 'ANC'})
MATCH (m) WHERE m.code in ['SEA', 'FAI']
CALL neptune.algo.vectors.distance(n, m)
YIELD distance
RETURN n.code, m.code, distance
// Graph Traverse Query
MATCH (arc:airport)-[*2]->(dest)
WHERE arc.code='ARC' AND NOT (arc)-->(dest) AND dest <> arc
RETURN DISTINCT dest.city AS City
ORDER BY City
// Vector Similarity TopK Algorithms
MATCH ( n:airport {code: 'ANC'} )
CALL neptune.algo.vectors.get(n) YIELD
embedding
RETURN embedding
embedding = res['results'][0]['embedding']
print(len(embedding))
CALL neptune.algo.vectors.topKByEmbedding(
${embedding}
)
YIELD node, score
RETURN node.code, node.desc, score
MATCH ( n:airport {code: 'ANC'} )
CALL neptune.algo.vectors.topKByNode(n)
YIELD node, score
RETURN node.code, node.desc, score
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
AWS DATA & AI ROADSHOW 2024
22
Vector Similarity Search
Natural language
queries
Vector similarity
search (VSS)
Vector Embedding
공항과 항로 검색
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!

More Related Content

Similar to [D3T1S06] Neptune Analytics with Vector Similarity Search (20)

PDF
Graph Database Meetup in Korea #6. Graph Database 5 Offerings_ AssetManager (...
bitnineglobal
PDF
Graph Database Meetup in Korea #4. 그래프 이론을 적용한 그래프 데이터베이스 활용 사례
bitnineglobal
PDF
Cloudera Impala 1.0
Minwoo Kim
PDF
RUCK 2017 - 강병엽 - Spark와 R을 연동한 빅데이터 분석
r-kor
PDF
데이터의 힘, 스타트업의 생존을 넘어 성장으로 - 김용대 사업개발 담당, AWS / 박재영 CTO, 크몽 :: AWS Summit Seou...
Amazon Web Services Korea
PDF
[AWS Builders] 우리 워크로드에 맞는 데이터베이스 찾기
Amazon Web Services Korea
PDF
Graph Database Meetup in Seoul #1. What is Graph Database? (그래프 데이터베이스 소개)
bitnineglobal
PDF
Zeppelin(Spark)으로 데이터 분석하기
SangWoo Kim
PDF
RDF 해설서
Hansung University
PDF
Zeppelin(제플린) 서울시립대학교 데이터 마이닝연구실 활용사례
Taejun Kim
PDF
워크로드에 맞는 데이터베이스 찾기 - 박주연 솔루션즈 아키텍트, AWS :: AWS Summit Seoul 2019
Amazon Web Services Korea
PDF
Unify data and model using Apache S2Graph and GraphQL.
if kakao
PDF
AWS를 활용한 게임 데이터 분석 퀘스트 깨기::안효빈::AWS Summit Seoul 2018
Amazon Web Services Korea
PDF
Serverless로 이미지 크롤링 프로토타입 개발기::유호균::AWS Summit Seoul 2018
Amazon Web Services Korea
PDF
판교 개발자 데이 – AWS 인공지능 서비스를 활용하여 스마트 애플리케이션 개발하기 – 박철수
Amazon Web Services Korea
PPTX
SQL-on-Hadoop with Apache Tajo, and application case of SK Telecom
Gruter
PDF
Amazon Rekognition을 이용하여 인공지능 안면 인식 키오스크 만들기 - 강정희 (AWS 솔루션즈 아키텍트)
Amazon Web Services Korea
PDF
금융 데이터분석을 위한 효과적인 AWS 아키텍쳐::유다니엘::AWS Summit Seoul 2018
Amazon Web Services Korea
PDF
AWS Summit Seoul 2023 | 서버리스, 이제는 데이터 분석에서 활용해요!
Amazon Web Services Korea
PDF
Spark overview 이상훈(SK C&C)_스파크 사용자 모임_20141106
SangHoon Lee
Graph Database Meetup in Korea #6. Graph Database 5 Offerings_ AssetManager (...
bitnineglobal
Graph Database Meetup in Korea #4. 그래프 이론을 적용한 그래프 데이터베이스 활용 사례
bitnineglobal
Cloudera Impala 1.0
Minwoo Kim
RUCK 2017 - 강병엽 - Spark와 R을 연동한 빅데이터 분석
r-kor
데이터의 힘, 스타트업의 생존을 넘어 성장으로 - 김용대 사업개발 담당, AWS / 박재영 CTO, 크몽 :: AWS Summit Seou...
Amazon Web Services Korea
[AWS Builders] 우리 워크로드에 맞는 데이터베이스 찾기
Amazon Web Services Korea
Graph Database Meetup in Seoul #1. What is Graph Database? (그래프 데이터베이스 소개)
bitnineglobal
Zeppelin(Spark)으로 데이터 분석하기
SangWoo Kim
RDF 해설서
Hansung University
Zeppelin(제플린) 서울시립대학교 데이터 마이닝연구실 활용사례
Taejun Kim
워크로드에 맞는 데이터베이스 찾기 - 박주연 솔루션즈 아키텍트, AWS :: AWS Summit Seoul 2019
Amazon Web Services Korea
Unify data and model using Apache S2Graph and GraphQL.
if kakao
AWS를 활용한 게임 데이터 분석 퀘스트 깨기::안효빈::AWS Summit Seoul 2018
Amazon Web Services Korea
Serverless로 이미지 크롤링 프로토타입 개발기::유호균::AWS Summit Seoul 2018
Amazon Web Services Korea
판교 개발자 데이 – AWS 인공지능 서비스를 활용하여 스마트 애플리케이션 개발하기 – 박철수
Amazon Web Services Korea
SQL-on-Hadoop with Apache Tajo, and application case of SK Telecom
Gruter
Amazon Rekognition을 이용하여 인공지능 안면 인식 키오스크 만들기 - 강정희 (AWS 솔루션즈 아키텍트)
Amazon Web Services Korea
금융 데이터분석을 위한 효과적인 AWS 아키텍쳐::유다니엘::AWS Summit Seoul 2018
Amazon Web Services Korea
AWS Summit Seoul 2023 | 서버리스, 이제는 데이터 분석에서 활용해요!
Amazon Web Services Korea
Spark overview 이상훈(SK C&C)_스파크 사용자 모임_20141106
SangHoon Lee

More from Amazon Web Services Korea (20)

PDF
[D3T1S03] Amazon DynamoDB design puzzlers
Amazon Web Services Korea
PDF
[D3T1S04] Aurora PostgreSQL performance monitoring and troubleshooting by use...
Amazon Web Services Korea
PDF
[D3T1S07] AWS S3 - 클라우드 환경에서 데이터베이스 보호하기
Amazon Web Services Korea
PDF
[D3T1S05] Aurora 혼합 구성 아키텍처를 사용하여 예상치 못한 트래픽 급증 대응하기
Amazon Web Services Korea
PDF
[D3T1S02] Aurora Limitless Database Introduction
Amazon Web Services Korea
PDF
[D3T2S01] Amazon Aurora MySQL 메이저 버전 업그레이드 및 Amazon B/G Deployments 실습
Amazon Web Services Korea
PDF
[D3T2S03] Data&AI Roadshow 2024 - Amazon DocumentDB 실습
Amazon Web Services Korea
PDF
AWS Modern Infra with Storage Roadshow 2023 - Day 2
Amazon Web Services Korea
PDF
AWS Modern Infra with Storage Roadshow 2023 - Day 1
Amazon Web Services Korea
PDF
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
Amazon Web Services Korea
PDF
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon Web Services Korea
PDF
Amazon Elasticache - Fully managed, Redis & Memcached Compatible Service (Lev...
Amazon Web Services Korea
PDF
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Amazon Web Services Korea
PDF
[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...
Amazon Web Services Korea
PDF
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
Amazon Web Services Korea
PDF
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon Web Services Korea
PDF
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon Web Services Korea
PDF
Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...
Amazon Web Services Korea
PDF
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...
Amazon Web Services Korea
PDF
From Insights to Action, How to build and maintain a Data Driven Organization...
Amazon Web Services Korea
[D3T1S03] Amazon DynamoDB design puzzlers
Amazon Web Services Korea
[D3T1S04] Aurora PostgreSQL performance monitoring and troubleshooting by use...
Amazon Web Services Korea
[D3T1S07] AWS S3 - 클라우드 환경에서 데이터베이스 보호하기
Amazon Web Services Korea
[D3T1S05] Aurora 혼합 구성 아키텍처를 사용하여 예상치 못한 트래픽 급증 대응하기
Amazon Web Services Korea
[D3T1S02] Aurora Limitless Database Introduction
Amazon Web Services Korea
[D3T2S01] Amazon Aurora MySQL 메이저 버전 업그레이드 및 Amazon B/G Deployments 실습
Amazon Web Services Korea
[D3T2S03] Data&AI Roadshow 2024 - Amazon DocumentDB 실습
Amazon Web Services Korea
AWS Modern Infra with Storage Roadshow 2023 - Day 2
Amazon Web Services Korea
AWS Modern Infra with Storage Roadshow 2023 - Day 1
Amazon Web Services Korea
사례로 알아보는 Database Migration Service : 데이터베이스 및 데이터 이관, 통합, 분리, 분석의 도구 - 발표자: ...
Amazon Web Services Korea
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon Web Services Korea
Amazon Elasticache - Fully managed, Redis & Memcached Compatible Service (Lev...
Amazon Web Services Korea
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Amazon Web Services Korea
[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...
Amazon Web Services Korea
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
Amazon Web Services Korea
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon Web Services Korea
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon Web Services Korea
Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...
Amazon Web Services Korea
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...
Amazon Web Services Korea
From Insights to Action, How to build and maintain a Data Driven Organization...
Amazon Web Services Korea
Ad

[D3T1S06] Neptune Analytics with Vector Similarity Search

  • 1. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Donghoon Jang Database Specialist SA AWS Neptune Analytics Vector Similar Search
  • 2. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 2 Agenda • Graph Data Model • Amazon Neptune • Vector Similarity Search with Neptune
  • 3. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 3 Graph Model 그래프 데이터 모델은 관계 (Relationships) 를 기반 그래프는 연결된 데이터의 연결 및 패턴을 탐색 Name: Alice City: Anytown works_with Name: Bob
  • 4. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 4 Graph Model PROPERTY GRAPH RESOURCE DESCRIPTION FRAMEWORK (RDF)
  • 5. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 5 Graph Model Label Node/Vertex Property Rel/Edge Property Property graph Model
  • 6. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 6 Graph Model 부자연스러운 쿼리 비효율적인 처리 데이터 변경에 유연하지 않은 엄격한 스키마 vs.RelationalModel
  • 7. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 7 Graph Model UseCases 서로 연결된 데이터를 기반으로 • 데이터 자체만큼 데이터 간의 관계가 중요 • 결과가 관계의 강도, 무게 또는 질에 따라 변화 소셜 네트워크 추천 지식 그래프 사기 감지 생명 과학 네트워크 및 IT 운영
  • 8. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 8 Neptune Analytics Amazon Neptune Amazon Neptune Neptune Analytics Neptune ML Neptune Database 𝑃! 𝑃" 𝑃# 𝑃$
  • 9. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 9 Neptune Analytics NeptuneDatabases Neptune Workbench Social networking Knowledge graph Fraud detection 1 writer and up to 15 read replicas 6 copies of data across 3 AZs Up to 128 TiB Automated backup and restore Database fast clone Bulk load from S3 Neptune Streams Status Endpoint Query Read replica Profile and auto scaling Explain AWS Backup Neptune ML Amazon OpenSearch Security Graph
  • 10. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 10 Neptune Analytics Ø 그래프 워크로드를 위한 단일 서비스 Ø 고성능 그래프 분석 쿼리 및 그래프 알고리즘 Ø Gen AI 애플리케이션을 위한 벡터 저장 및 검색 사용 사례 • 임시 분석 • 낮은 지연 시간의 분석 쿼리 • 그래프 데이터를 이용한 벡터 검색 클러스터링 분석의 예
  • 11. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 11 Neptune Analytics Centrality Degree PageRank Closeness Path Finding Breadth First Search Single Source Shortest Path topK Hop-Limited BFS Vector Similarity topK Search Vector Distance Clustering Weakly Connected Components Label Propagation Strongly Connected Components Similarity Common Neighbors Total Neighbors Overlap Similarity Jaccard Similarity
  • 12. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 12 Neptune Analytics Neptune Database Neptune Analytics Architecture 인스턴스 기반(단일 라이터, 다중 리더) 서버리스 지원 메모리 최적화(캐싱) 메모리 기반 HPC 스타일 그래프 파티셔닝 사용 Terminology Cluster Graph Graph Frameworks RDF Property Graph Property Graph Query Languages SPARQL (RDF) openCypher / Gremlin openCypher – supports CALL, YIELD Global Databases 단일 기본 리전, 최대 5개의 리더 리전 아직 지원되지 않음 Data Ingestion Bulk Load Lambda Bulk Load (80배 더 빠른 로드) Data Plane API Workload Types OLTP (transactional) OLAP (analytical) 메모리 집약적인 그래프 계산을 위해 조정됨 Storage 영구 저장 임시 분석 – 대규모 데이터 세트를 빠르게 로드하고 분석 벡터 지원 Generative AI RAG를 위한 LangChain 통합 RAG를 위한 LangChain 통합 벡터/유사성 검색
  • 13. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 13 Neptune Analytics 사용 사례 사용을 고려… 그래프 데이터 세트 저장 및 관리 Neptune 데이터베이스는 뛰어난 확장성과 가용성을 위해 설계된 서버리스 그래프 데이터베이스 사용 시기 : Neptune 데이터베이스는 초당 100,000개의 쿼리, 다중 AZ 고가용성 및 다중 지역 배포로 확장해야 하는 그래프 데이터베이스 워크로드를 위한 솔루션 그래프 데이터 세트 분석 Neptune Analytics는 대량의 그래프 데이터를 빠르게 분석하여 통찰력을 얻고 추세를 찾아내는 그래프 분석 데이터베이스 엔진 사용 시기: Neptune Analytics는 널리 사용되는 그래프 분석 알고리즘과 지연 시간이 짧은 분석 쿼리를 사용하여 데이터 레이크에 저장된 기존 그래프 데이터베이스 또는 그래프 데이터 세트를 신속하게 분석하기 위한 솔루션
  • 14. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 14 Neptune Analytics // Algorithms MATCH (n:airport {country: 'US’}) WITH collect(n) as airports, n.region as region CALL neptune.algos.bfs.levels(n) YIELD node, level RETURN node, level
  • 15. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 15 Neptune Analytics MATCH (n:Book {name: ‘Travel: Portugal’}) // 1 // CALL neptune.vectors.topKByNode(n, { topK: 10 } ) YIELD node, score, rank // 2 // MATCH p=(node)-[*1..3]->(suspicious) WHERE (suspicious: seller OR suspicious: lister OR suspicious: buyer) // 3 // RETURN n, collect(p), score, rank ORDER BY rank DESC
  • 16. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 16 Neptune & Vector Similar Search Neptune Analytics Graph Analytics and Vector Search Amazon S3 Generative AI Models (LLM) Amazon SageMaker LangChain OSS Amazon Bedrock Neptune Database
  • 17. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 17 Vector Similarity Search • 벡터 검색은 암시적 유사성을 찾음 • 그래프는 명시적인 컨텍스트를 찾음 • Gen AI 애플리케이션에 대한 더욱 풍부한 응답 제공 Neptune Analytics Native vector index Graph
  • 18. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 18 Vector Similarity Search Natural language queries Vector similarity search (VSS) Vector Embedding 공항과 항로 검색
  • 19. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 19 Vector Similarity Search • 읽기 쿼리는 세 가지 기본 부분을 기반으로 함 : • Find • Filter • Format MATCH (a:airport)-[:route]->(b:airport) WHERE a.code = 'CZM' RETURN a.code as Source, b.code AS Destination Find Filter Format
  • 20. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 20 Vector Similarity Search Natural language queries VSS and traversals Vector Embedding 공항과 항로 검색 import boto3 from langchain.embeddings import BedrockEmbeddings import pandas as pd df = pd.read_csv("air-routes-latest-nodes.csv") bedrock_client = boto3.client(service_name="bedrock-runtime", region_name="<INSERT REGION>") bedrock_embeddings = BedrockEmbeddings( model_id="amazon.titan-embed-text-v1", client=bedrock_client ) for i in df.index: if df.loc[i]["~label"] == "airport": json = df.loc[i].to_json() embedding = bedrock_embeddings.embed_query(json) df.at[i, "embedding:vector"] = ( str(embedding).replace(", ", ";").replace("[", "").replace("]", "") ) if i % 25 == 0: print(f"Embedding row {i}") df.to_csv("air-routes-latest-nodes.csv", index=False)
  • 21. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 21 Vector Similarity Search Natural language queries Vector similarity search (VSS) Vector Embedding 공항과 항로 검색 // Vector Similarity Distance Algorithms MATCH (n {code: 'ANC'}) MATCH (m) WHERE m.code in ['SEA', 'FAI'] CALL neptune.algo.vectors.distance(n, m) YIELD distance RETURN n.code, m.code, distance // Graph Traverse Query MATCH (arc:airport)-[*2]->(dest) WHERE arc.code='ARC' AND NOT (arc)-->(dest) AND dest <> arc RETURN DISTINCT dest.city AS City ORDER BY City // Vector Similarity TopK Algorithms MATCH ( n:airport {code: 'ANC'} ) CALL neptune.algo.vectors.get(n) YIELD embedding RETURN embedding embedding = res['results'][0]['embedding'] print(len(embedding)) CALL neptune.algo.vectors.topKByEmbedding( ${embedding} ) YIELD node, score RETURN node.code, node.desc, score MATCH ( n:airport {code: 'ANC'} ) CALL neptune.algo.vectors.topKByNode(n) YIELD node, score RETURN node.code, node.desc, score
  • 22. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 AWS DATA & AI ROADSHOW 2024 22 Vector Similarity Search Natural language queries Vector similarity search (VSS) Vector Embedding 공항과 항로 검색
  • 23. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you!