《Build Gen AI Java Apps with Oracle AI Vector Search, Spring AI, and Cohere [PRSH2374].pdf》由會員分享,可在線閱讀,更多相關《Build Gen AI Java Apps with Oracle AI Vector Search, Spring AI, and Cohere [PRSH2374].pdf(28頁珍藏版)》請在三個皮匠報告上搜索。
1、Build GenAI Java Apps with Oracle AI Vector Search,Spring AI,and CohereKuassi MensahSeptember,2024Oracle CloudWorld Copyright 2024,Oracle and/or its affiliates1Oracle CloudWorld Copyright 2024,Oracle and/or its affiliates2Todays AgendaWelcome and IntroductionOverview of Gen AI,Oracle Database 23ai A
2、I Vector Search,RAG,Spring AI and Cohere AIPutting Everything Together=the LabGetting Started with the LabWrap-up&Next StepsOracle CloudWorld Copyright 2024,Oracle and/or its affiliates3Welcome and IntroductionKuassi Mensah Director of Product ManagementOracle CloudWorld Copyright 2024,Oracle and/or
3、 its affiliates4SpeakerThis presentation is intended to outline our general product direction.It is intended for information purposes only,and may not be incorporated into any contract.It is not a commitment to deliver any material,code,or functionality,and should not be relied upon in making purcha
4、sing decisions.The development,release,timing,and pricing of any features or functionality described for Oracles products may change and remains at the sole discretion of Oracle Corporation.Statements in this presentation relating to Oracles future plans,expectations,beliefs,intentions,and prospects
5、 are“forward-looking statements”and are subject to material risks and uncertainties.A detailed discussion of these factors and other risks that affect our business is contained in Oracles Securities and Exchange Commission(SEC)filings,including our most recent reports on Form 10-K and Form 10-Q unde
6、r the heading“Risk Factors.”These filings are available on the SECs website or on Oracles website at http:/ information in this presentation is current as of September 2024 and Oracle undertakes no duty to update any statement in light of new information or future events.Some regulatory certificatio
7、ns or registrations to products or services referenced herein are held by Cerner Corporation.Cerner Corporation is a wholly owned subsidiary of Oracle.Cerner Corporation is an ONC-certified health IT developer and a registered medical device manufacturer in the United States and other jurisdictions
8、worldwide.The materials in this presentation pertain to Oracle Health,Oracle,Oracle Cerner,and Cerner Enviza which are all wholly ow ned subsidiaries of Oracle Corporation.Nothing in this presentation should be taken as indicating that any decisions regarding the integration of any EMEA Cerner and/o
9、r Enviza entities have been made where an integration ha s not already occurred.Oracle CloudWorld Copyright 2024,Oracle and/or its affiliates5Forward-Looking statementsOracle CloudWorld Copyright 2024,Oracle and/or its affiliates6Overview of Gen AI,Oracle Database 23ai AI Vector Search,RAG,Spring AI
10、 and Cohere AIGen AI,LLMs,Vector Embeddings and AI Vector Search 7Copyright 2024,Oracle and/or its affiliates 8/7/241-Gather and pre-process the target dataset(Texts/DocumentsImages,Audio)3-The LLM learns patterns and relationships within the data.LLM 2-Feed LLM with the pre-processed data.334216215
11、033421621504-The LLM generates Embedding Vectors Cohere Oracle Database 23ai:AI Vector InfrastructureNew VECTOR data type(with dimensions)New VECTOR IndexesExtensions to the SQL language to make it simpler to query Vectors(e.g.,VECTOR_DISTANCE).8Copyright 2024,Oracle and/or its affiliates 8/7/24CREA
12、TE TABLE my_images(id NUMBER,image_vec VECTOR(3,FLOAT32);INSERT INTO my_images VALUES(1,TO_VECTOR(1.1,2.2,3.3);SELECT image_vec FROM my_images;SELECT FROM_VECTOR(image_vec)FROM my_images;1.1,2.2,3.3Oracle Database 23ai AI Vector Search 9Copyright 2024,Oracle and/or its affiliates 8/7/24LLM 334216215
13、033421621505-Embedding Vectors stored in Oracle Database 23ai along with the original segments.Retrieval-Augmented Generation(RAG)|Phase 1:Indexing 10Copyright 2024,Oracle and/or its affiliates 8/7/24rSplitterChunksEmbedding Model 3342334216 21EmbeddingsEmbeddings +ChunksOracle Database 23aiRAG|Phas
14、e 2:Retrieval 11Copyright 2024,Oracle and/or its affiliates 8/7/24Query EmbeddingChat Embedding Model 334216 21Embeddings +ChunksQuerySimilarity SearchRelevant ChunkRAGLLM More informed answerSpring AI,Oracle Database 23ai AI Vector Search,and Cohere AI12Copyright 2024,Oracle and/or its affiliates T
15、he Spring AI application submits a prompt to the RAG process.The process is executed with data combined from the remote Cohere AI Command-R model and the Oracle Database 23ai AI Vector Search functionality to retrieve the embeddings.Oracle CloudWorld Copyright 2024,Oracle and/or its affiliates13Putt
16、ing Everything Together=the LabGenAI RAG with Spring AI,Oracle DB 23ai,Oracle AI Vector Search,and Cohere AIOracle CloudWorld Copyright 2024,Oracle and/or its affiliates14Graphical User InterfaceGenAI RAG with Spring AI,Oracle DB 23ai,Oracle AI Vector Search,and Cohere AIOracle CloudWorld Copyright
17、2024,Oracle and/or its affiliates15Solution ArchitectureSpringAiOracleDb23aiRag.java The main application Java classOracleDatabaseVectorStoreConfig.java controls the ingestion of our domain-related data,that is a PDF file OracleDatabaseController.java implements the Spring AI RAG functionality will
18、expose a REST endpoint(/ragpage)that will redirect to the landing pageOracleDatabaseVectorService.java the Spring service class implements the RAG interaction OracleDatabaseVectorStore.java implements the Spring AIs VectorStore interface to deliver the actual vector store implementation that uses th
19、e Oracle AI Vector Search OracleDistanceType.java and PdfDataExtractor.java utility classes that support the custom vector store implementation,the RAG ingestion steps,and the vector search functionality.Software ArchitectureThe GenAI RAG application with Oracle Database 23ai16The Java microservice
20、using Spring Boot,Spring AI and Oracle AI Vector SearchThe Docker containerThe Container registryThe Kubernetes cluster The Cohere mode serverThe backend componentsOracle CloudWorld Copyright 2024,Oracle and/or its affiliates17The application is containerized The Docker image is stored in the Oracle
21、 Cloud container registry The image is deployed over a cluster of the Oracle Kubernetes Engine(OKE)Oracle Cloud Infrastructure Container Engine for Kubernetes(OKE)The Kubernetes ClusterOracle CloudWorld Copyright 2024,Oracle and/or its affiliates18VECTOR_STORE tableCREATE TABLE VECTOR_USER.VECTOR_ST
22、ORE(ID VARCHAR2(64)PRIMARY KEY,METADATA VARCHAR(256),CONTENT CLOB,VECTOR_DATA VECTOR(8192,FLOAT64);CREATE VECTOR INDEX VECTOR_STORE_INDEX ON VECTOR_USER.VECTOR_STORE(VECTOR_DATA)ORGANIZATION NEIGHBOR PARTITIONS DISTANCE COSINE WITH TARGET ACCURACY 95;COMMIT;Oracle Autonomous Database 23ai as a Vecto
23、r Store(VECTOR data type)The Autonomous Transaction Processing DatabaseOracle CloudWorld Copyright 2024,Oracle and/or its affiliates19Oracle CloudWorld Copyright 2024,Oracle and/or its affiliates20Getting Started with the LabOpen up a 2nd tab in your browserGo to the link belowEnter your account inf
24、ormation,choose a tenancy name and loginHands-On LabLets get started!Oracle CloudWorld Copyright 2024,Oracle and/or its affiliates21Hands-On LabLets get started!Oracle CloudWorld Copyright 2024,Oracle and/or its affiliates22Account InformationAddress InformationLog in to your new OCI tenancy!https:/
25、 CloudWorld Copyright 2024,Oracle and/or its affiliates23Global Developers Program for Java(GDP4Java)24We are holding a 2nd edition of the Global Developers Program 4 Java (GDP4Java)Online event October 17th 8:00am to 10:30 am Pacific TimeLearn about our current work and roadmap in the areas of Java
26、 standards and frameworks,Ease of Use,AI,Mission Critical&Observability,and IDE.Share your feedback on your experience with our Java products and frameworks,what you liked,what you dont like,and what we are missing.E-Mail Kuassi.M25Oracle CloudWorld Copyright 2024,Oracle and/or its affiliatesTry Eve
27、rythingfor FREEAI Solutions HubOracle LiveLabsOracle Database F these steps to earn your free swag!1.Scan the QR code and complete our survey2.Visit us at the Demogrounds3.Show your survey confirmation4.Claim your FREE SWAG!We value your feedback!Oracle CloudWorld Copyright 2024,Oracle and/or its af
28、filiates26Complete these steps to earn your free swag!1.Scan the QR code and complete our survey2.Visit us at the Demogrounds3.Show your survey confirmation4.Claim your FREE SWAG!We value your feedback!Oracle CloudWorld Copyright 2024,Oracle and/or its affiliates27Of people love free swag!99%Develop Java apps with Oracle DatabaseThank Y CloudWorld Copyright 2024,Oracle and/or its affiliates28