Tuesday, 9 June 2026

OCI Generative AI and Select AI

Question :how to connect autonomous database from sql developer and with oracle free on prem database 26 ai in windows


Connecting to both an Oracle Autonomous Database (Cloud) and an Oracle Database 26ai Free (On-Premises) using SQL Developer on Windows requires different configuration methods
The Cloud database relies on a secure credential wallet (mTLS), whereas the local 26ai Free instance relies on standard TNS parameters like host, port, and service name. 

1. Connect to Autonomous Database (Cloud)
Step 1: Download the Client Wallet
  1. Log into your Oracle Cloud Infrastructure (OCI) Console.
  2. Navigate to Autonomous AI Database and select your instance.
  3. Click Database Connection and click Download Wallet.
  4. Set a wallet password (keep it safe) and download the .zip archive. Do not extract it. 
Step 2: Configure SQL Developer Connection
  1. Open Oracle SQL Developer.
  2. Click the green + (New Connection) button.
  3. Populate the configuration properties as follows:
Field Configuration Value
Connection NameOCI_Autonomous_DB
UsernameADMIN (or your database user)
PasswordYour cloud database admin password
Connection TypeChoose Cloud Wallet from the dropdown menu
Configuration FileClick Browse and select the downloaded .zip wallet
ServiceSelect a pre-defined service from the drop-down (e.g., yourdb_high, yourdb_medium, or yourdb_low)
  1. Click Test; if it displays Status: Success, click Save and Connect. 

2. Connect to Oracle Database 26ai Free (On-Premises)
Step 1: Verify Local Connection Parameters []
The default local service credentials installed by Oracle Database Free on Windows are typically as follows: 
  • Host: localhost (or 127.0.0.1)
  • Port: 1521
  • Service Name: FREEPDB1 (Pluggable Database) or FREE (Root Container) 
Step 2: Configure SQL Developer Connection
  1. In SQL Developer, click the green + (New Connection) icon.
  2. Enter the following properties: 
Field Configuration Value
Connection NameOracle_26ai_Local
UsernameSYS or SYSTEM
PasswordThe password you set during the local 26ai installation
RoleSelect SYSDBA (if using SYS) or Default (if using SYSTEM)
Connection TypeBasic
Hostnamelocalhost
Port1521
Service NameFREEPDB1
  1. Click Test, confirm Status: Success, and click Connect. 

3. Verification Test Cases & Command Examples
Once connected to either database sheet worksheet, run the following test commands to ensure full capability and feature availability:
Test Case 1: Database Version Check
Verifies the exact version of the Oracle Database engine running.
sql
SELECT banner_full FROM v$version;
  • Expected Output (Cloud): Oracle Database 19c Enterprise Edition... or Oracle Database 23ai/26ai...
  • Expected Output (Local): Oracle Database 26ai Free Release... 
Test Case 2: Identify Current Container (PDB) Context 
Verifies if you are linked directly to your Pluggable Database container instead of the Root Container. 
sql
SELECT sys_context('USERENV', 'CON_NAME') AS current_container FROM dual;
  • Expected Output (Cloud): Unique generated PDB name (e.g., A48B7G_DB)
  • Expected Output (Local): FREEPDB1 
Test Case 3: 26ai Vector / AI Capability Test
A key feature of the AI database series is AI Vector capabilities. Test the vector syntax parser: 
sql
-- Create a table holding vector data types
CREATE TABLE local_ai_test (
    id NUMBER PRIMARY KEY,
    embedding VECTOR(3, FLOAT32)
);

-- Insert dummy high-dimensional array data
INSERT INTO local_ai_test VALUES (1, '[0.12, -0.43, 0.89]');

-- Query it back
SELECT * FROM local_ai_test;
  • Expected Output: Rows successfully inserted and displayed without mathematical parsing syntax errors.



Python


Question : Scenario: We are building a multilingual, enterprise-grade Retrieval-Augmented Generation (RAG) system. The user submits a prompt in any language (e.g., Spanish, French, or Hindi). The application needs to dynamically detect the language, fetch context from an Oracle Database 26ai Vector Store using unified embeddings, pass that context to an OCI Generative AI LLM via LangChain, and respond back in the same user language. 

How would you architecture and code this 'Language Change Integration' workflow natively inside OCI? Provide architectural details, LangChain code examples, PL/SQL command configurations for Oracle Database 26ai Select AI, and end-to-end test cases." 

Comprehensive Answer
Architecture & Core Concepts
  1. OCI Generative AI (LLM / Embeddings): Leverages foundational models like cohere.command-r-plus for text translation/generation and cohere.embed-multilingual-v3 for vector generation. Multilingual models natively handle multiple languages without separate translation layers. 
  2. LangChain Integration: Acts as the orchestration layer. It routes inputs, manages OCIGenAI and OCIGenAIEmbeddings classes, hooks up the conversation memory, and executes retrieval. 
  3. Oracle Database 26ai (Select AI & AI Vector Search): Stores text chunks and their multi-dimensional numerical embeddings. It natively supports distance metrics (like Cosine or Dot Product) to retrieve context across language variations. Select AI parses conversational human language directly into database-optimized SQL sequences using active AI profiles. 

1. Oracle Database 26ai Configuration (PL/SQL)
Configure the database to interact with the OCI Generative AI endpoint using the built-in DBMS_CLOUD_AI package. 
sql
-- Step 1: Grant execute permissions on the AI package to your schema
GRANT EXECUTE ON DBMS_CLOUD_AI TO MY_APP_SCHEMA;

-- Step 2: Create a secure credential pointing to OCI IAM profile credentials
BEGIN
  DBMS_CLOUD.CREATE_CREDENTIAL(
    credential_name => 'OCI_GENAI_CRED',
    user_ocid       => 'ocid1.user.oc1..example',
    tenancy_ocid    => 'ocid1.tenancy.oc1..example',
    private_key     => 'MIIEogIBAAKCAQEA0...', -- Truncated text key
    fingerprint     => 'xx:xx:xx:xx:xx:xx:xx:xx'
  );
END;
/

-- Step 3: Define a Multilingual AI Profile in Oracle Database 26ai
BEGIN
  DBMS_CLOUD_AI.CREATE_PROFILE(
    profile_name => 'OCI_MULTILINGUAL_PROFILE',
    attributes   => '{"provider": "oci",
                      "credential_name": "OCI_GENAI_CRED",
                      "region": "us-chicago-1",
                      "model": "cohere.command-r-plus",
                      "temperature": 0.2,
                      "language": "DYNAMIC"}' -- Instructs the engine to adapt to user input language
  );
