What's new in Oracle APEX 24.1 - Part 2
What's New in Oracle Apex 24.1 - Part 2
Upcoming Conferences and Events
- The session introduces the second part of a four-part series on what's new in Apex 24.1, highlighting upcoming events including the Apex conference at ODTUG Kscope 24 in Nashville next month.
- The Nashville conference will feature over 65 sessions focused on Apex content, an annual boot camp, and various general sessions aimed at enhancing developer skills.
- Other notable events include the Oracle Code Submit in Malagna, Spain, and the Latin America Oracle User Community tour across ten countries in August.
- Attendees are encouraged to visit apex.com/slgo/events for more information on additional events and to submit any relevant Apex-centric gatherings for approval.
- New blog posts related to Apex 24.1 are available at blogs.oracle.com/aex, along with improved learning paths focusing on AI advancements within Oracle Apex.
Introduction to Vector Search
- Today's session will cover Vector search in Database 23 AI and improvements related to working copies among other features introduced in Apex 24.1.
- The speakers for this session include Tofi Muhammad, Alexis Galdes, and Paige Hansen who will present their respective topics sequentially.
Understanding AI Vector Search
- Tofi Muhammad begins by discussing AI Vector search as a key feature not exclusively new to version 24.1 but also available in earlier versions with Oracle Database 23 AI.
- The agenda includes defining vectors and vector distance, exploring vector data types, PL/SQL APIs, SQL functions available in Oracle Database 23 AI before moving into practical demonstrations.
Key Concepts of Vectors
- Vectors are defined as sequences of numbers (dimensions), capturing essential features of data rather than actual words or pixels; they represent semantic content instead of literal text or images.
- With native implementation of vector data types within the database, users can perform operations like converting text into vectors or calculating distances between them directly inside the database environment.
Applications of Vector Search
- AI Vector search allows combining business data searches with semantic searches alongside traditional keyword searches and fuzzy searches for enhanced results.
- Results from semantic searches can improve prompts sent to large language models (LLMs), leading to more accurate responses that consider business context.
Importance of Vector Distance
- Understanding vector distance is crucial as it measures similarity or difference between two vectors; this helps analyze relationships between underlying data points effectively.
Understanding Vector Data and AI Integration in Oracle Database 23 AI
Introduction to Vector Distance
- The concept of vector distance is introduced, with a focus on the Euclidean distance formula, which measures the straight-line distance between two points in space.
- Various methods for calculating distances are acknowledged, emphasizing that multiple distance formulas exist beyond Euclidean.
Working with Vector Data Types
- In Oracle Database 23 AI, users can create tables with Vector data type columns.
- Two approaches are available:
- Creating a vector column without hard constraints on dimension formats.
- Defining specific dimensions and formats for the vector column.
Importing ONNX Models
- Users can import ONNX (Open Neural Network Exchange) embedding models into the database.
- ONNX serves as an open standard format for machine learning models.
- While vectors can be generated externally using pre-trained or custom embedding models, they can also be imported directly into Oracle Database.
Generating Vector Embeddings
- The database implements an ONNX runtime that allows users to generate vector embeddings using standard SQL commands.
- An example is provided where a vector embedding is created from an overview paragraph using a model stored within the database.
Semantic Search Capabilities
- Once vectors are stored, users can perform semantic searches by calculating vector distances through SQL functions like vector uncore distance.
Demonstration of Features in Oracle Database 23 AI
Accessing Oracle Database 23 AI
- A demonstration begins showcasing how to access Oracle Database 23 AI via OCI as an always-free option.
- Users can provision an autonomous database and select version 23 AI across four regions: Ashburn, London, Frankfurt, and Phoenix.
Enabling Vector Search
- After creating an autonomous database, users gain access to run SQL queries and enable vector search for their Apex schema.
Practical Application: Social Media App Example
- A social media app example illustrates how images uploaded by users have descriptions generated by AI (GPT models).
Keyword vs. Semantic Search
- Basic keyword search functionality is demonstrated; searching "sneakers" retrieves relevant images based on exact matches in descriptions.
Limitations of Keyword Searches
- Searching for "Bombay" yields no results despite having "Mumbai" in descriptions due to lack of exact match—highlighting limitations of traditional keyword searches.
Implementing AI Vector Search
- Upon enabling AI vector search, synonyms like "Bombay" yield results from "Mumbai," demonstrating enhanced understanding through semantic analysis.
Advanced Query Examples
- Further examples show that even phrases not present in descriptions (e.g., “pair of sneakers” or “boots”) return relevant results based on semantic similarity calculated through vector distances.
Development Steps for Semantic Search Implementation
Initial Setup Requirements
How to Use AI Vector Search in Database Applications
Setting Up the Environment
- The user discusses creating a directory after gaining admin access, which is considered an easy method for managing database actions.
- To utilize the Onyx embedding file, the user loads it into an object storage bucket and creates an authentication token (Au token) for accessing this storage.
- The user transfers the Onyx file from the object storage bucket to the created database directory using PL/SQL commands.
Granting Privileges
- After loading the file, privileges are granted to a specific schema: read access to the directory and permission to create mining models necessary for AI Vector search functionality.
- With these grants in place, SQL commands are executed within Apex using the specified schema.
Loading and Registering Models
- The Onyx model is loaded into the database using
dbms_vector.load_onx_model, registering it with a name for future reference.
- Descriptions stored in the database can be converted into vectors without needing external embedding models, showcasing a key advantage of this database system.
Converting Data into Vectors
- The user employs a document model to convert image descriptions into vectors directly within their database table.
- Once converted, both image descriptions and their corresponding vector representations are visible in the object browser of the SM post table.
Implementing Semantic Search
- A timeline region on an application page displays images based on SQL queries that respond dynamically as users input search terms.
- Upon receiving a search query, it is transformed into a vector (query vector), allowing calculation of distances between this vector and others stored in the database.
Building Complex Queries with Basic SQL
- By sorting results based on calculated vector distances, semantic search capabilities are integrated seamlessly into Apex applications without requiring advanced data science knowledge.
Understanding Retrieval Augmented Generation (RAG)
Importance of RAG
- The speaker introduces RAG by discussing its relevance through an example involving inquiries about high schools from parents seeking information about specific institutions.
Contextual Responses Using LLM
- When asked questions like "Is Spanish taught here?", responses are generated based on data stored in databases rather than external sources.
Challenges with Large Context Documents
Understanding AI Vector Search and Retrieval-Augmented Generation
Challenges with Large Language Models (LLMs)
- The number of tokens that can be sent in a system prompt is limited, making it impractical to send entire context documents to LLMs.
- Sending large documents incurs higher costs since users are charged based on the number of input tokens supplied, necessitating efficient information retrieval.
- To optimize costs and efficiency, it's crucial to extract only relevant information from context documents based on user queries.
Implementing AI Vector Search
- Demonstration of an application using vector search to retrieve specific text instead of sending the entire document for processing.
- The application successfully retrieves relevant chunks from the database based on user questions, enhancing response accuracy.
Retrieval-Augmented Generation (RAG) Process
Step 1: Retrieval
- The RAG model consists of three processes: retrieval, augmentation, and generation. The first step involves finding the best-suited chunk from the context document.
- Input prompts are converted into vectors; this allows for effective searching through broken-down chunks stored in a database table called "High School info."
Step 2: Augmentation
- After retrieving the most relevant chunk, it is appended to the prompt along with specific instructions to prevent hallucinations by the LLM if no answer can be found.
Step 3: Generation
- A POST call is made to generate responses using the augmented prompt. This process showcases how RAG can be implemented effectively within Oracle Apex using AI Vector search.
Conclusion and Transition
- The demonstration concludes with an invitation for questions before transitioning to Alexis, who will discuss new item types introduced in Oracle Apex.
User Interaction with Data Sets
Overview of User Selection Limitations
- Users can only select from predefined options in the data set, unable to create custom entries. This is particularly relevant for combo boxes and text fields.
Controlling Options Displayed to Users
- The "maximum values on list" attribute allows control over how many options are presented, currently set at 100 but can be increased up to 999. Users can navigate through these options using scrolling or keyboard inputs.
Fetching Data from Server
- The "Fetch on search" attribute determines when data is fetched from the server; setting it to true fetches results asynchronously with each request, while false loads all data initially and searches occur client-side thereafter. This is beneficial for smaller datasets to minimize database trips.
Caching Search Results
- When enabled, caching stores results of previous searches based on user input, reducing server requests for repeated queries. If a search term yields no results, the cache retains that information for future reference.
Optimizing Search Execution
- A minimum character requirement can be set before executing a search (default is zero). For example, requiring three characters prevents unnecessary queries until sufficient input is provided by the user. This helps manage performance during complex queries or large datasets.
Search Functionality Enhancements
Configuring Search Match Types
- Two match types are available: "contains," which checks if the search term appears anywhere in the string, and "starts with," which verifies if the string begins with the search term entered by the user. Additionally, case sensitivity can be toggled based on requirements.
Multi-column Search Capabilities
- Users can configure multiple columns for searching within a dataset (e.g., country name, capital) while excluding others (e.g., population). This flexibility enhances user experience by allowing broader search criteria without cluttering irrelevant data points.
Icon Support and Grouping Options
- Icons can be defined within lists of values to enhance visual representation; grouping items (e.g., countries by continent) improves organization and usability in selection interfaces as users type their queries. This feature aids in quickly identifying related items within larger datasets.
User Feedback Mechanisms
Custom Messages for No Matches Found
Template Directives and Select Options
Overview of Template Directives
- Introduction to template directives, showcasing a simplistic example with an image and title.
- Explanation of HTML Expressions attribute that allows defining HTML, using substitution strings for additional display columns.
- Demonstration of using image URLs within template directives to enhance visual representation.
Enhancing User Interface
- Discussion on conditional formatting in template directives, such as changing item color when out of stock for better UI experience.
Differences Between Select One and Select Many
Interaction Features
- Key differences highlighted: select one allows only single value selection while select many permits multiple selections via mouse or keyboard.
- Users can delete selected options using backspace or an 'X' icon; navigation between items is facilitated by keyboard shortcuts.
Display Options
- Developers can control how selected values are displayed (comma-separated list vs. chips), affecting the height of the item based on selections.
Behavior of Select One Component
Pre-selection Mechanism
- In select one mode, typing will pre-select the first matching item from the dropdown to streamline user interaction.
Handling Invalid Inputs
- If a user types an invalid entry not present in the dataset, it reverts to the last valid selection upon losing focus.
Clearing Selections and Multi-value Control
Simplified Clearing Process
- Users can clear selections easily by clicking an 'X' button instead of navigating through backspace operations.
Multi-value Item Management
- Introduction to managing multi-value states in page designer; options include limited lists or adjacent arrays for JSON processing compatibility.
Working Copies Enhancements
Overview of Working Copies in Apex 241
New Features in Working Copies of Application Development
Overview of New Enhancements
- The latest update allows tracking and comparing changes between working copies for a single page, enhancing developer workflow.
- An alert feature has been added to notify developers when they are working in the main version of an application, preventing unintentional modifications.
- Enhancements to the working copy menu enable easy comparison with the main version at any time while navigating within the page designer.
Demonstration Context
- The speaker is using a "movies watch list" application alongside another developer named Low Coder to implement new features.
- A new alert banner indicates that developers are in the main version, helping them avoid accidental changes.
Switching Between Versions
- Developers can now switch directly between different versions or back to the main version without leaving the page designer, streamlining their workflow.
- A new icon in the toolbar highlights existing changes in other working copies, allowing quick access to see modifications made by others.
Viewing Changes and Differences
- The dialogue shows all modifications or locks on a specific page across different copies, providing details about updates and who made them.
- Developers can view differences between their current working copy and another specified one through a dedicated viewing dialogue.
Comparing Current Page with Main Version
- A new option allows developers to compare an individual page against its main version without needing a full application export.
Overview of Changes in Application Working Copies
Key Changes and Features
- The speaker compares the current version of their work with the main version, noting that only minor changes have been made.
- It is emphasized that unsaved changes will not appear in comparisons; only the last saved version will be shown, highlighting the importance of saving work before comparison.
- The session wraps up with an invitation for questions, indicating a collaborative environment and openness to feedback from participants.
Additional Resources and Future Engagements
- Participants are encouraged to visit the Apex forum for further questions and discussions, promoting community engagement beyond the session.
- Information about replays of previous office hours is provided, ensuring attendees can revisit content at their convenience.