<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Arun Iyer on Medium]]></title>
        <description><![CDATA[Stories by Arun Iyer on Medium]]></description>
        <link>https://medium.com/@arun.siv81?source=rss-f128670ee75c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Arun Iyer on Medium</title>
            <link>https://medium.com/@arun.siv81?source=rss-f128670ee75c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 04:17:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arun.siv81/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Featured From Stock Reels to Semantic Search: My First Practical Journey with Oracle Select AI]]></title>
            <link>https://medium.com/oracledevs/from-stock-reels-to-semantic-search-my-first-practical-journey-with-oracle-select-ai-99b0b3cd6c27?source=rss-f128670ee75c------2</link>
            <guid isPermaLink="false">https://medium.com/p/99b0b3cd6c27</guid>
            <category><![CDATA[oracle-database-26ai]]></category>
            <category><![CDATA[vector-search]]></category>
            <category><![CDATA[select-ai]]></category>
            <category><![CDATA[nlsql]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Arun Iyer]]></dc:creator>
            <pubDate>Wed, 05 Aug 2026 16:04:52 GMT</pubDate>
            <atom:updated>2026-09-04T13:46:31.795Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How a practical content-analysis pipeline uses Oracle AI Database 26ai, Oracle Select AI, vector search, semantic search, and RAG to move from keyword matching to meaning-based exploration</em></p><figure><img alt="Presentation slide titled “From Stock Reels to Semantic Search: A Practical Journey with Select AI on Oracle AI Database” featuring the Oracle AI Database branding.Featured image with title" src="https://cdn-images-1.medium.com/max/1024/1*l4Jku3vjGNbB4x-DkchVGQ.png" /></figure><h3>Key Takeaways</h3><ul><li>Select AI helped me move from writing every query by hand to asking questions in plain language — while keeping SQL visible through SHOWSQL and verifiable before execution.</li><li>Vector embeddings changed the questions I could ask: from “how many reels mention a <em>stock?</em>” to “what risks and opportunities are discussed about the <em>stock</em>?”</li><li>The most useful architecture combines Oracle’s exact filters and vector search with Select AI’s natural-language explanations while remembering that actions such as NARRATE can send retrieved data to the configured LLM.</li></ul><h3>The Starting Point</h3><p>I didn’t start this project by asking, “How do I make a database talk to an AI model?” I started with a simpler problem: a stream of short stock-market videos that I wanted to search, compare, and learn from.</p><p>An n8n workflow fetched Instagram reel sources, collected metadata, downloaded and transcribed audio using Whisper, and ran everything through an AI stock classifier. The results landed in Oracle Database 26ai.</p><p>What began as an automation problem quickly became a data-understanding problem. What did a reel actually say? Which creator discussed which company? Could I ask questions in plain language without losing SQL’s discipline? That’s where Select AI came in.</p><h3>What Select AI actually does?</h3><p>Select AI lets you ask Oracle Database questions in plain English through something called an AI profile — basically a config that says which AI provider to use, which model, and which tables it’s allowed to see.</p><p>That last part mattered most. The list of allowed tables wasn’t just configuration — it was a safety boundary. For this project, it meant the transcript and source tables, and later the derived stock and embedding tables.</p><h3>Select AI vs. connecting Oracle to an MCP server</h3><p>Select AI isn’t the only way to connect an AI assistant to Oracle. A few MCP (Model Context Protocol) options solve a similar problem differently:</p><p>• <strong>Select AI — </strong>built into the database itself. Good when the application needs natural-language querying as a native feature.</p><p>• <strong>Autonomous AI Database MCP — </strong>lets an external AI agent connect to an Autonomous Database through an Oracle-managed endpoint.</p><p>• <strong>SQLcl MCP — </strong>aimed at developers and DBAs working locally: run SQL, inspect schemas, apply migrations.</p><blockquote>Select AI fits when natural language needs to be part of the application itself. MCP fits when an external AI agent needs Oracle as one tool among several.</blockquote><h3>SHOWSQL became my favorite feature</h3><p>Select AI can generate SQL and run it in one step — convenient, but exactly why it needs caution. Asking it to just show the SQL first, without running it, turns that into a checkpoint I can actually review.</p><p>My pattern became: ask a question → see the generated SQL → review it → run it → double-check against a manual query. Comparing a generated “top stock-related creators” query with one I wrote by hand was useful even when the AI got it right — it showed exactly what assumptions the model was making.</p><p>Provider choice mattered too. In one test using OpenRouter’s DeepSeek, the response took about 13 seconds; the same test on OpenAI gpt-4o took about 3 seconds. (<em>This is anecdotal and specific to my environment — actual performance depends on network, model tuning, and query complexity, and should not be treated as a universal benchmark</em>.)</p><h3>The moment SQL stopped being enough</h3><p>Natural-language-to-SQL was great for structural questions: How many reels are there? Which creators post the most stock content? But one question broke that pattern: what risks and opportunities are discussed about a stock?</p><p>That’s not a filtering question — it’s a meaning question. A transcript might discuss margins or competition without ever using my exact words, so a keyword search could miss it entirely.</p><p>To handle that, I added a semantic-search layer without touching the original data. I split the JSON list of mentioned stocks into its own table (one row per reel-stock pair) and converted each transcript into a 384-dimensional vector using an embedding model.</p><figure><img alt="Diagram of an Oracle vector-embedding schema showing three linked tables: REEL_TRANSCRIPTS connects to REEL_STOCKS_MV (expanding JSON stocks) and REEL_TRANSCRIPT_EMBEDDINGS (embeds transcript)." src="https://cdn-images-1.medium.com/max/781/1*o2RvRrZrnzdJDD5htRZ_Qg.png" /><figcaption><em>Figure: Source reels, normalized stock relationships, and transcript embeddings.</em></figcaption></figure><blockquote>In this project, <em>MY_MODEL</em> is the name assigned to the imported <em>all_MiniLM_L12_v2</em> ONNX text-embedding model. It generates 384-dimensional vectors from <em>REEL_TRANSCRIPTS.TEXT</em>. These vectors are stored in the <em>EMBEDDING</em> column of <em>REEL_TRANSCRIPT_EMBEDDINGS</em> and compared using cosine distance.</blockquote><p>The result: three layers — the original transcripts (untouched), a clean table of reel-stock relationships, and a table of embeddings for meaning-based search.</p><p>A search now combines two things: an exact filter (“stocks which are mentioned more than once?”) and a similarity ranking (“how closely does this transcript relate to the question?”). Relational filtering gives precision; embeddings give meaning.</p><pre>-- activate the profile<br>BEGIN<br>DBMS_CLOUD_AI.SET_PROFILE(&#39;OPENAI_GPT4&#39;);<br>END;<br>/<br>-- generates the sqlcode for inspection or runsql after inspection<br>-- SELECT AI SHOWSQL and DBMS_CLOUD_AI.GENERATE(... action =&gt; &#39;SHOWSQL&#39;)<br>-- invoke the same capability.<br>SELECT DBMS_CLOUD_AI.GENERATE(<br>prompt =&gt; q&#39;[<br>Filter stocks count more than 1 using REEL_STOCKS_MV.<br>Use:<br>- REEL_STOCKS_MV for stock filtering;<br>- REEL_TRANSCRIPT_EMBEDDINGS for semantic search;<br>- REEL_TRANSCRIPTS for reel metrics;<br>- MY_MODEL for VECTOR_EMBEDDING;<br>- COSINE for VECTOR_DISTANCE.<br>Use:<br>Vector embedding and vector distance to retrieve the transcript_text <br>from reel_transcript_embeddings for the filtered stocks<br>Return :<br>- reel ID;<br>- creator username;<br>- likes ;<br>- transcript text.<br>]&#39;,<br>profile_name =&gt; &#39;OPENAI_GPT4&#39;,<br>action =&gt; &#39;SHOWSQL&#39;<br>)<br>FROM dual;</pre><h3>From search to grounded explanations</h3><p>The next step was letting Select AI summarize what it found — not invent an opinion but describe only what showed up in the retrieved transcripts, citing which reels and creators it came from.</p><p>That’s the pattern: question → embed it → filter by stock → rank by similarity → retrieve the top matches → summarize only that evidence. Oracle handles the storage, filtering, and ranking; Select AI turns the result into readable language. I still checked that the summary matched the retrieved rows.</p><pre>-- narrate using LLM<br>-- SELECT AI NARRATE and DBMS_CLOUD_AI.GENERATE(... action =&gt; &#39;NARRATE&#39;) invoke <br>-- the same capability.<br>SELECT DBMS_CLOUD_AI.GENERATE(<br>prompt =&gt; q&#39;[<br>First find out which all stocks count more than 1 using REEL_STOCKS_MV.<br>Use:<br>- REEL_STOCKS_MV for stock filtering;<br>- REEL_TRANSCRIPT_EMBEDDINGS for semantic search;<br>- REEL_TRANSCRIPTS for reel metrics;<br>- MY_MODEL for VECTOR_EMBEDDING;<br>- COSINE for VECTOR_DISTANCE.<br>Use:<br>Vector embedding and vector distance to retrieve the relevant transcript text<br>Return :<br>- reel ID;<br>- creator username;<br>- likes ;<br>- transcript text.<br>Then provide What risks and opportunities are discussed . <br>Group the responses by stock together<br>]&#39;,<br>profile_name =&gt; &#39;OPENAI_GPT4&#39;,<br>-- WARNING result rows/retrieved passages may be sent to the configured LLM<br>action =&gt; &#39;NARRATE&#39; <br>)<br>FROM dual;</pre><h3>Setting it up, in short</h3><p>Getting Select AI working comes down to three layers: network access to the AI provider, a stored credential, and a profile that ties them together with a list of allowed tables.</p><p>A minimal example, using an external provider like OpenAI or OpenRouter:</p><pre> -- 1. Store the provider’s API key as a credential<br> BEGIN<br> DBMS_CLOUD.CREATE_CREDENTIAL(<br> credential_name =&gt; &#39;MY_PROVIDER_CRED&#39;,<br> username =&gt; ‘MY_USER’,<br> password =&gt; ‘MY_API_KEY’<br> );<br> END;<br> /<br> <br> -- 2. Create a profile that uses it, scoped to specific tables<br> BEGIN<br> DBMS_CLOUD_AI.CREATE_PROFILE(<br> profile_name =&gt; &#39;MY_PROFILE&#39;,<br> attributes =&gt; &#39;{<br> &quot;credential_name&quot;: &quot;MY_PROVIDER_CRED&quot;,<br> &quot;provider_endpoint&quot;: &quot;https://api.openai.com&quot;,<br> &quot;model&quot;: &quot;gpt-4o&quot;,<br> &quot;object_list&quot;: [{&quot;owner&quot;: &quot;MY_SCHEMA&quot;, &quot;name&quot;: &quot;MY_TABLE&quot;}]<br> }&#39;<br> );<br> END;<br> /<br> <br> -- 3. Activate it, then start with SHOWSQL before RUNSQL<br> BEGIN<br> DBMS_CLOUD_AI.SET_PROFILE(&#39;MY_PROFILE&#39;);<br> END;<br> /</pre><p>Note: if you’re using OCI Generative AI instead of an external provider, authorization runs through OCI identity rather than an API key, and the profile needs a matching API-format setting (I lost an afternoon to a Cohere-format mismatch before figuring that out).</p><blockquote>Select AI availability depends on the Oracle Database release and the feature being used. This example uses Oracle AI Database 26ai features, including vector search and an in-database ONNX embedding model. Check the Select AI capability matrix for your Autonomous Database or Oracle Database version before reproducing the setup.</blockquote><h3>Why this matters for vector search</h3><p>The real payoff shows up when Select AI and vector embeddings work together. Select AI turns a question like “what risks are discussed about stock?” into a retrieval plan: embed the question, filter by stock, rank by similarity, retrieve the best matches. Select AI then explains those matches in plain language — while the underlying reel IDs, creators, and source text stay available for me to double-check.</p><p>It also means the system can grow gradually: start with one vector per transcript, then add chunking, indexing, or better refresh logic later, without ever touching the original tables.</p><h3>The bigger picture</h3><p>The interesting part wasn’t that I could ask Oracle a question in English. It was watching three things come together: a workflow that collected messy content, a database that gave it structure, and Select AI plus vector search that made it explorable — without removing the need to check the work.</p><p>Select AI is most useful when it shortens the gap between a plain-language question and a well-defined database operation, and with embeddings, that reach extends into questions about meaning, not just counts and filters. It works best when that gap stays visible: the profile is scoped, the generated SQL is inspectable, and every answer traces back to real rows.</p><p>That’s the approach I’m carrying forward: let natural language open the door, let vectors find what’s relevant, and let the schema and the data decide what’s true.</p><h3>FAQs</h3><p><strong>What is Oracle Select AI?</strong></p><p>It’s a feature that lets you ask Oracle Database questions in plain English through an AI profile, which defines the provider, model, and which tables the AI is allowed to see.</p><p><strong>What are different SELECT AI actions?</strong></p><p>SHOWSQL — Generates SQL for inspection without executing it.</p><p>RUNSQL — Generates and executes SQL, then returns the rows.</p><p>EXPLAINSQL — Explains the generated SQL in natural language.</p><p>SHOWPROMPT — Shows the prompt and metadata sent to the model.</p><p>NARRATE — Executes the query and sends the result rows to the LLM for summarization. With RAG, it sends the retrieved top-K content as grounding context. This is the action to review most carefully for data exposure.<br>Warning</p><p><strong>How is Select AI different from connecting Oracle through MCP?</strong></p><p><a href="https://www.oracle.com/autonomous-database/select-ai/">Oracle Select AI</a> provides a database-centered NL2SQL workflow: the database prepares a context-rich prompt using a controlled AI profile, sends it to the selected LLM, and receives SQL back. An MCP agent typically requires multiple tool calls to discover schemas, inspect metadata, generate, execute, and correct SQL — more flexible for cross-system workflows, but with greater application-layer orchestration.</p><p><strong>Does my data leave Oracle when I use Select AI?</strong></p><p>It depends on the Select AI action. SHOWSQL sends the prompt and selected metadata to the LLM to generate SQL but does not execute it. RUNSQL uses the LLM to generate SQL, executes the SQL inside Oracle Database, and returns the query results to the client. NARRATE executes the generated SQL and sends the query results—or retrieved RAG passages—to the LLM to produce a summary. For sensitive data, check the provider, region, retention policy, object list, and action being used.</p><h3>References and further reading</h3><p><a href="https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/select-ai-examples.html">Oracle Database Select AI examples</a></p><p><a href="https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/create-ai-profile.html">Oracle: Create an AI Profile</a></p><p><a href="https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/autonomous-manage-credentials.html">Oracle: Manage credentials</a></p><p><a href="https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/autonomous-network-access.html">Oracle: Configure network access</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99b0b3cd6c27" width="1" height="1" alt=""><hr><p><a href="https://medium.com/oracledevs/from-stock-reels-to-semantic-search-my-first-practical-journey-with-oracle-select-ai-99b0b3cd6c27">Featured From Stock Reels to Semantic Search: My First Practical Journey with Oracle Select AI</a> was originally published in <a href="https://medium.com/oracledevs">Oracle Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>