END;
/
To run a direct test natively via SQL: 
sql
-- Activate the profile for the current database session
EXEC DBMS_CLOUD_AI.SET_PROFILE('OCI_MULTILINGUAL_PROFILE');

-- Query using natural language translation change directly in SQL CLIs
SELECT AI ¿Cuáles son los detalles de la política de la empresa?
2. LangChain Integration Script (Python)
This script catches input, embeds it multilingually, fetches it from Oracle Database 26ai, and forces OCI Generative AI to preserve the incoming language. 
python
import os
from langchain_community.llms import OCIGenAI
from langchain_community.embeddings import OCIGenAIEmbeddings
from langchain_community.vectorstores import OracleVS # 26ai Native Integration
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import RunnablePassthrough
from langchain_core.output_parsers import StrOutputParser

# 1. Initialize OCI Generative AI Configuration
COMPARTMENT_ID = "ocid1.compartment.oc1..example"
ENDPOINT_URL = "https://oraclecloud.com"

# Multilingual Embeddings Engine (Cohere)
embeddings = OCIGenAIEmbeddings(
    model_id="cohere.embed-multilingual-v3",
    compartment_id=COMPARTMENT_ID,
    service_endpoint=ENDPOINT_URL
)

# LLM Framework Instance
llm = OCIGenAI(
    model_id="cohere.command-r-plus",
    compartment_id=COMPARTMENT_ID,
    service_endpoint=ENDPOINT_URL,
    model_kwargs={"temperature": 0.1, "max_tokens": 600}
)

# 2. Establish connection to Oracle Database 26ai Vector Store
# Assumes a table with vector data type exists in Oracle 26ai
db_vector_store = OracleVS(
    client=None, # Provide active cx_Oracle or python-oracledb connection here
    embedding_function=embeddings,
    table_name="ENTERPRISE_KNOWLEDGE_VECTORS"
)
retriever = db_vector_store.as_retriever(search_kwargs={"k": 3})

# 3. Prompt Engineering handling Dynamic Language Rules
language_system_prompt = (
    "You are an enterprise assistant. You are given retrieved context and a question.\n"
    "CRITICAL RULE: Identify the language of the user question. You MUST reply completely "
    "in that exact same language. Do not translate code syntax, but translate all explanations.\n\n"
    "Context:\n{context}\n\n"
    "Question: {question}\n\n"
    "Answer:"
)

prompt = ChatPromptTemplate.from_template(language_system_prompt)

# 4. Construct LangChain Expression Language (LCEL) Chain Workflow
rag_chain = (
    {"context": retriever, "question": RunnablePassthrough()}
    | prompt
    | llm
    | StrOutputParser()
)

# Executable Function Hook
def ask_ai_agent(user_query: str) -> str:
    return rag_chain.invoke(user_query)
3. Command Examples & Execution Lifecycle
Initializing Environment Commands
Before starting the client application, set up the workspace shell:
bash
# Install required extensions
pip install langchain langchain-community python-oracledb oci

# Export local configuration credentials if not using instance principal profiles
export OCI_COMPARTMENT_ID="ocid1.compartment.oc1..example"
export OCI_REGION="us-chicago-1"
Invoking the Application Execution
bash
python -c "
from app import ask_ai_agent
print(ask_ai_agent('What is the policy on remote work?'))
"
4. End-to-End System Test Cases
Test IDTest Scenario / InputExpected System Behavior & Validation
TC-001English Request: "What is the company vacation policy?"1. Generates embedding vector via Cohere Multilingual.
2. Queries Oracle 26ai vector space.
3. Output is verified to be in English.
TC-002Language Change (Spanish): "¿Cuál es la política de vacaciones?"1. Semantic retrieval extracts matching context from the database table (even if data is stored in English).
2. Output is verified to be entirely in Spanish.
TC-003Language Change (French): "Quelle est la politique de vacances?"1. Engine processes French query inputs without crashes.
2. Returns response in accurate French prose.
TC-004Database Failure / Missing Context Exception1. Drop network connection to Oracle Database 26ai.
2. Check that LangChain catches the fallback gracefully without throwing unstructured trace errors.



Question : "How do you integrate Oracle Cloud Infrastructure (OCI) Generative AI services with the LangChain framework to build enterprise-grade LLM applications, and how do you handle authentication securely?"

To integrate OCI Generative AI with LangChain, you must use the updated, dedicated langchain-oci package (as the older langchain_community components are deprecated). 
The integration relies on initializing a model class—such as ChatOCIGenAI for chat applications or OCIGenAIEmbeddings for vector generation—by passing three critical configurations: 
  1. compartment_id: The OCI unique identifier (OCID) where quotas and permissions are mapped.
  2. service_endpoint: The regional inference URL (e.g., Chicago region).
  3. model_id: The specific foundation model (e.g., customized Meta Llama or Cohere models). 
Authentication Strategies
Secure production deployments avoid hardcoded keys by utilizing OCI’s native identity stack via four primary methods: 
  • API_KEY (Local Development): Uses the local config file typically stored at ~/.oci/config.
  • SECURITY_TOKEN: Best for session-based CLI or cloud shell interactions.
  • INSTANCE_PRINCIPAL / RESOURCE_PRINCIPAL (Production): Grants compute instances or serverless functions direct, IAM-managed permissions to talk to the Generative AI service without managing credential files. 

Command & Setup Example
1. Environment Setup
Install the core components and the specialized OCI provider library. 
bash
# Update and install LangChain and OCI dedicated extension
pip install -U langchain langchain-oci oci
2. Python Integration Script (app.py)
This script establishes a conversational chain using ChatOCIGenAI and structural system prompts. 
python
import os
from langchain_oci import ChatOCIGenAI
from langchain_core.prompts import ChatPromptTemplate

# Ensure you have your OCI configuration profile ready locally (~/.oci/config)
# Or configure Environment Variables if using Resource Principals
COMPARTMENT_ID = os.getenv("OCI_COMPARTMENT_ID", "ocid1.compartment.oc1..example_id")
SERVICE_ENDPOINT = "https://inference.generativeai.us-chicago-1.oci.oraclecloud.com"
MODEL_ID = "meta.llama-4-maverick-17b-128e-instruct-fp8" # Example Llama model ID

def get_oci_llm_response(user_query: str) -> str:
    # Initialize the OCI Generative AI Chat Model
    llm = ChatOCIGenAI(
        model_id=MODEL_ID,
        service_endpoint=SERVICE_ENDPOINT,
        compartment_id=COMPARTMENT_ID,
        model_kwargs={"temperature": 0.2, "max_tokens": 500},
        auth_type="API_KEY", # Can switch to RESOURCE_PRINCIPAL in production
        auth_profile="DEFAULT"
    )
    
    # Structure the workflow using LangChain Expression Language (LCEL)
    prompt = ChatPromptTemplate.from_messages([
        ("system", "You are an expert OCI cloud architect. Answer concisely."),
        ("human", "{query}")
    ])
    
    # Chain components together
    chain = prompt | llm
    
    # Invoke the model
    response = chain.invoke({"query": user_query})
    return response.content

if __name__ == "__main__":
    sample_query = "What is the primary benefit of OCI Service Gateway?"
    print(f"Query: {sample_query}\n")
    print(f"Response:\n{get_oci_llm_response(sample_query)}")
Test Cases (Unit & Integration)
Create a testing script using pytest to validate both standard operational outputs and failure paths. 
bash
pip install pytest pytest-mock
Test Suite (test_app.py)
python
import pytest
from unittest.mock import MagicMock, patch
from app import get_oci_llm_response

# -------------------------------------------------------------------------
# Test Case 1: Integration / Happy Path (Mocked Response)
# Purpose: Verifies LangChain structural pipeline routes inputs correctly to OCI.
# -------------------------------------------------------------------------
@patch('langchain_oci.ChatOCIGenAI.invoke')
def test_successful_llm_invocation(mock_invoke):
    # Setup mock response structure mimicking LangChain AIMessage object
    mock_response = MagicMock()
    mock_response.content = "OCI Service Gateway provides secure private access to Oracle Services."
    mock_invoke.return_value = mock_response
    
    query = "Explain OCI Service Gateway."
    result = get_oci_llm_response(query)
    
    assert "Service Gateway" in result
    mock_invoke.assert_called_once()

# -------------------------------------------------------------------------
# Test Case 2: Error Handling / Authentication Failure
# Purpose: Ensures application gracefully catches OCI identity failures.
# -------------------------------------------------------------------------
@patch('langchain_oci.ChatOCIGenAI.invoke')
def test_oci_authentication_error(mock_invoke):
    from oci.errors import ServiceError
    
    # Simulate a 401 Unauthorized error from Oracle Cloud Infrastructure
    mock_invoke.side_effect = ServiceError(
        status=401,
        code="NotAuthenticated",
        message="The required API Key or Token is invalid.",
        headers={}
    )
    
    with pytest.raises(ServiceError) as exc_info:
        get_oci_llm_response("Trigger an auth error")
        
    assert exc_info.value.status == 401
    assert "NotAuthenticated" in exc_info.value.code
Execute Test Command
Run the tests directly from your terminal session:
bash
pytest test_app.py -v

Question:How would you design a scalable enterprise architecture that uses LangChain to orchestrate OCI Generative AI and an Oracle Autonomous Database (with AI Vector Search / Select AI)? How do you handle dynamic adjustments such as language translation or switching foundational LLM models on the fly?

Answer:
The architecture relies on three foundational pillars linked together via LangChain:
  1. Orchestration Layer (LangChain): Serves as the nervous system. It handles incoming user prompts, tracks chat memory, manages prompt templates, and switches the underlying LLMs or execution chains conditionally (e.g., dynamically piping inputs through an OCI Translation step or swapping a Cohere model for a Llama model based on context or cost). 
  2. Compute & Inference (OCI Generative AI): Hosts dedicated foundational models (e.g., Meta Llama, Cohere Command) via managed, scalable endpoints. It produces embeddings or text completions without enterprise data ever leaving the secure OCI tenancy boundary. 
  3. Data & Context Layer (Oracle Autonomous Database): Operates in two modes. First, it uses Select AI (DBMS_CLOUD_AI) to translate natural language directly into optimized SQL queries against structured database rows. Second, it utilizes AI Vector Search to store high-dimensional text embeddings of unstructured documentation for RAG semantic search pipelines. 

💻 Code Integration Example (Python & LangChain)
Below is an enterprise-grade integration snippet showing how to set up OCIGenAI via LangChain, connect it with Oracle Database, and use an engine wrapper that routes data flexibly.
python
import os
import oci
from langchain_community.llms import OCIGenAI
from langchain_core.prompts import PromptTemplate
from langchain_core.output_parsers import StrOutputParser
import oracledb

# 1. Initialize OCI Generative AI Client Configuration
# Uses default configuration (~/.oci/config) and Resource Principal / API Keys
COMPARTMENT_ID = "ocid1.compartment.oc1..example_id"
ENDPOINT_URL = "https://oraclecloud.com"

def get_llm(model_id="cohere.command", temperature=0.1):
    """Dynamically switch models by changing the model_id parameter"""
    return OCIGenAI(
        model_id=model_id,
        service_endpoint=ENDPOINT_URL,
        compartment_id=COMPARTMENT_ID,
        model_kwargs={"temperature": temperature, "max_tokens": 500}
    )

# 2. Database Connection Helper (Oracle Autonomous Database)
def query_autonomous_db(prompt_text):
    # Establish connection using thin mode or wallet string
    connection = oracledb.connect(
        user="db_demo_user",
        password="YourSecurePassword2026!",
        dsn="adb_high_service_name_tp"
    )
    cursor = connection.cursor()
    
    # Utilizing Autonomous Database Select AI feature natively integrated 
    # to let the DB evaluate the natural language query context directly
    cursor.execute("BEGIN DBMS_CLOUD_AI.SET_PROFILE('GENAI_PROD_PROFILE'); END;")
    
    # Execute prompt with SELECT AI prefix
    cursor.execute(f"SELECT AI {prompt_text}")
    result = cursor.fetchall()
    
    cursor.close()
    connection.close()
    return result

# 3. LangChain Translation & Execution Chain
def run_multilingual_rag_pipeline(user_query, target_lang="English"):
    # Step A: Setup Language processing prompt dynamically
    lang_prompt = PromptTemplate.from_template(
        "Translate the following user query to {target_lang} if it's not already. Query: {query}"
    )
    
    llm = get_llm(model_id="meta.llama-3.3-70b-instruct") # Using Llama for reasoning
    translation_chain = lang_prompt | llm | StrOutputParser()
    
    # Process translated query string
    processed_query = translation_chain.invoke({"query": user_query, "target_lang": target_lang})
    print(f"[Debug] Processed System Query: {processed_query}")
    
    # Step B: Fetch structured facts from Oracle Autonomous Database
    db_context = query_autonomous_db(processed_query)
    
    return f"Database validated response context: {db_context}"
🛠️ OCI Configuration & Database Setup Commands
Execute these deployment steps to wire the infrastructure security and instantiate AI Profiles inside your instance. 
1. OCI IAM Security Policies Setup 
Run this via OCI CLI or OCI Console to allow your Autonomous Database instance to call your Generative AI endpoints securely via Resource Principal: 
bash
# Allow your Autonomous Database Dynamic Group to manage GenAI services in the target compartment
oci iam policy create \
  --compartment-id ocid1.tenancy.oc1..root_tenancy_id \
  --name "ADB_GenAI_Access_Policy" \
  --description "Policy allowing ADB instance to call OCI Generative AI models" \
  --statements '["Allow dynamic-group ADB_Dynamic_Group to manage generative-ai-family in compartment id '"$COMPARTMENT_ID"'"]'
2. Autonomous Database PL/SQL Engine Setup
Connect to your ADB instance as an administrator (e.g., using SQL Developer or SQLcl) and provision the execution profile: 
sql
-- Step A: Enable Resource Principal authentication inside ADB
EXEC DBMS_CLOUD_ADMIN.ENABLE_PRINCIPAL_AUTH(provider => 'OCI');

-- Step B: Grant execution privileges to your application schema user
GRANT EXECUTE ON DBMS_CLOUD_AI TO db_demo_user;

-- Step C: Connect as the schema user and build the Generative AI Model Profile
BEGIN
  DBMS_CLOUD_AI.CREATE_PROFILE(
    profile_name => 'GENAI_PROD_PROFILE',
    attributes   => '{"provider": "oci",
                      "compartment_id": "ocid1.compartment.oc1..example_id",
                      "region": "us-chicago-1",
                      "model": "meta.llama-3.3-70b-instruct",
                      "object_storage_credential": "OCI_PRINCIPAL"}'
  );
END;
/
🧪 Test Cases
Validate validation stability using this predefined QA matrices plan:
Test Case ID Test Scenario DescriptionExpected Input PayloadExpected Output Behavior
TC-001LangChain dynamically handles model swaps on the fly.get_llm(model_id="cohere.command")Pipeline executes inference successfully using Cohere API formatting parameters.
TC-002Dynamic multilingual translation routing.User Prompt: "¿Cuáles son los ingresos totales de la empresa?"LangChain translates it to English, passes it to Select AI, and returns records smoothly.
TC-003Select AI context generation execution.Prompt Text: "Show total salaries by department"System parses database metadata, generates valid Oracle SQL syntax, runs it, and yields dataset tables.
TC-004Security Boundary Validation via IAM.Call with invalid/revoked OCI Dynamic Group token.Database throws explicit ORA-20401: Authorization failed blocking unauthorized endpoint execution.







Q1: What is the high-level architecture when integrating Oracle 23ai with OCI Generative AI for RAG?
Answer: The architecture operates as a Converged Database pipeline
  1. Unstructured Data Ingestion: Documents are loaded into Oracle 23ai. 
  2. Chunking & Embedding: Sentences are broken into chunks, and the DBMS_VECTOR or DBMS_CLOUD_AI package sends chunks to an OCI Generative AI embedding model (e.g., cohere.embed-english-v3.0). 
  3. Vector Store: The generated arrays are stored in a native VECTOR column. 
  4. Retrieval (Semantic Query): A user query is converted into an embedding, and a vector similarity search (VECTOR_DISTANCE) fetches the top-K relevant data chunks. 
  5. Generation: The database combines the user prompt with the fetched context and forwards it to an LLM hosted on OCI Generative AI via Select AI. 

Q2: How do you establish a secure connection between Oracle 23ai and OCI GenAI?
Answer: You must use the database package DBMS_VECTOR.CREATE_CREDENTIAL (or DBMS_CLOUD_AI.CREATE_PROFILE). It stores OCI Identity and Access Management (IAM) parameters securely in the database utilizing Oracle Wallet. 
💻 Command Example: Setting up Credential & Select AI Profile
sql
-- Step 1: Create a secure credential using your OCI user/tenancy OCIDs
BEGIN
  DBMS_VECTOR.CREATE_CREDENTIAL(
    credential_name => 'OCI_GENAI_CRED',
    params          => json('{
      "user_ocid"       : "ocid1.user.oc1..exampleuserocid",
      "tenancy_ocid"    : "ocid1.tenancy.oc1..exampletenancyocid",
      "compartment_ocid": "ocid1.compartment.oc1..examplecompartmentocid",
      "private_key"     : "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEA...YourKey...\n-----END RSA PRIVATE KEY-----",
      "fingerprint"     : "xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
    }')
  );
END;
/

-- Step 2: Create a configuration profile for Select AI linking to OCI GenAI 
BEGIN
  DBMS_CLOUD_AI.CREATE_PROFILE(
    profile_name => 'OCI_GENAI_PROFILE',
    attributes   => json('{
      "provider"       : "ocigenai",
      "credential_name": 'OCI_GENAI_CRED',
      "object"         : "cohere.command-r-plus",
      "region"         : "us-chicago-1",
      "temperature"    : 0.2
    }')
  );
END;
/
🧪Test Case: Validating the LLM Connectivity
  • Action: Direct conversational test checking LLM health.
sql
SELECT DBMS_CLOUD_AI.GENERATE(
         prompt       => 'Verify connectivity. What is the current year?',
         profile_name => 'OCI_GENAI_PROFILE'
       ) AS llm_response FROM DUAL;
  • Expected Result: A valid string response from the Cohere model (e.g., "The current year is 2026.").

Q3: How do you create a table for Vector Embeddings and perform a semantic search? 
Answer: You define a table containing the VECTOR data type specifying its dimensions and format. To perform similarity searches, you use the VECTOR_DISTANCE() function. 
💻 Command Example: Vector Storage & Ingestion Pipeline
sql
-- Step 1: Create a table storing chunks and their associated text embeddings
CREATE TABLE corporate_policies (
    id         NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
    chunk_id   VARCHAR2(50),
    chunk_text CLOB,
    embedding  VECTOR(1024, FLOAT32) -- Dimensions match cohere.embed-english-v3.0
);

-- Step 2: Ingest text and convert it to vector dynamically via OCI GenAI
INSERT INTO corporate_policies (chunk_id, chunk_text, embedding)
VALUES (
  'POL_01',
  'Remote employees can claim up to $500 yearly for home office internet expenses.',
  DBMS_VECTOR_CHAIN.UTL_TO_EMBEDDING(
    'Remote employees can claim up to $500 yearly for home office internet expenses.',
    json('{"provider": "ocigenai", "credential_name": "OCI_GENAI_CRED", "url": "https://inference.generativeai.us-chicago-1.oci.oraclecloud.com/20231130/actions/embedText", "model": "cohere.embed-english-v3.0"}')
  )
);
COMMIT;
🧪 Test Case: Querying data semantically using an input phrase
  • Action: Requesting data matching a semantic concept instead of an exact keyword matching. 
sql
VARIABLE query_text VARCHAR2(200);
EXEC :query_text := 'Can I get reimbursed for my Wi-Fi at home?';

SELECT chunk_text, 
       VECTOR_DISTANCE(embedding, 
         DBMS_VECTOR_CHAIN.UTL_TO_EMBEDDING(:query_text, json('{"provider": "ocigenai", "credential_name": "OCI_GENAI_CRED", "url": "https://inference.generativeai.us-chicago-1.oci.oraclecloud.com/20231130/actions/embedText", "model": "cohere.embed-english-v3.0"}')), 
         COSINE) AS distance
FROM corporate_policies
ORDER BY distance FETCH FIRST 1 ROWS ONLY;
  • Expected Result: The query accurately returns the text snippet regarding home office internet expenses with a low cosine distance value, despite the word "reimbursed" or "Wi-Fi" not being explicitly inside the base row. 

Q4: What is "Select AI" in Oracle 23ai, and how does it prevent enterprise data exposure?
Answer: Select AI translates a natural language question into SQL, executes it natively, and presents standard outputs. It maintains data privacy because only database schema metadata (table name, comments, types) is forwarded to the OCI Generative AI LLM. No actual row-level transactional data ever leaves the Oracle firewall during compilation. 
💻 Command Example: Executing Natural Language Queries 
sql
-- Enable the created profile for your session
EXEC DBMS_CLOUD_AI.SET_PROFILE('OCI_GENAI_PROFILE');

-- Run natural language prompts directly through SQL*Plus or SQL Developer
SELECT AI show me corporate policies;

-- Check what SQL command was created under-the-hood by the LLM
SELECT AI showsql how many policy records exist;
🧪 Test Case: Meta-data dependency test
  • Action: Add comments to ensure accuracy, then prompt the engine. 
sql
COMMENT ON COLUMN corporate_policies.chunk_text IS 'Contains human readable HR policy rules';

SELECT AI find rules about working from home;
  • Expected Result: The internal engine parses the comment metadata, forms a proper SELECT * FROM corporate_policies WHERE... expression, and accurately queries your table. 



Question
"How would you design and implement a local Retrieval-Augmented Generation (RAG) system on Windows that safely exposes internal corporate knowledge using the LangChain framework, OCI Generative AI (Cloud LLM), and an on-premises Oracle Database 26ai Free instance?"
Answer
To build this, I would implement a Hybrid Cloud RAG Architecture. The infrastructure rests on three major pillars: [1, 2]
  1. Data Layer (On-Premises): Oracle Database 26ai Free running locally on Windows. It uses native AI Vector Search to store private data chunk embeddings and compute cosine/dot-product similarities purely inside SQL queries without transferring bulk corporate data out. [1, 2, 3, 4, 5]
  2. Orchestration Layer (Local Python): LangChain acts as the core engine. It utilizes the langchain-community OCI integrations (OCI-GenAI) to handle authentication via the OCI CLI config and safely passes user prompts to cloud models. [1, 2, 3, 4]
  3. Inference Layer (OCI Cloud): The OCI Generative AI service serves managed enterprise models (such as Cohere Command R+) via serverless endpoints to complete the response synthesis safely without caching corporate strings on the cloud base models. [1, 2]

Windows Environment Setup & Commands
To test and run this pipeline on a local Windows machine, use these execution configurations.
1. Setup Local Oracle Database 26ai on Windows
Ensure your environment paths are registered, then open a Windows Command Prompt (cmd) as Administrator to create a dedicated table containing the native vector column datatype:
cmd
:: Log in to your local Oracle 26ai Free instance
sqlplus sys/YourSecurePassword@localhost:1521/FREE as sysdba

:: Run the following SQL to create a Vector Table
CREATE TABLE corporate_knowledge (
    id NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
    chunk_text CLOB,
    chunk_embedding VECTOR(1024, FLOAT32)
);
EXIT;
Use code with caution.
2. Configure OCI CLI Authentication on Windows
Create the necessary OCI profile config folder and file inside your Windows user directory to let LangChain communicate with your cloud compartment: 
cmd
:: Create OCI configuration directory
mkdir "%USERPROFILE%\.oci"

:: Generate a secure API private key
openssl genrsa -out "%USERPROFILE%\.oci\oci_api_key.pem" 2048
openssl rsa -pubout -in "%USERPROFILE%\.oci\oci_api_key.pem" -out "%USERPROFILE%\.oci\oci_api_key_public.pem"
(Note: You must upload the contents of oci_api_key_public.pem to your OCI IAM User console console and note your tenancy, user, and region OCIDs). 
Create a text file at %USERPROFILE%\.oci\config with the following structure:
ini
[DEFAULT]
user=ocid1.user.oc1..example
fingerprint=xx:xx:xx:xx:xx:xx:xx:xx
tenancy=ocid1.tenancy.oc1..example
region=us-chicago-1
key_file=~/.oci/oci_api_key.pem
3. Install Python Virtual Environment
Install the core framework dependencies inside a Windows Command Prompt: 
cmd
python -m venv venv
call venv\Scripts\activate
pip install langchain langchain-community oci oracledb
End-to-End Implementation Script (app.py)
This standalone Python file builds the RAG architecture. It establishes a connection to the local Oracle 26ai database, creates vector configurations via SQL, calls OCI Generative AI, and strings them together via LangChain Expression Language (LCEL). 
python
import os
import oracledb
from langchain_community.llms import OCIGenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import RunnablePassthrough
from langchain_core.output_parsers import StrOutputParser

# 1. Establish On-Premises Oracle 26ai Database Connection
# Ensure your local Oracle Client or thin mode is active
conn = oracledb.connect(
    user="sys",
    password="YourSecurePassword",
    dsn="localhost:1521/FREE",
    mode=oracledb.AUTH_MODE_SYSDBA
)

def oracle_vector_retriever(query_text: str):
    """
    Simulates semantic search directly using Oracle 26ai Vector features.
    In production, you would convert the query_text into an embedding array first.
    """
    cursor = conn.cursor()
    # Mocking an embedding array generated by an embedding model for demonstration
    mock_query_vector = [0.01] * 1024  
    
    # Native Oracle 26ai Vector Similarity SQL syntax
    sql = """
        SELECT chunk_text 
        FROM corporate_knowledge 
        ORDER BY VECTOR_DISTANCE(chunk_embedding, :1, COSINE) 
        FETCH FIRST 1 ROWS ONLY
    """
    try:
        cursor.execute(sql, [str(mock_query_vector)])
        result = cursor.fetchone()
        return result[0] if result else "No local corporate context found."
    except Exception:
        # Fallback snippet if table is completely empty during initial test run
        return "Company Policy: Employees have 25 days of annual paid leave."
    finally:
        cursor.close()

# 2. Initialize OCI Generative AI Model connection via LangChain
# This automatically relies on your local %USERPROFILE%\.oci\config file
llm = OCIGenAI(
    model_id="cohere.command-r-plus",
    service_endpoint="https://oraclecloud.com",
    compartment_id="ocid1.compartment.oc1..your_compartment_ocid",
    model_kwargs={"temperature": 0.0, "max_tokens": 500} # Deterministic for accurate retrieval
)

# 3. Define LangChain RAG Prompt Template
prompt_template = """You are a helpful enterprise assistant. Answer the user question accurately using ONLY the given local database context.

Context:
{context}

Question: {question}
Answer:"""

prompt = ChatPromptTemplate.from_template(prompt_template)

# 4. Build LangChain Expression Language (LCEL) Pipeline
rag_chain = (
    {"context": oracle_vector_retriever, "question": RunnablePassthrough()}
    | prompt
    | llm
    | StrOutputParser()
)

if __name__ == "__main__":
    # Execution Test Run
    user_query = "How many days of paid leave do I get every year?"
    print(f"Executing Query: '{user_query}'\n")
    response = rag_chain.invoke(user_query)
    print("--- OCI GenAI + Oracle 26ai Response ---")
    print(response)
Use code with caution.

Test Cases & Verification Steps
Execute these tests in your Windows environment to verify correctness across your integrated stack.
Test Case 1: Infrastructure & OCI Connectivity Validation
  • Objective: Confirm your Windows machine is authenticated to invoke OCI Cloud LLMs.
  • Action Command: Run this simplified code check in your virtual environment to isolate the cloud endpoint from the database layer:
    cmd
    python -c "from langchain_community.llms import OCIGenAI; llm = OCIGenAI(model_id='cohere.command-r-plus', compartment_id='ocid1.compartment.oc1..your_ocid'); print(llm.invoke('Say Test Successful'))"
    
    Expected Outcome: Command prompt logs Test Successful without raising credential configuration or path routing errors. 
Test Case 2: Local Database Semantic Accuracy Verification
  • Objective: Verify that the system dynamically retrieves contextual strings from the local database instead of hallucinating answers.
  • Action Command: Manually insert a distinctive mock string into your database, then prompt the program:
    cmd
    python app.py
    
    Expected Outcome: The returned string explicitly references "25 days of annual paid leave", proving that the local context was extracted by the script and honored by the prompt context


Q5: When scaling vector databases, what indexing mechanism should be preferred in Oracle 23ai?
Answer:
  • Use HNSW (Hierarchical Navigable Small World) if high query accuracy (high recall) and fast tail-latency are required, provided you have sufficient memory layout. 
  • Use IVF (Inverted File Index) if the system resources have limited RAM footprints. IVF partitions vectors to lower operational costs at scale. 
💻 Command Example: Building a Vector Index
sql
CREATE INDEX idx_policy_vectors 
ON corporate_policies(embedding) 
ORGANIZATION INMEMORY NEIGHBOR GRAPH
DISTANCE COSINE;


Q1: How does a RAG pipeline utilizing OCI Generative AI and Oracle Database 26ai minimize LLM hallucination?
  • Answer: The pipeline relies on "grounding." When a user submits a prompt, it is converted into a vector embedding. The system queries the Oracle Database 26ai using AI Vector Search to find the closest semantic chunks using native distance metrics (\(VECTOR\_DISTANCE\)). These highly relevant chunks are injected into the context window of the OCI Generative AI model (e.g., Cohere Command R+), constraining the model to generate responses strictly from the retrieved database documentation. 
Q2: What native capabilities does Oracle Database 26ai Free bring to AI applications without needing external vector stores? 
  • Answer: Oracle Database 26ai supports a native vector data type (VECTOR), enabling vector operations to reside in the same engine as traditional relational and JSON data. This eliminates complex ETL data syncing. It allows standard SQL queries to handle complex hybrid semantic-relational lookups natively, using built-in vector distance metrics (COSINE, DOT, EUCLIDEAN) and index types like HNSW. 
Q3: How do you establish a secure, performant connection between an on-premise Windows database and cloud-hosted OCI AI services?
  • Answer: Secure interaction relies on OCI API Key signing/Resource Principals combined with HTTPS outbound access over a secure network. On-premises, the application layer references an OCI configuration profile containing your user OCID, fingerprint, tenancy, and private API key to handle authentication to OCI Generative AI SDK endpoints. 

2. Database Setup: Windows Oracle Database 26ai Free Commands [
Run these SQL commands via SQL*Plus or SQL Developer on your Windows machine to prepare the schemas, vector storage table, and search parameters: 
sql
-- 1. Create a dedicated workspace user for AI tasks
CREATE USER rag_user IDENTIFIED BY "SecurePassword2026#";
GRANT CONNECT, RESOURCE, DB_DEVELOPER_ROLE TO rag_user;
ALTER USER rag_user QUOTA UNLIMITED ON USERS;
CONNECT rag_user/SecurePassword2026#;

-- 2. Create the Knowledge Base Table with Native Vector Support
-- OCI Cohere Text-Embed v3 outputs 1024-dimensional floating point arrays
CREATE TABLE enterprise_knowledge (
    doc_id      VARCHAR2(50) PRIMARY KEY,
    title       VARCHAR2(200),
    text_chunk  CLOB,
    embedding   VECTOR(1024, FLOAT32)
);

-- 3. Create a Fast Inverted-Index for High-Performance Semantic Search
CREATE VECTOR INDEX knowledge_hnsw_idx ON enterprise_knowledge (embedding)
ORGANIZATION INMEMORY NEIGHBOR GRAPHS
DISTANCE COSINE;
3. Pipeline Implementation: Python Application Code
Below is the foundational Python code implementing the RAG pattern using the official oci and oracledb libraries on a Windows workstation.
python
import os
import oci
import json
import oracledb

# --- CONFIGURATION SETTINGS ---
# Ensure your ~/.oci/config file is properly configured on Windows
OCI_CONFIG_PROFILE = "DEFAULT"
DB_CONNECTION_STRING = "rag_user/SecurePassword2026#@localhost:1521/FREEPDB1"
COMPARTMENT_ID = "ocid1.compartment.oc1..examplecompartmentid"

# 1. Initialize OCI Clients
config = oci.config.from_file(profile_name=OCI_CONFIG_PROFILE)
gen_ai_inference_client = oci.generative_ai_inference.GenerativeAiInferenceClient(config)

def get_oci_embedding(text: str) -> list:
    """Generates a 1024-dimensional semantic embedding via OCI Cohere."""
    details = oci.generative_ai_inference.models.EmbedTextDetails(
        inputs=[text],
        serving_mode=oci.generative_ai_inference.models.OnDemandServingMode(
            model_id="cohere.embed-english-v3"
        ),
        compartment_id=COMPARTMENT_ID,
        input_type="SEARCH_QUERY"
    )
    response = gen_ai_inference_client.embed_text(details)
    return response.data.embeddings[0]

def query_vector_database(query_vector: list, limit: int = 2) -> str:
    """Executes native vector similarity lookup in Oracle 26ai."""
    # Convert vector python array into string representation for Oracle Vector consumption
    vector_str = str(query_vector)
    
    with oracledb.connect(user="rag_user", password="SecurePassword2026#", dsn="localhost:1521/FREEPDB1") as conn:
        with conn.cursor() as cursor:
            sql = """
                SELECT text_chunk 
                FROM enterprise_knowledge 
                ORDER BY VECTOR_DISTANCE(embedding, to_vector(:1), COSINE)
                FETCH FIRST :2 ROWS ONLY
            """
            cursor.execute(sql, [vector_str, limit])
            rows = cursor.fetchall()
            return "\n".join([row[0] for row in rows])

def generate_grounded_answer(user_prompt: str, context: str) -> str:
    """Generates a final answer using OCI Generative AI wrapped in retrieved facts."""
    system_prompt = f"You are a helpful enterprise assistant. Answer the user question based ONLY on the following context:\n{context}"
    
    chat_detail = oci.generative_ai_inference.models.ChatDetails(
        serving_mode=oci.generative_ai_inference.models.OnDemandServingMode(
            model_id="cohere.command-r-plus"
        ),
        compartment_id=COMPARTMENT_ID,
        chat_request=oci.generative_ai_inference.models.CohereChatRequest(
            message=user_prompt,
            preamble_override=system_prompt,
            temperature=0.1  # Low temperature for strict factual accuracy
        )
    )
    response = gen_ai_inference_client.chat(chat_detail)
    return response.data.chat_response.text

def run_rag_pipeline(user_query: str) -> str:
    """Orchestrates the total RAG architecture flow."""
    embedding = get_oci_embedding(user_query)
    retrieved_facts = query_vector_database(embedding)
    if not retrieved_facts:
        return "No relevant corporate knowledge discovered in the local database."
    return generate_grounded_answer(user_query, retrieved_facts)
4. Enterprise Pipeline Test Cases
Implement this testing harness with python's standard unittest framework to execute integration validations against your on-premise Windows target: 
python
import unittest
from unittest.mock import MagicMock, patch
import oracledb

class TestOCIRAGPipeline(unittest.TestCase):

    @patch('__main__.gen_ai_inference_client.embed_text')
    def test_embedding_generation_shape(self, mock_embed):
        """Test Case 1: Verifies OCI response transformations conform to Oracle's 1024 FLOAT32 schema."""
        # Setup Mock response
        mock_response = MagicMock()
        mock_response.data.embeddings = [[0.015] * 1024]
        mock_embed.return_value = mock_response
        
        from __main__ import get_oci_embedding
        embedding = get_oci_embedding("Test pipeline query")
        
        self.assertEqual(len(embedding), 1024)
        self.assertIsInstance(embedding[0], float)

    def test_database_vector_distance_query(self):
        """Test Case 2: Validation of database connection and vector distance syntax compatibility on Windows."""
        try:
            conn = oracledb.connect(user="rag_user", password="SecurePassword2026#", dsn="localhost:1521/FREEPDB1")
            cursor = conn.cursor()
            
            # Simple dummy vector validation test to ensure the database can parse VECTOR keywords natively
            dummy_vector = str([0.1] * 1024)
            cursor.execute("SELECT TO_VECTOR(:1) FROM DUAL", [dummy_vector])
            result = cursor.fetchone()
            
            cursor.close()
            conn.close()
            self.assertIsNotNone(result)
        except Exception as e:
            self.fail(f"Database connection or vector verification syntax failure: {str(e)}")

    @patch('__main__.query_vector_database')
    @patch('__main__.generate_grounded_answer')
    def test_rag_pipeline_hallucination_guard(self, mock_generate, mock_query):
        """Test Case 3: Ensures pipeline safely blocks downstream inference if database retrieval yields zero metrics."""
        mock_query.return_value = ""  # Simulate empty vector search results
        
        from __main__ import run_rag_pipeline
        response = run_rag_pipeline("What is our Q1 internal corporate strategy?")
        
        self.assertEqual(response, "No relevant corporate knowledge discovered in the local database.")
        mock_generate.assert_not_called()

if __name__ == '__main__':
    unittest.main()
 Execution Summary
The implementation successfully structures an isolated enterprise RAG loop. The local client converts user prompts using the cloud-hosted cohere.embed-english-v3 architecture. Next, it runs semantic lookups directly on the local Windows host using Oracle 26ai’s native VECTOR_DISTANCE function. Finally, it feeds contextually relevant chunks into the cohere.command-r-plus model to deliver factual, grounded responses







 Q1. What is Oracle Select AI and how does it work?

Answer: Select AI is a feature on the Oracle Autonomous AI Database that allows users to interact with enterprise data using natural language. When a user asks a question, the database securely augments the prompt with relevant schema metadata (like table and column names) and sends it to an LLM. The LLM translates the request into an SQL query, which the database then executes internally to return the results. 
Q2. How does Select AI handle security and prevent the LLM from hallucinating?
Answer: To prevent hallucinations (making up facts), Select AI passes only the database schema and object definitions to the LLM—not the raw data. Furthermore, security is preserved by enforcing Database Virtual Private Database (VPD) policies and OCI IAM configurations, ensuring that users can only ask questions about data they are explicitly authorized to view. 
Q3. What are the core "actions" you can perform using Select AI commands?
Answer: Select AI supports several key actions to process user prompts: 
  • runsql: (Default) Processes natural language, translates to SQL, executes it, and returns the result.
  • showsql: Displays the translated SQL statement without executing it, great for debugging or learning.
  • narrate: Returns the results of a query in a conversational, natural language format.
  • chat: Performs a standard conversational chat with the LLM without writing or executing database queries. 
Q4. What is the difference between exact text-to-SQL (NL2SQL) and Retrieval-Augmented Generation (RAG) in Select AI?
Answer:
  • NL2SQL converts a natural language prompt directly into an exact, runnable SQL query to fetch structured relational data.
  • RAG (Retrieval-Augmented Generation) uses AI vector search to scan unstructured data (like document stores) to provide context-aware answers to broader questions. 
Q5. What is a Select AI "profile" and what does it include?
Answer: A Select AI profile is a configuration object within the Oracle Database that defines how the AI interaction happens. It includes the specific AI provider (e.g., OCI Generative AI, OpenAI, Cohere), the specific LLM model to be used, API credentials, and the metadata reference for the database objects you want to query



Q1: What is Oracle Select AI, and how does it prevent LLM hallucinations with private data?
  • Answer: Oracle Select AI bridges the gap between natural language and SQL queries. To prevent hallucinations, Oracle does not send actual table data to the external LLM. Instead, it extracts the schema metadata (table definitions, columns, data types) relevant to the prompt, creates an augmented prompt template, and sends only that structure to the LLM. The LLM responds back with raw SQL, which Oracle then securely executes locally within the database boundaries. 
Q2: What are the primary actions supported by the SELECT AI command keywords?
  • Answer: Select AI supports four major action keywords appended directly to the command:
    • runsql (Default): Automatically converts the prompt to SQL, executes it, and outputs the database rows.
    • showsql: Displays the raw SQL query generated by the LLM without running it.
    • narrate: Runs the query internally but returns the output as a human-readable natural language paragraph.
    • chat: Used for generic conversations with the LLM completely unrelated to database schemas. 
Q3: How do you initialize and configure Select AI before running questions?
  • Answer: You must first configure cloud credentials, map an AI Profile using the DBMS_CLOUD_AI package, and then set that profile active for the current database session. Without an active profile session, Oracle will return an ORA-00923: FROM keyword not found where expected error. 

💻 Command Examples & Implementation
To use Select AI, administrators first provision an AI profile pointing to an LLM provider (such as OCI Generative AI, OpenAI, or Azure OpenAI). 
1. Session Initialization
Before running queries, developers must activate the profile in their current SQL environment: [1]
sql
-- Check the active profile
SELECT DBMS_CLOUD_AI.get_profile() FROM dual;

-- Enable the target AI Profile (e.g., 'GENAI_PROFILE')
EXEC DBMS_CLOUD_AI.set_profile('GENAI_PROFILE');
2. Using Core Keywords
Assuming a schema containing EMPLOYEES and DEPARTMENTS tables:
  • Example A: Running Natural Language to SQL (runsql)
    sql
    SELECT AI how many employees work in the Sales department;
    
    Example B: Auditing Generated SQL Code (showsql)
  • sql
    SELECT AI showsql who is the highest paid employee;
    
    :
    sql
    SELECT employee_name, salary FROM employees ORDER BY salary DESC FETCH FIRST 1 ROWS ONLY;
    
    Example C: Getting Conversational Responses (narrate)
  • sql
    SELECT AI narrate what is the average salary in department 10;
    
    Expected Output: "The average salary for employees in department 10 is approximately $8,500.00." 

 Test Cases for Validation
When deploying Select AI applications, testing boundaries and schema isolation is vital. Below is a structured testing matrix to validate behavior. 
Mock Schema Setup
sql
CREATE TABLE products (
    product_id NUMBER PRIMARY KEY,
    product_name VARCHAR2(100),
    category VARCHAR2(50),
    price NUMBER
);

INSERT INTO products VALUES (1, 'Wireless Mouse', 'Electronics', 25.00);
INSERT INTO products VALUES (2, 'Mechanical Keyboard', 'Electronics', 90.00);
INSERT INTO products VALUES (3, 'Ergonomic Chair', 'Furniture', 250.00);
COMMIT;
]Test Suite Matrix
Test Case ID Test ObjectiveSample Command InputExpected Behavior / Output Validation
TC-001Basic Aggregation MappingSELECT AI what is our most expensive product;Evaluates price correctly and returns: Ergonomic Chair
TC-002Text Filter TranslationSELECT AI show all items in the Electronics category;Map natural text to WHERE category = 'Electronics'. Returns Mouse and Keyboard.
TC-003Structural AuditSELECT AI showsql count total products;Validates that it generates a clean SELECT COUNT(*) FROM products; statement.
TC-004Broad Concept MappingSELECT AI find budget friendly electronics;Tests LLM reasoning. The LLM identifies "budget friendly" as low price and sorts/filters via WHERE price < [threshold].
TC-005Ambiguous Out-of-Scope PromptSELECT AI who won the world cup in 1998;If schema restrictions are strict, it gracefully fails or flags that the data is not present in the database tables.

No comments:

Post a Comment