<?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 Srinidhi Sathyamurthy on Medium]]></title>
        <description><![CDATA[Stories by Srinidhi Sathyamurthy on Medium]]></description>
        <link>https://medium.com/@srinidhisathya?source=rss-33455f8a7b66------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wkQcbzkrb27XmIRVEWuJCw.jpeg</url>
            <title>Stories by Srinidhi Sathyamurthy on Medium</title>
            <link>https://medium.com/@srinidhisathya?source=rss-33455f8a7b66------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 04:28:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@srinidhisathya/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[Using Mem0 Python with Oracle AI Database for Durable Application Memory]]></title>
            <link>https://medium.com/oracledevs/using-mem0-python-with-oracle-ai-database-for-durable-application-memory-2390943682f1?source=rss-33455f8a7b66------2</link>
            <guid isPermaLink="false">https://medium.com/p/2390943682f1</guid>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Srinidhi Sathyamurthy]]></dc:creator>
            <pubDate>Fri, 13 Nov 2026 15:15:03 GMT</pubDate>
            <atom:updated>2026-11-13T15:15:03.562Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>A practical developer guide to storing, searching, filtering, updating, deleting, and inspecting Mem0 memories with Oracle AI Database as the vector store</strong>.</p><p><strong>Companion notebook: </strong><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/mem0_python_oracle_ai_database.ipynb">Mem0 Python Memory with Oracle AI Database</a></p><figure><img alt="Using Mem0 Python with Oracle AI Database for Durable Application Memory" src="https://cdn-images-1.medium.com/max/1024/1*Ho7w3Wk1LN7XfFQoC7O8Yw.png" /></figure><h3>Key Takeaways</h3><ul><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/aintg/mem0-oracledb-integration-guide/mem0-python.html">Mem0 Python</a> can use <a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/">Oracle AI Database</a> as the durable vector store for application memory.</li><li>The core setup uses <a href="https://pypi.org/project/mem0ai/0.1.16/">mem0ai</a>, <a href="https://pypi.org/project/oracledb/">python oracledb</a>, and Memory.from_config with the oracledb provider.</li><li>User scope, agent scope, and metadata filters make retrieval useful for real applications, not just vector demos.</li><li>The notebook proves add, search, filter, update, delete, memory-aware response assembly, Oracle table inspection, and raw payload inspection in one runnable flow.</li><li>The same pattern can sit behind a chatbot, agent, REST API, support assistant, or workflow service.</li></ul><p>A useful application memory layer needs more than a place to put embeddings. It needs a way to store memory records, retrieve the right ones, filter them by application context, update them when facts change, and delete them when they should no longer be used.</p><p>That is the developer problem this article covers. The goal is not to make a broad article about memory as a concept. The goal is to show how Mem0 Python can use Oracle AI Database as the backing store for durable application memory.</p><p>Mem0 provides the Python memory API. Oracle AI Database provides the durable vector-backed storage layer. The Oracle oracledb provider connects the two, so a Python application can add memories, search them later, filter on JSON payload metadata, update and delete records, and inspect what was persisted.</p><p>The companion notebook uses two sample users, one sample agent, a few explicit memories, metadata categories, update and delete operations, and direct Oracle inspection. That keeps the storage path visible without turning the tutorial into a full chatbot implementation.</p><p>In this article, application memory means structured, retrievable context that an application can use across requests. It is not the same as chat history. Chat history is a sequence of messages. Application memory is a curated record that should be searchable, scoped, updated, and deleted.</p><p>That distinction matters because most applications do not need every old message. They need the right facts at the right time.</p><p>A good way to think about application memory is as a small record with three jobs. It stores the fact the application may need later, it carries scope so the fact belongs to the right user, agent, or workflow, and it carries metadata so retrieval can be narrowed without guessing. The vector helps find similar meaning. The payload helps the application keep control.</p><h3>The Developer Pattern</h3><p>The pattern is straightforward. A Python application calls Mem0. Mem0 creates or receives a memory record. The Oracle provider stores each memory as a row in an Oracle table, with the embedding in a vector column and the memory text plus metadata inside a JSON payload. The vector is for similarity. The JSON payload is for application context and debugging.</p><p>The application needs both. Similarity helps find records that mean something close to the query. The payload keeps the record tied to user identity, agent identity, category, source, and other fields the application can reason about.</p><p>Later, the application searches that table through the Mem0 API and uses the returned memories as context.</p><p>That path is useful because it separates memory operations from model calls. The application does not need to keep every prior message in the prompt. It can retrieve a scoped set of records and pass only the useful context to the next step. This also reduces prompt noise. Instead of sending a long transcript and hoping the model finds the useful part, the application retrieves a smaller set of memory records that already passed scope and metadata filters.</p><p>The same pattern works for different kinds of applications. A customer support assistant can remember prior case context. A coding assistant can remember project conventions. A recommendation workflow can remember user preferences. A REST API can retrieve relevant memory before calling a model or assembling a response.</p><p>This is also why the memory layer should sit outside the prompt. Prompts are useful for immediate context, but they are not a durable system of record. A database-backed memory layer gives the application a place to keep reusable context and decide when that context should participate in a request.</p><h3>Architecture</h3><figure><img alt="A flow diagram shows a Python application connecting through the Mem0 Python Memory API and Oracle oracledb vector store provider to an Oracle AI Database collection table, which has ID, VECTOR, and JSON PAYLOAD columns." src="https://cdn-images-1.medium.com/max/1024/1*i7uohcFkPfFhu7ehS_10yw.png" /><figcaption>Figure: Mem0 Python and Oracle AI Database Memory Flow</figcaption></figure><p>The architecture has four moving parts. The Python application owns the user request and the application rules. Mem0 owns the memory API. The Oracle oracledb provider maps the Mem0 vector store operations to Oracle AI Database. Oracle stores the durable table with the vector column and JSON payload.</p><p>The application code does not need to write vector SQL directly for every operation. It uses Mem0 methods such as add, search, update, and delete. At the same time, the storage is still visible in Oracle, so the developer can inspect rows, payloads, and counts when debugging.</p><p>The notebook keeps this architecture local and repeatable. It loads connection values from the environment, creates the Mem0 configuration, writes sample memories, runs scoped retrieval, and then checks the Oracle table. Each step is small enough to understand, but together they show the actual application path.</p><p>Conceptually, there are two retrieval steps happening together. The vector comparison finds records that are close in meaning to the query. The structured filters decide which records are allowed to be considered in the first place. Both steps matter. Similarity without scope can return the wrong user’s context. Scope without similarity can return too much data.</p><p>Retrieval scope is the first relevance boundary in a memory system. Before asking whether a memory is semantically relevant, the application should narrow the search to the records that belong to the current user, agent, tenant, project, or workflow.</p><p>In the notebook, the main retrieval scope is user_id. The agent example uses agent_id. In a real application, retrieval scope might include user id, tenant id, agent id, project id, or workflow id. These filters help select the relevant memory set, while application-level authorization should still be handled by the surrounding application.</p><h3>Configure Mem0 with Oracle AI Database</h3><p>The first important step is the Mem0 configuration. The vector store provider is set to oracledb. The collection name maps to the Oracle table used for the memory collection. The connection parameters come from the notebook environment, not from hard-coded secrets.</p><pre>from mem0 import Memory <br> <br>config = { <br>    &quot;vector_store&quot;: { <br>        &quot;provider&quot;: &quot;oracledb&quot;, <br>        &quot;config&quot;: { <br>            &quot;collection_name&quot;: &quot;MEM0_PY_MEMORY_DEMO&quot;, <br>            &quot;embedding_model_dims&quot;: 32, <br>            &quot;connection_params&quot;: { <br>                &quot;user&quot;: ORACLE_USER, <br>                &quot;password&quot;: ORACLE_PASSWORD, <br>                &quot;dsn&quot;: ORACLE_DSN, <br>            }, <br>            &quot;distance_metric&quot;: &quot;COSINE&quot;, <br>            &quot;do_create_index&quot;: False, <br>        }, <br>    }, <br>} <br> <br>memory = Memory.from_config(config)</pre><p>This configuration is the contract between Mem0 and Oracle AI Database. Mem0 needs to know which vector store provider to use, how to connect to Oracle, what collection to write to, and how large each embedding vector will be. If those values are wrong, the memory API may still look simple, but the storage path will fail.</p><p>The important rule is that the embedding dimension in the Mem0 configuration must match the embedding model. If the model returns 1536-dimensional vectors, use 1536. If it returns another dimension, configure that value. A mismatch here will break the storage path.</p><p>The notebook uses a deterministic local embedder so the tutorial can run without external model credits. In production, the same configuration pattern applies, but the embedding provider and dimension should match the approved provider for that environment.</p><h3>Add Scoped Memories</h3><p>The tutorial adds explicit memories for two sample users. The records live in the same Oracle collection, but each memory carries a user id. That user id becomes part of the retrieval filter later.</p><p>This scope is the first thing that makes the example feel like application memory instead of a generic vector search demo. A real application needs to keep memory tied to the right user, agent, tenant, account, or workflow.</p><pre>memory.add( <br>    &quot;User A prefers vegetarian pasta for weekday dinners.&quot;, <br>    user_id=&quot;user_a&quot;, <br>    metadata={&quot;category&quot;: &quot;food&quot;, &quot;source&quot;: &quot;profile&quot;}, <br>    infer=False, <br>)</pre><p>The notebook uses infer=False. That means Mem0 stores the provided text directly as the memory. This keeps the example predictable and makes the output easy to verify.</p><p>There is also a design choice here. Explicit memories are easier to test because the application decides exactly what gets stored. Inferred memories are more flexible because they can be extracted from natural conversation. Most production systems eventually need a policy for both: when to store explicit application facts and when to let a model propose memories.</p><p>In another application, you may want Mem0 to infer memories from conversation messages. That is a valid path, but it introduces an extraction step and usually a model dependency.</p><p>That separation is useful when designing a real app. First prove that explicit memories can be written, retrieved, updated, and deleted. Once the storage path is reliable, add extraction logic if the product needs it. This keeps failures easier to diagnose because storage issues and extraction issues are not mixed together from the start.</p><h3>Search with User Scope and Metadata</h3><p>After the notebook adds memories, it searches for records related to User A. The filter keeps retrieval inside the correct user scope. That matters because the collection can hold records for more than one user.</p><p>The workflow then filters by metadata. Metadata is where application context becomes useful. Category, source, tenant, product, agent id, workflow name, or retention class can all become retrieval controls.</p><pre>movie_results = memory.search( <br>    &quot;What movies does this user like?&quot;, <br>    top_k=5, <br>    filters={ <br>        &quot;user_id&quot;: &quot;user_a&quot;, <br>        &quot;category&quot;: &quot;movie&quot;, <br>    }, <br>)</pre><p>The notebook output shows one movie-related memory for User A. That is the point. The application is not asking for similar text across the whole table. It is asking for useful memory inside the correct scope and category.</p><p>Metadata filtering also makes search behavior easier to explain. If a result appears, the developer can see which filters allowed it. If a result is missing, the developer can inspect the stored payload and check whether it was saved under the expected scope or category.</p><p>Pure semantic search is not enough for most application memory. You usually need semantic search plus filters that come from the application domain. Mem0 gives the Python API. Oracle stores the vector and the JSON payload that those filters use.</p><p>This also makes the application easier to reason about. If a result appears that should not have appeared, the developer can check the query, the filters, and the stored payload. If no result appears, the developer can check whether the memory was stored under the expected user id and category.</p><p>The broader idea is that metadata turns memory into an application feature. A support tool might filter by account id and product area. A coding assistant might filter by repository and branch. A workflow engine might filter by run id and task type. The fields are different, but the pattern is the same.</p><h3>Add Agent-Scoped Memory</h3><p>The current notebook also adds one agent-scoped memory. This is separate from User A and User B. Instead of using user_id, the memory is stored with agent_id.</p><p>This matters because not every memory belongs to an end user. Some memory belongs to an assistant, workflow, support bot, or agent runtime. For example, an application may want a support agent to remember an operating instruction such as how to summarize retrieved memory before suggesting the next action.</p><pre>agent_id = &quot;support_agent&quot; <br> <br>memory.add( <br>    &quot;Support agent should summarize retrieved memories before suggesting the next action.&quot;, <br>    agent_id=agent_id, <br>    metadata={&quot;category&quot;: &quot;agent_instruction&quot;, &quot;source&quot;: &quot;system&quot;}, <br>    infer=False, <br>) <br> <br>agent_results = memory.search( <br>    &quot;How should the support agent use retrieved memories?&quot;, <br>    top_k=3, <br>    filters={&quot;agent_id&quot;: agent_id}, <br>)</pre><p>This step keeps the tutorial practical without making it larger than it needs to be. It shows that the same Oracle-backed collection can hold different scopes, as long as the application searches with the right filters.</p><p>In production, this pattern can extend to run_id, tenant id, project id, account id, or any other scope field your application needs. The main rule is to be explicit. The memory layer should not guess which records are allowed for a request.</p><h3>Build a Memory-Aware Answer</h3><p>The notebook builds a small memory-aware answer from retrieved memories instead of hard-coding the final response. That is a useful change because it shows the flow more honestly.</p><p>The application asks a question, retrieves User A memories, groups them by category, and then uses the retrieved facts to assemble a response. This is still a tutorial response, not a full chatbot, but it proves the important application step: the answer is based on retrieved memory records.</p><p>The notebook retrieves User A food, movie, and travel memories, then turns those retrieved rows into a dinner-and-movie suggestion. The output includes the memories used and labels the response source as generated from retrieved Mem0 memories in the cell.</p><h3>Update and Delete Memory Records</h3><p>Memory needs lifecycle control. Memory is not automatically truth. It is application state. Like any other state, it can become stale, duplicated, incomplete, or wrong. Update and delete operations are what keep memory from becoming a pile of old assumptions.</p><p>A record may become more specific. A preference may change. A user may ask for something to be removed. A workflow may decide that older memory should no longer participate in retrieval.</p><p>The notebook updates one User A movie preference and deletes one User B food preference. These are small operations, but they prove that the memory layer is not append-only.</p><pre>memory.update( <br>    movie_memory_id, <br>    text=&quot;User A likes optimistic science fiction movies about space exploration.&quot;, <br>    metadata={&quot;category&quot;: &quot;movie&quot;, &quot;source&quot;: &quot;updated_chat&quot;}, <br>) <br> <br>memory.delete(user_b_food_id)</pre><p>After the update, a movie search returns the revised memory text. After the delete, User B search results drop from two to one. Those checks are simple, but they are exactly the checks a developer wants before trusting the pattern in a larger application.</p><p>In production, the policy around update and delete may be stricter. Some records may need versioning. Some deletes may be driven by retention rules. Some updates may require review. The notebook gives the basic operations that those policies build on.</p><p>Lifecycle control is especially important because memory can become stale. A stored preference is useful only while it is still true. An old decision can be harmful if the project has moved on. Update and delete operations give the application a way to keep memory aligned with current state instead of treating every stored record as permanent truth.</p><h3>Inspect What Oracle Stores</h3><p>The notebook inspects the Oracle table directly. This is useful because developers should be able to see what was stored, not only what the SDK returned.</p><p>The table contains an id, a vector, and a JSON payload. This is a useful split. The id gives the application something stable to update or delete. The vector supports similarity search. The payload carries the fields that make the memory understandable to the application and to the developer debugging it.</p><p>The payload includes fields such as user_id, agent_id, category, and memory text. That makes the stored records understandable during development and debugging.</p><pre>Oracle table exists: True <br>Table rows: 5 <br>Columns: <br>- ID: VARCHAR2 <br>- VECTOR: VECTOR <br>- PAYLOAD: JSON</pre><p>The sample rows show one agent instruction, User A food, movie, and travel memories, plus one remaining User B movie memory after the delete. That is the expected final state.</p><p>This kind of inspection is one reason the database-backed pattern is practical. If retrieval looks wrong, you can check whether the row exists, whether the metadata was stored correctly, and whether the lifecycle operation changed the table as expected.</p><h3>Inspect One Raw Memory Payload</h3><p>The notebook then goes one level deeper and prints one raw JSON payload for the updated User A movie memory.</p><p>This replaces the older final proof section. Instead of ending with a summary dictionary, the notebook now ends the core flow by showing what Oracle actually persisted for one memory row. That is more useful for a developer tutorial because it connects the Python API result to the database record.</p><p>The raw payload shows fields such as category, source, user id, role, memory text, hash, created timestamp, updated timestamp, and lemmatized text. Those fields explain why direct inspection is valuable. The vector column is what supports similarity search, but the JSON payload is what makes the record understandable and debuggable.</p><p>This is also a good troubleshooting pattern. If an application retrieves the wrong memory, inspect the payload. Check whether the scope field is correct. Check whether the category was saved as expected. Check whether the text was updated. Check whether the memory id is the one your application is trying to update or delete.</p><h3>How to Move This from Demo to Production</h3><p>Before using the same pattern in a live application, I would make a few changes.</p><ul><li>Use a production embedding provider and set embedding_model_dims to the correct vector dimension.</li><li>Store database credentials in a secret manager, wallet configuration, or managed connection profile.</li><li>Use an application-managed Oracle connection pool when the service already manages database connections.</li><li>Define scope fields carefully, such as user id, agent id, tenant id, workflow id, project id, or account id.</li><li>Decide which metadata fields are required for filtering and debugging.</li><li>Enable and tune Oracle vector indexes for larger collections.</li><li>Define retention, update, and delete policy before memory grows.</li><li>Log memory operations enough to debug unexpected retrieval results.</li><li>Keep cleanup operations explicit. The notebook includes optional cleanup, but leaves demo rows available by default so reviewers can inspect the final table.</li></ul><p>These are normal application engineering concerns. The useful part is that the notebook gives a small, working base that can be hardened rather than invented from scratch.</p><p>Use this pattern when a Python application needs durable memory that can be retrieved later with scope and metadata. That can be a chatbot, a support assistant, a workflow service, a coding assistant, or a REST API that needs context before building a response.</p><p>The application should treat memory retrieval as a deliberate step. Search the correct scope. Apply the metadata filters that matter. Review the returned memories. Then pass the useful context to the next model call, response builder, or workflow action.</p><p>Durable application memory is not just a table of vectors. It is a controlled retrieval path that the application can reason about.</p><h3>Conclusion</h3><p>Mem0 Python with Oracle AI Database gives developers a practical path for durable application memory. Mem0 handles the memory API. Oracle AI Database stores the vectors and JSON payloads. The application gets scoped retrieval, metadata filtering, lifecycle operations, and a storage layer that can be inspected.</p><p>The companion notebook keeps the workflow focused. It configures the Oracle provider, adds user-scoped and agent-scoped memories, filters by metadata, updates and deletes records, builds a response from retrieved memory, and checks what Oracle stored. From there, the same pattern can move behind an agent, assistant, chatbot, REST API, or workflow service.</p><h3>Frequently Asked Questions</h3><h4><strong>What Python packages does this use?</strong></h4><p>The notebook uses mem0ai, oracledb, and python dotenv.</p><h4><strong>Does the notebook require OpenAI?</strong></h4><p>No. This notebook was verified with mem0ai==2.1.0 and uses a deterministic local embedder registered through Mem0’s embedder factory for the tutorial run. The memory writes use infer=False, so Mem0 stores the provided memory text directly and does not make an external LLM extraction call. The final memory-aware answer is also assembled by notebook code from retrieved memories, not by an external model. A production application can replace the local embedder with the approved embedding and LLM providers for that environment.</p><h4><strong>Why does the notebook use infer=False?</strong></h4><p>infer=False stores the provided text directly as a memory. That keeps the tutorial predictable and makes the storage path easy to verify.</p><h4><strong>Where are the memories stored?</strong></h4><p>Mem0 stores the memory id, vector, and JSON payload in an Oracle table. In the notebook, the collection is MEM0_PY_MEMORY_DEMO.</p><h4><strong>Can multiple users share the same collection?</strong></h4><p>Yes. The notebook stores User A and User B in the same collection and uses user id filters to retrieve the right records.</p><h4><strong>Can memory be scoped to an agent instead of a user?</strong></h4><p>Yes. The notebook adds one memory with agent_id=”support_agent” and searches it with an agent filter. This is useful when the memory belongs to an assistant, workflow, or agent runtime rather than an end user.</p><h4><strong>Why not just keep everything in chat history?</strong></h4><p>Chat history is useful for short sessions, but it is not a durable memory system. It is hard to filter, hard to update, and hard to delete selectively. Memory records are smaller, scoped, and easier to retrieve.</p><h4><strong>What makes this different from plain vector search?</strong></h4><p>Plain vector search finds similar text. Application memory also needs scope, metadata, lifecycle operations, and inspection. The vector is only one part of the system.</p><h4><strong>Can I filter by metadata?</strong></h4><p>Yes. The notebook filters by category. Applications can use metadata fields to narrow retrieval by user, agent, tenant, category, source, workflow, or other domain values.</p><h4><strong>Should I create a vector index?</strong></h4><p>For a small tutorial, exact search without index creation is fine. For larger collections, configure Oracle vector indexes such as HNSW or IVF and tune them for the workload.</p><h4><strong>What changes before production?</strong></h4><p>Use a production embedder, secure credentials, define scope fields, tune indexing, and set policy for updates, deletes, retention, and audit logging.</p><h3>Resources</h3><ul><li><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/mem0_python_oracle_ai_database.ipynb">End-to-end Companion notebook</a></li><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/aintg/mem0-oracledb-integration-guide/mem0-python.html">Mem0 Python Integration with Oracle AI Database</a></li><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/aintg/mem0-oracledb-integration-guide/mem0.html">Mem0 with Oracle AI Vector Search</a></li><li><a href="https://pypi.org/project/oracledb/">Python-oracledb on PyPI</a></li><li><a href="https://pypi.org/project/mem0ai/0.1.16/">mem0ai on PyPi</a></li><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/vecse/overview-ai-vector-search.html">Oracle AI Vector Search</a></li><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/">Oracle AI Database 26ai documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2390943682f1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/oracledevs/using-mem0-python-with-oracle-ai-database-for-durable-application-memory-2390943682f1">Using Mem0 Python with Oracle AI Database for Durable Application Memory</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>
        <item>
            <title><![CDATA[Stop Making AI Guess Your Database: Oracle SQLcl MCP Server, Agent Memory, and Oracle AI Database]]></title>
            <link>https://medium.com/oracledevs/stop-making-ai-guess-your-database-oracle-sqlcl-mcp-server-agent-memory-and-oracle-ai-database-3c7c6bc079c8?source=rss-33455f8a7b66------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c7c6bc079c8</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Srinidhi Sathyamurthy]]></dc:creator>
            <pubDate>Wed, 21 Oct 2026 15:15:05 GMT</pubDate>
            <atom:updated>2026-10-21T15:15:05.827Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>A developer guide to controlled Oracle AI Database workflows with the Oracle SQLcl MCP server, Codex, Cursor, Antigravity, Claude, and Oracle AI Agent Memory.</strong></p><p><strong>Companion articles and notebooks:</strong></p><ul><li>Codex workflow: <a href="https://blogs.oracle.com/developers/how-to-build-a-controlled-mcp-workflow-for-codex-and-oracle-ai-database">How to Build a Controlled MCP Workflow for Codex and Oracle AI Database</a>, <a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/codex_mcp_oracle_ai_database_memory_langchain.ipynb">Companion Codex notebook</a></li><li>Cursor workflow: <a href="https://blogs.oracle.com/developers/build-a-controlled-cursor-mcp-workflow-with-oracle-ai-database">Build a Controlled Cursor MCP Workflow with Oracle AI Database,</a> <a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/cursor_mcp_oracle_ai_database.ipynb">Companion Cursor notebook</a></li><li>Antigravity workflow: <a href="https://blogs.oracle.com/developers/how-to-build-an-antigravity-workflow-with-the-oracle-sqlcl-mcp-server-and-oracle-ai-database">How to Build an Antigravity Workflow with the Oracle SQLcl MCP Server and Oracle AI Database</a>, <a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/antigravity_mcp_oracle_ai_database.ipynb">Companion Antigravity notebook</a></li><li>Claude workflow: <a href="https://blogs.oracle.com/developers/when-to-use-claude-memory-oracle-ai-agent-memory-and-langchain-together">When to use Claude memory, Oracle AI Agent Memory, and LangChain together</a>, <a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/claude_mcp_oracle_ai_database_memory_langchain.ipynb">Companion Claude notebook</a></li></ul><figure><img alt="Stop Making AI Guess Your Database: Oracle SQLcl MCP Server, Agent Memory, and Oracle AI Database" src="https://cdn-images-1.medium.com/max/1024/1*GaJ7gwGNc7UkG0LF_DF5pQ.png" /></figure><h3>Key takeaways</h3><ul><li>The <a href="https://docs.oracle.com/en/database/oracle/sql-developer-command-line/25.2/sqcug/sqlcl-mcp-server.html">Oracle SQLcl MCP</a> server gives an AI client an explicit tool path to <a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/">Oracle AI Database</a>, so the assistant can inspect approved database context instead of relying only on schema details copied into a prompt.</li><li>Codex, Cursor, Antigravity, and Claude offer different developer experiences, but the database boundary can stay consistent: approved SQLcl connections, database privileges, inspectable tool calls, and validation before broader access.</li><li><a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.6/guide/api/agentmemory.html">Oracle AI Agent Memory</a> is a separate application layer. Add it when a workflow needs durable threads, scoped retrieval, reusable context, or continuity across sessions. Do not add memory simply because <a href="https://modelcontextprotocol.io/docs/2026-07-28/getting-started/intro">MCP </a>is present.</li><li>The companion notebooks are build and validation harnesses. They help prove configuration, storage, retrieval, and memory patterns, but they are not a substitute for live client validation or production telemetry.</li><li>Start small, validate the database path, and expand access only when the workflow is explainable.</li></ul><p>Your AI assistant can write SQL. But does it know your database?</p><p>A developer pastes a table definition into a prompt and asks for a query. The assistant returns something that looks right. Then the query fails because a column was renamed last week, the object lives in another schema, the current database user cannot see it, or the application has a rule that never made it into the prompt.</p><p>The issue is not that the assistant cannot generate SQL. The issue is that the assistant is reasoning from the context it was given. If the context is incomplete, stale, or simplified, the answer can be perfectly plausible and still be wrong for the environment in front of you.</p><p>That is what the title of this guide means by guessing. The goal is not to remove reasoning from the assistant. The goal is to stop making prompt text carry responsibilities that belong to tools, database permissions, and runtime validation.</p><p>Across this Oracle Database MCP series, the same pattern appeared in several developer environments. Codex, Cursor, Antigravity, and Claude can all sit at the front of a workflow. The Oracle SQLcl MCP server provides the tool boundary to Oracle AI Database, using approved SQLcl connection profiles instead of database details copied into a prompt. <a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.6/guide/api/agentmemory.html">Oracle AI Agent Memory</a> becomes relevant when an application needs durable context beyond the current interaction. LangChain can help with retrieval orchestration when that extra application layer is useful.</p><p>This final article brings those pieces together. Think of it as the map for the series: what each layer is responsible for, what changes between clients, what should stay the same, and how to decide when a simple MCP workflow has grown into a memory and retrieval architecture.</p><p>This article is the final guide in the Oracle Database MCP series. The earlier posts cover the hands on workflows for Codex, Cursor, Antigravity, and Claude with Oracle AI Agent Memory. Use this guide as the map, then follow the individual article and notebook links when you are ready to run a specific workflow.</p><h3>What Changes When AI Can Inspect the Database Instead of Relying on the Prompt?</h3><p>There is a practical difference between describing a database to an assistant and letting the assistant inspect approved database context through a tool. In the first case, the model sees whatever the developer remembered to paste into the prompt. In the second case, the model can ask a declared tool for information at runtime, within the permissions and connection boundaries you configured.</p><p>That distinction matters during normal development. Schemas evolve. Grants differ between environments. Object names are similar. Views hide implementation details. Data quality problems show up only when a query actually runs. Once a workflow can check those facts instead of assuming them, the assistant becomes easier to use for real database work and easier to debug when something goes wrong.</p><p>This is where context engineering for AI agents becomes practical. The goal is not to paste more and more database detail into the prompt. The goal is to decide which context should come from runtime database inspection, which context should come from retrieved memory, and which context should stay outside the model call entirely.</p><p>MCP does not make the model authoritative, and it does not replace database security. It gives the client a standard way to call tools. The Oracle SQLcl MCP server turns that protocol into a tool path for Oracle AI Database. The database still decides what the configured user can do, and the developer still decides which workflows should be automated, reviewed, or blocked.</p><h3>What MCP Does, and What It Does Not Do</h3><p>MCP gives an AI client a standard way to discover and call tools, and the Oracle SQLcl MCP server applies that pattern to Oracle Database workflows.</p><p>MCP does not replace database privileges. It does not automatically provide durable memory. It does not decide which operations an application should allow. Oracle AI Database still controls what the configured database identity can access and execute.</p><p>Agent Memory solves a different problem. It becomes useful when an application needs useful context to survive beyond the current interaction. Keeping tool access, database security, and durable memory as separate concerns makes the architecture easier to test and easier to operate.</p><h3>One architecture, multiple developer experiences</h3><p>The most useful way to read the series is to separate the developer experience from the shared foundation. Codex, Cursor, Antigravity, and Claude differ in how they fit into a developer workflow, but the architecture underneath does not need to be reinvented for every client.</p><figure><img alt="Table with columns Layer, Primary job, and Developer validation. Rows show an AI client planning and requesting tools; SQLcl MCP exposing Oracle tools through approved connections; Oracle AI Database executing SQL, enforcing privileges, and storing application data, vectors, memories, and traces; Oracle AI Agent Memory providing scoped retrieval APIs; and LangChain coordinating retrieval. Checks cover tool visibility, connections, permissions, identity, memory scope, and orchestration value." src="https://cdn-images-1.medium.com/max/1024/1*THnQtPqEzu3AdnNRrxACKQ.png" /><figcaption>The Oracle AI Agent Memory architecture places tool use, database execution, and durable retrieval in distinct layers.</figcaption></figure><p>Tool discovery and operation control are related, but they are not the same thing. A client may discover a tool, while SQLcl MCP configuration and Oracle Database privileges still determine which operations are allowed to execute</p><figure><img alt="Codex, Cursor, Antigravity, and Claude connect to an Oracle SQLcl MCP Server with explicit tools and an approved connection. The server links to Oracle AI Database for SQL, data, vectors, privileges, and activity tracking. Separately, an application memory layer connects through Oracle AI Agent Memory to Oracle AI Database for durable context, threads, scoped retrieval, and storage." src="https://cdn-images-1.medium.com/max/1024/1*zdTzHiy4tMy8vWD2y9cgvQ.png" /><figcaption>Figure 1. One controlled Oracle AI Database foundation for multiple AI Workflows</figcaption></figure><p><strong>Core idea: </strong>SQLcl MCP controls how assistants act through tools. <a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.6/guide/api/agentmemory.html">Oracle AI Agent Memory</a> controls what applications remember over time. They can both use Oracle AI Database, but they solve different parts of the architecture.</p><h3>The Oracle SQLcl MCP Server Is the Execution Boundary</h3><p>In these workflows, the Oracle SQLcl MCP server is the bridge between an MCP capable client and Oracle AI Database. SQLcl runs in MCP mode and exposes a declared set of tools. The client does not need direct database credentials in the prompt. It uses the MCP server, and the server works through SQLcl connection profiles that the developer has already created and validated.</p><p>That sounds like a small implementation detail, but it changes how you reason about the workflow. The assistant is no longer being trusted because a prompt says to behave safely. The database path has an identity, a set of privileges, a known connection, and observable actions. If a query is denied, that can be the correct outcome. If a tool is not exposed, the assistant cannot simply wish it into existence.</p><p>For developers, this turns a vague safety discussion into a set of concrete questions. Which saved connection is in use? Which database user owns that connection? What can that user read or change? Which SQLcl MCP capabilities are available? What activity can be inspected afterward? Those questions are much easier to test than a general instruction such as “only do safe things.”</p><p>The earlier articles walk through the concrete setup for each client. The important point for this capstone is that the control model belongs below the client. You should be able to swap the developer interface without rebuilding the database permission model from scratch.</p><h3>One Foundation, Four Developer Experiences</h3><p>The series uses several clients because developers do not all work in the same place. Some want an agent in the terminal. Some want the workflow inside an editor. Some are evaluating a newer agentic development environment. Some are exploring a general assistant together with application memory. The client changes the ergonomics, not the underlying responsibility model.</p><p><strong>Codex: useful when the agent sits close to the implementation loop</strong></p><p><a href="https://blogs.oracle.com/developers/how-to-build-a-controlled-mcp-workflow-for-codex-and-oracle-ai-database">The Codex workflow</a> is a good fit when the agent is already working with files, commands, configuration, notebooks, and implementation details. Database access then becomes one more tool in a broader development loop. That proximity is useful because the agent can relate database findings back to code changes, but it also raises the importance of an explicit database boundary.</p><p><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/codex_mcp_oracle_ai_database_memory_langchain.ipynb">The companion Codex notebook</a> acts as a validation harness for prerequisites, the SQLcl connection path, memory storage, retrieval, and Agent Memory integration. Keeping those checks separate makes it easier to identify whether a failure comes from MCP discovery, the database connection, privileges, memory, or retrieval.</p><p><strong>Cursor: useful when database context belongs inside the editor loop</strong></p><p><a href="https://blogs.oracle.com/developers/build-a-controlled-cursor-mcp-workflow-with-oracle-ai-database">Cursor</a> keeps the database workflow close to the code editing experience. That can be especially useful when a developer is changing application code and needs to inspect the schema or validate assumptions without leaving the working loop. The same caution applies: convenience should not turn into broad, implicit access.</p><p><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/cursor_mcp_oracle_ai_database.ipynb">The Cursor notebook</a> also makes an important distinction: its operational rows are simulated teaching data, not live Cursor telemetry. The notebook demonstrates the database backed pattern without presenting sample data as evidence of live client activity.</p><p><strong>Antigravity: useful for testing the same pattern in another agentic environment</strong></p><p><a href="https://blogs.oracle.com/developers/how-to-build-an-antigravity-workflow-with-the-oracle-sqlcl-mcp-server-and-oracle-ai-database">The Antigravity article</a> is valuable because it shows that the architecture is portable. The client interface changes, but the workflow still benefits from the same separation: developer facing agent, SQLcl MCP tool boundary, Oracle AI Database, Oracle AI Agent Memory when needed, and optional retrieval orchestration.</p><p><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/antigravity_mcp_oracle_ai_database.ipynb">The Antigravity notebook </a>follows the same principle. It can validate the memory substrate, retrieval, and Agent Memory path, while live MCP behavior still needs to be verified through the actual client and SQLcl MCP workflow.</p><p><strong>Claude: useful for seeing where assistant context ends and application memory begins</strong></p><p><a href="https://blogs.oracle.com/developers/when-to-use-claude-memory-oracle-ai-agent-memory-and-langchain-together">The Claude article</a> adds a different question to the series. Once the assistant can use database tools, what should happen when useful context needs to survive the current interaction? The answer is not to make MCP carry memory responsibilities. Tool access and durable application memory are separate concerns, even when they use the same Oracle platform underneath.</p><p>That separation is one of the most important ideas in the whole series. An assistant can have useful working context and still need an application memory layer. Likewise, an application can maintain durable memory without giving an assistant unrestricted database access. Keeping those responsibilities separate gives developers clearer tests, clearer ownership, and fewer hidden assumptions.</p><h3>AI Agent Memory Belongs After the Workflow Has Something Worth Remembering</h3><p>It is tempting to add memory as soon as an agent demo starts working. In practice, that is often too early. Memory adds value when the workflow has a real continuity problem: a user returns later and expects the application to recall a preference, a developer wants prior tool outcomes available in a new session, or an agent needs to retrieve relevant context from earlier work without replaying an entire conversation.</p><p>In this series, AI agent memory refers to Oracle AI Agent Memory, which provides durable memory APIs backed by Oracle AI Database. Oracle AI Agent Memory sits in the application layer on top of Oracle AI Database. It gives Python applications an API for threads, durable memory records, scoped retrieval, and context assembly. Oracle AI Database remains the storage and enforcement layer underneath. That means memory can participate in the same kinds of engineering decisions developers already understand: identity, retention, access control, observability, data quality, and lifecycle.</p><p>For Python applications, the oracleagentmemory package provides the application API used to create users, agents, threads, memory records, and retrieval flows.</p><p>A useful rule is to ask what failure you are solving. If the problem is “the client cannot inspect the current schema,” add or fix the MCP tool path. If the problem is “the application loses useful context between sessions,” evaluate Agent Memory. If the problem is “we need a reusable retrieval pipeline around that memory,” then LangChain or another orchestration layer may help. Each addition should answer a concrete need.</p><h3>Thinking in two execution loops</h3><p>The architecture becomes easier to reason about when you separate the live interaction loop from the durable context loop. They can share Oracle AI Database, but they run for different reasons.</p><p>The live interaction loop is immediate. A developer asks a question or requests a task. The client decides that a database tool is needed. SQLcl MCP invokes the approved database path. Oracle AI Database returns a result. The client uses that result to continue the task.</p><p>The durable context loop is different. Application code stores selected conversation history, tool outcomes, memory records, metadata, or embeddings. Later, the application retrieves only the context that is useful for the current user or task. That context can then be assembled before the next model call. The point is not to replay everything. The point is to make useful context queryable and scoped.</p><p>Scoped retrieval for agents is what keeps this useful. A memory system should retrieve records for the right user, agent, thread, or workflow rather than treating all stored context as equally available. That scope is what helps memory stay relevant and prevents old or unrelated context from being added to the next model call.</p><figure><img alt="Table comparing live interaction and durable context. It describes clients calling SQLcl MCP tools for current database results, and applications storing or retrieving memory records, traces, metadata, or vectors. Verification checks cover tool discovery, database identity and privileges, retrieval quality, retention, correction, deletion, and whether retrieved context fits the next task." src="https://cdn-images-1.medium.com/max/1024/1*wHOXBHJ1d0-Tn1r05Vwxig.png" /><figcaption>The guide separates live SQLcl MCP interactions from durable context storage and lists checks for each loop.</figcaption></figure><h3>The notebooks are validation harnesses, not the product</h3><p>Every hands-on article in the series includes a companion notebook because a notebook is a practical place to make the moving parts visible. It can check local prerequisites, show sanitized configuration, create teaching tables, insert sample records, exercise lexical and vector retrieval, initialize Agent Memory, and finish with a validation snapshot.</p><p>That is useful, but it is important to keep the notebook in the right role. The final user experience happens in Codex, Cursor, Antigravity, or Claude. The notebook helps prove the surrounding database and memory path before or alongside that client. It is not automatically the source of live telemetry, and simulated teaching data should not be presented as proof that a live client action occurred.</p><h3>Keeping the Database Boundary Consistent</h3><p>The client can change. The database rules should not.</p><p>Codex, Cursor, Antigravity, and Claude all provide different ways for a developer to work with an AI assistant, but changing the client should not mean redesigning database access every time. The SQLcl connection, database identity, permissions, and validation path should remain predictable underneath.</p><p>A good starting point is a purpose specific database identity with only the privileges required for the workflow. During development, that usually means beginning with a small, read focused surface and expanding access only when there is a clear reason to do so.</p><p>The saved SQLcl connection also becomes part of the application architecture. Developers should know which connection alias is being used, which database user it represents, and which environment that user can access. When something behaves unexpectedly, those details are often more useful than changing the prompt.</p><p>The same principle applies to MCP tools. Expose the capabilities the workflow actually needs. A smaller tool surface is easier to understand, test, and troubleshoot than a large collection of tools that nobody has reviewed closely.</p><p>Database activity should also remain inspectable. When a client invokes a tool, the team should have a way to understand what was requested, which database identity executed it, and what happened as a result. Write operations and other higher impact actions deserve stronger controls than ordinary inspection or read queries.</p><p>Agent Memory introduces another boundary. Memory can help an application retain useful context, but it should not become a second source of truth for information that already belongs in an authoritative system. As the amount of memory grows, retrieval quality also becomes part of the application contract. Returning confident but irrelevant context is still a failure, even if the underlying retrieval system technically worked.</p><p>The goal is simple: let developers choose the client experience that works for them while keeping the database access model understandable, controlled, and consistent underneath.</p><h3>A developer friendly rollout path</h3><p>The easiest way to make an agent workflow hard to debug is to enable too much at once. A better path is to grow capability only after the previous layer has a clear acceptance check.</p><ol><li>Prove the runtime. Start SQLcl in MCP mode locally and confirm the expected client can discover the SQLcl tools.</li><li>Prove the connection. Use one approved saved SQLcl connection and run a bounded read query against the expected schema.</li><li>Prove the permission boundary. Confirm that allowed queries succeed and that disallowed operations fail because of the database role or configured restrictions.</li><li>Prove observability. Check the available database side activity trail and document what the team will inspect when a workflow fails.</li><li>Only then add durable memory. Store a small set of useful records, retrieve them in a second session, and verify identity and scope.</li><li>Add semantic retrieval when exact filters are no longer enough. Evaluate retrieval quality with representative developer questions, not only a single happy path.</li><li>Expand tool or write access last. Treat each new capability as a change to the operational surface, not as a prompt tweak.</li></ol><h3>Which workflow should you start with?</h3><p>There is no universal “best” client in this series. The better question is which developer loop you already use and what you need to validate next. Use the table below as the quick route into the detailed articles and notebooks.</p><figure><img alt="Table with columns Your goal, Start here, What this path emphasizes, and Next hands on step. Rows route terminal-oriented coding to Codex, editor-native work to Cursor, portability testing to Antigravity, assistant memory to Claude plus Agent Memory, and architecture learning to this guide." src="https://cdn-images-1.medium.com/max/1024/1*Sxvu_EuVaPxAl2RqWGZHWg.png" /><figcaption>A decision guide maps developer goals to a starting client and hands-on steps for the Oracle SQLcl MCP and AI agent memory paths.</figcaption></figure><h3>The recommended path through the series</h3><p>If you are discovering the series from this article, do not try to reproduce every client. Pick the environment that matches your work, prove the shared SQLcl MCP path once, and then add complexity only when the use case demands it.</p><figure><img alt="A left-to-right sequence: read the guide and choose a path; pick Codex, Cursor, or Antigravity; run the hands-on notebook; verify safely with bounded database tasks; then add Agent Memory when continuity matters." src="https://cdn-images-1.medium.com/max/1024/1*Q4h6CY2zsSJIG5ErdMpFzw.png" /><figcaption>A simple path through the Oracle MCP series</figcaption></figure><p>The order matters because each step narrows the next problem. If SQLcl MCP cannot start, memory is irrelevant. If the connection is wrong, retrieval is irrelevant. If the database identity is too broad, a better prompt will not fix the permission model. When the lower layers are proven first, the remaining failures become easier to diagnose.</p><h3>What I would carry from demo to production</h3><p>The articles in this series are developer examples, but the architectural lessons are broader. Production readiness comes from making the workflow explainable when everything is not going well. A team should be able to answer simple questions quickly: what did the client ask for, which tool ran, which database identity executed it, what result came back, what memory was retrieved, and why a sensitive action was allowed or blocked.</p><p>That means keeping environment boundaries clear, reviewing tool surfaces, and treating write access as a deliberate capability. Failure paths matter too. A denied query can show that least privilege is working. An empty retrieval result can be safer than inventing context. A client that cannot see an unapproved tool may be behaving exactly as intended.</p><p>Memory needs its own lifecycle decisions. What should be remembered, for how long, and under which identity? Can stale memory be corrected or removed? What should remain in an authoritative system instead of becoming memory?</p><p>Keep the architecture boring where possible. A controlled connection, a small tool surface, clear logs, scoped memory, and strong validation checks are usually more useful than adding frameworks before the team understands the failure modes.</p><h3>The big idea: Give AI the Right Path to the Database</h3><p>AI coding assistants are good at reasoning over the context they receive. The quality of a database workflow therefore depends heavily on how that context is obtained. Copying schema fragments into a prompt is useful for small examples, but it does not scale as a substitute for current, permission aware, inspectable access to the environment.</p><p>The Oracle SQLcl MCP server gives developers a practical way to make database access explicit. Oracle AI Database keeps execution, security, durable records, and retrieval close to the data layer. Oracle AI Agent Memory adds continuity when the application needs it. Codex, Cursor, Antigravity, and Claude can then sit on top as different developer experiences without forcing a different database architecture every time.</p><p>That is the real theme of this series. Do not ask the assistant to memorize the database in a prompt. Give it the right tool boundary, let Oracle Database enforce the rules, verify what happened, and add durable memory only when the workflow has something worth carrying forward.</p><h3>Frequently asked questions</h3><p><strong>Does SQLcl MCP tool discovery mean every operation is allowed?</strong> <br>No. Tool discovery and operation control are different concerns. A client may discover available MCP tools, but SQLcl MCP configuration, SQLcl command restrictions, and Oracle Database privileges still determine what can actually run. <br> <br><strong>Is MCP the same thing as durable agent memory?</strong> <br>No. MCP gives an AI client a way to call tools. Oracle AI Agent Memory is a separate application layer for durable context, scoped retrieval, threads, and memory records backed by Oracle AI Database. <br> <br><strong>Do the notebooks show live client telemetry?</strong> <br>No. The notebooks are validation harnesses. They help prove prerequisites, storage, retrieval, memory setup, and database patterns. Live client behavior still needs to be validated in Codex, Cursor, Antigravity, or Claude with the configured SQLcl MCP workflow. <br> <br><strong>Which versions should I use?</strong> <br>Use the versions and prerequisites listed in each hands-on article and companion notebook. Before running the workflow, confirm the current supported versions for SQLcl, Java, the chosen client, and the Oracle AI Agent Memory package.</p><p><strong>Can I use the same Oracle SQLcl MCP server pattern across different AI clients?</strong><br>Yes. That is the point of the shared foundation in this series. Codex, Cursor, Antigravity, and Claude can provide different developer experiences, while the database boundary stays consistent through approved SQLcl connections, configured tools, database privileges, and validation checks. The client can change without requiring a completely new database access model.</p><p><strong>When should I add Oracle AI Agent Memory to an MCP workflow?</strong><br>Add Oracle AI Agent Memory when the workflow needs continuity beyond the current interaction. Good examples include remembering user preferences, carrying useful project context into a later session, retrieving prior tool outcomes, or assembling scoped context for a recurring workflow. Do not add memory only because MCP is present. First prove the Oracle SQLcl MCP server path, then add memory when there is something worth carrying forward.</p><h3>References</h3><ul><li><a href="https://blogs.oracle.com/developers/how-to-build-a-controlled-mcp-workflow-for-codex-and-oracle-ai-database">How to Build a Controlled MCP Workflow for Codex and Oracle AI Database</a></li><li><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/codex_mcp_oracle_ai_database_memory_langchain.ipynb">End-to-end Companion Codex notebook</a></li><li><a href="https://blogs.oracle.com/developers/build-a-controlled-cursor-mcp-workflow-with-oracle-ai-database">Build a Controlled Cursor MCP Workflow with Oracle AI Database</a></li><li><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/cursor_mcp_oracle_ai_database.ipynb">End-to-end Companion Cursor notebook</a></li><li><a href="https://blogs.oracle.com/developers/how-to-build-an-antigravity-workflow-with-the-oracle-sqlcl-mcp-server-and-oracle-ai-database">How to Build an Antigravity Workflow with the Oracle SQLcl MCP Server and Oracle AI Database</a></li><li><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/antigravity_mcp_oracle_ai_database.ipynb">End-to-end Companion Antigravity notebook</a></li><li><a href="https://blogs.oracle.com/developers/when-to-use-claude-memory-oracle-ai-agent-memory-and-langchain-together">When to use Claude memory, Oracle AI Agent Memory, and LangChain together</a></li><li><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/claude_mcp_oracle_ai_database_memory_langchain.ipynb">End-to-end Companion Claude notebook</a></li><li><a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.4/">Oracle AI Agent Memory documentation</a></li><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/">Oracle Database 26ai documentation</a></li><li><a href="https://pypi.org/project/oracleagentmemory/">oracleagentmemory on PyPI</a></li><li><a href="https://docs.oracle.com/en/database/oracle/sql-developer-command-line/25.2/sqcug/sqlcl-mcp-server.html">SQLcl MCP Server</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c7c6bc079c8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/oracledevs/stop-making-ai-guess-your-database-oracle-sqlcl-mcp-server-agent-memory-and-oracle-ai-database-3c7c6bc079c8">Stop Making AI Guess Your Database: Oracle SQLcl MCP Server, Agent Memory, and Oracle AI Database</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>
        <item>
            <title><![CDATA[Graph-Aware Retrieval for Oracle AI Agent Memory: Linking Memories Across Time]]></title>
            <link>https://medium.com/oracledevs/graph-aware-retrieval-for-oracle-ai-agent-memory-linking-memories-across-time-bed3a4fb51b7?source=rss-33455f8a7b66------2</link>
            <guid isPermaLink="false">https://medium.com/p/bed3a4fb51b7</guid>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[agent-memory]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Srinidhi Sathyamurthy]]></dc:creator>
            <pubDate>Fri, 02 Oct 2026 16:50:10 GMT</pubDate>
            <atom:updated>2026-10-02T16:50:10.748Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>How memory links help long-running agents understand what changed</strong></p><p><strong>Companion notebook: </strong><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/agent_memory/graph-aware-retrieval-agent-memory.ipynb">Graph-Aware Retrieval for AI Agent Memory</a></p><h3>Key takeaways</h3><ul><li>Graph-aware retrieval helps <a href="https://docs.oracle.com/en/database/oracle/agent-memory/">Oracle AI agent memory</a> understand how a fact changed, rather than treating every memory as an isolated record.</li><li>Typed links such as supersedes, refines, supports, duplicates, and contradicts make memory relationships explicit.</li><li>Valid and invalid lifecycle states preserve the current answer while keeping older memories available as historical context.</li><li>Automatic linking can support common memory evolution, while num_hops and linked_results keep graph context bounded and inspectable.</li></ul><figure><img alt="Graph-Aware Retrieval for Oracle AI Agent Memory: Linking Memories Across Time" src="https://cdn-images-1.medium.com/max/1024/1*KhR-g3DBhhafop5h3-FndA.png" /></figure><p>An agent can remember a customer’s delivery preference. That is useful. But the more important question is whether it can remember that the preference changed, why it changed, and which version should be trusted now.</p><p>That is the problem graph-aware retrieval is designed to address. Oracle AI Agent Memory adds relationships between memories so an agent can retrieve not only a fact, but also the context around that fact: what replaced it, what supports it, what refines it, and what should be treated as historical context.</p><p>This article walks through the model behind memory links, the valid and invalid lifecycle states, and the difference between ordinary retrieval and graph-aware search. It also connects those concepts to a working developer flow for Oracle AI Agent Memory backed by Oracle AI Database.</p><p>The important shift is that memory stops being only a store of facts. It becomes a small model of change: which record is current, which record was replaced, which record adds evidence, and which record should be kept only as history.</p><h3>When agent memory needs more than the latest answer</h3><p>Imagine an agent helping with a support case. In January, a customer says that email is the best way to contact them. In March, they ask to be contacted by phone during business hours. In June, they update the request again because they are traveling.</p><p>A flat retrieval system may find all three statements. It may even rank the newest one highly. But ranking alone does not explain the relationship between them. The older memories are not random noise; they tell us that the preference evolved. The June memory is current, the January memory is historical, and the March memory explains the transition between the two.</p><p>For an agent, that distinction matters. A response that ignores the history can sound confident but still be wrong. A response that treats every statement as equally current can expose contradictions to the user. A response that understands the links can answer from the current memory while using older memories when the conversation calls for an explanation.</p><p>This is especially important for enterprise agents because many business facts are not static. Customer preferences, support status, delivery windows, policy exceptions, and case evidence can all change over time. A memory layer that understands those changes gives the agent a better context package before the next model call.</p><h3>How memory links improve context engineering for AI agents</h3><p>A memory link is a typed relationship between two memory records. The type is important because it tells retrieval what the relationship means. A link between two records is not just an edge in a graph; it is a small piece of reasoning that can be used when assembling context for the agent.</p><figure><img alt="The table explains that a newer record can replace an earlier one, add detail, support it with evidence, repeat the same fact, or make an incompatible claim. Examples include updated delivery details, a case note confirming a preference, and conflicting instructions about calling a customer." src="https://cdn-images-1.medium.com/max/1024/1*pkl--7Nmy6VL7T42hWeRnA.png" /><figcaption>Table defining five relationships between memory records: supersedes, refines, supports, duplicates, and contradicts.</figcaption></figure><p>These link types give the agent more than a collection of similar-looking search results. They provide a vocabulary for how facts relate, which lets an application preserve useful history without confusing historical information with the current answer.</p><p>Memory links are directed. For example, if a newer memory supersedes an older memory, the stored relationship is new memory -&gt; supersedes -&gt; old memory. When retrieval traverses the relationship in the other direction, the reverse relationship is exposed as is_superseded_by. The same pattern applies to refines/is_refined_by and supports/is_supported_by.</p><p>The graph does not replace the underlying retrieval or search strategy. Oracle AI Agent Memory can use vector, keyword, or hybrid search to find direct memory results, and graph expansion then follows relationships around those results. That is why a linked memory can be useful even when it would not be the highest ranked direct match.</p><h3>Valid and invalid memory states keep agent memory trustworthy</h3><p>When a memory is superseded, it does not necessarily disappear. Its lifecycle state can become invalid while the record remains available for historical retrieval. The newer memory becomes the valid answer for current use, and the older one remains available when the agent needs to explain what changed or when a user asks about an earlier interaction.</p><p>This is a practical distinction. Invalid does not mean useless. It means the memory should not be treated as the current answer without additional context. The application can still retrieve it through an explicitly scoped historical query, or it can receive it as a linked result when graph-aware search follows the relationship from a current memory.</p><p>The lifecycle model also makes memory maintenance easier to reason about. Instead of overwriting a record and losing the trail, the system can keep the record, preserve the relationship, and let retrieval decide how much history belongs in the response.</p><h3>From memory records to graph-aware retrieval</h3><p>The retrieval flow has four parts: store a durable memory, connect it to related memories, preserve the lifecycle state, and expand retrieval only when the application asks for linked context.</p><figure><img alt="Vertical flow diagram with four stages: durable memory stores a support fact; a typed link marks it as supersedes, refines, or supports; lifecycle classifies it as valid or historical; bounded retrieval uses num_hops and linked_results." src="https://cdn-images-1.medium.com/max/489/1*EhYelPodFe_j9bLesfGCMw.png" /><figcaption>Figure: Graph-aware retrieval flow</figcaption></figure><p>A graph-aware result can then include the current memory and the linked records that explain where it came from.</p><p>Conceptually, this is the difference between retrieval as ranking and retrieval as context assembly. Ranking answers the question: which memory is closest to the query. Context assembly asks which related memories help the agent use that answer correctly.</p><h3>Use Oracle AI Database as the durable memory boundary</h3><p>Graph-aware retrieval depends on durable state. The memory records, their lifecycle state, and the links between records need to live somewhere that survives a single chat session or application process. In this workflow, Oracle AI Database provides that boundary.</p><p>For Autonomous AI Database, the runtime can use the service name and wallet/client credentials supplied by the database connection setup. For Oracle AI Database or a local validation environment, the same store can use the appropriate DSN or connect descriptor. The notebook keeps passwords and API keys in environment variables or a private .env file rather than embedding them in the article or notebook output.</p><p>The next developer decision is schema policy. A fresh validation environment can create the managed objects when necessary; a production startup path should make upgrades deliberate and reviewable.</p><pre>from oracleagentmemory.core import OracleDBMemoryStore, SchemaPolicy <br> <br>store = OracleDBMemoryStore( <br>    **store_kwargs, <br>    schema_policy=SchemaPolicy.CREATE_IF_NECESSARY, <br>)</pre><p>This is the line that connects the release story to the database. The graph-aware memory features depend on the managed schema that stores memory links, lifecycle information, and the graph representation used by retrieval. In a shared production environment, teams can use REQUIRE_EXISTING after migration review, so application startup does not silently change the schema.</p><p>For developers, the schema policy is not just a setup ceremony. It controls how much authority the application has at startup. That matters when agent memory becomes part of a shared production system rather than a local experiment.</p><h3>Model changing facts as durable memories</h3><p>A graph-aware memory example does not need a large synthetic graph to be useful. A small support scenario is enough: the first record captures a broad delivery preference; later records add a replacement preference, a more precise time window, and supporting workflow context. This gives the reader a clear before-and-after view of what the graph adds.</p><p>The records are durable memories, not temporary Python variables. Once they have been stored, the application can connect them with typed relationships and ask retrieval to return the current answer with the surrounding evidence.</p><p>Keeping each version as its own memory also avoids a common failure mode: overwriting the old fact and losing the reason the answer changed. With linked records, the current answer can stay clean while the historical path remains available.</p><h3>Automatic linking for production-ready agent memory</h3><p>An application may know that one event supersedes another and create the link explicitly. That is useful for workflows with a clear business event, such as a profile update or a case-status transition. But many applications do not have a clean event boundary. The relationship is visible only when the new message is interpreted alongside existing memories.</p><p>This explicit path is useful when the application has confirmed the relationship. A replacement-order workflow may know with confidence that a new delivery promise supersedes an earlier one. The record link makes that workflow fact durable and available tolater retrieval.</p><p>That is where automatic linking during memory extraction becomes useful. The extraction process can identify that a new memory supersedes, refines, duplicates, supports, or contradicts an existing memory. The agent developer can focus on the conversation and the memory policy while the system builds the relationship graph as part of the memory workflow.</p><pre>memory_extraction_config = MemoryExtractionConfig( <br>    memory_extraction_frequency=1, <br>    memory_link_extraction_mode=( <br>        MemoryLinkExtractionMode.POST_EXTRACTION <br>    ), <br>)</pre><p>The release exposes POST_EXTRACTION, DURING_EXTRACTION, and DISABLED modes. POST_EXTRACTION is the default path shown in the release material: extracted memories are written first, then candidate memories are retrieved, and related links are identified. DURING_EXTRACTION presents candidates inside the extraction step, while DISABLED preserves extraction without automatic relationship discovery. The companion notebook uses DURING_EXTRACTION for the local runnable flow so extracted memories and candidate links can be inspected in one deterministic example.</p><p>For a developer walkthrough, explicit links make the behavior easy to inspect and reproduce. Automatic linking is still the experience most applications should aim for: explicit links are best when the application already knows the relationship, while automatic links help general-purpose memory workflows discover relationships during extraction.</p><h3>Graph-aware retrieval with num_hops and linked_results</h3><p>A normal memory search asks which records are most relevant to the query. Graph-aware retrieval asks that question and then considers the connected memories. The num_hops setting controls how far retrieval follows those relationships.</p><p>Think of num_hops as a context budget for relationships. A value of 0 behaves like direct retrieval. A value of 1 lets the search bring back immediate linked context without opening the door to an unbounded graph traversal.</p><p>With num_hops=0, the result is limited to the directly matched memories. With num_hops=1, retrieval can include memories connected by one link. This makes it possible to compare a direct answer with an answer that includes its surrounding context.</p><pre>query = &quot;What delivery window should I use for replacement shipment RMA-8842?&quot; <br>search_options = { &quot;max_linked_results&quot;: 5, &quot;include_invalid_results&quot;: True, } <br>direct_results = await memory.search_async( query=query, user_id=USER_ID, agent_id=AGENT_ID, num_hops=0, **search_options, ) <br>graph_results = await memory.search_async( query=query, user_id=USER_ID, agent_id=AGENT_ID, num_hops=1, **search_options, )</pre><p>The direct result may identify the current preference. The graph-aware result can also expose the memory that it superseded, a supporting case note, or a refinement that adds the delivery window. The comparison keeps the query and the other search options the same, so the difference in returned context is caused by graph expansion rather than by lifecycle filtering or a different prompt.</p><p>max_linked_results bounds the amount of related context returned. include_invalid_results controls the top-level direct results, so an application can keep the current answer focused while still allowing historical memories to appear as linked context when they explain how the answer evolved.</p><h3>Build a context package for future agent responses</h3><p>Graph-aware retrieval is most useful when the relational information is easy to consume. The linked_results field provides that bridge. It lets an application distinguish the primary matches from the connected records and assemble a compact context package for the next model call.</p><p>A production application can use the same pattern to build a prompt-ready summary: start with the valid memory, include the linked historical or supporting context, and preserve the relationship label so the language model does not have to infer the connection from raw text alone. The result is a response grounded in both the fact and the path that led to it.</p><p>This is different from generic GraphRAG over a document corpus. The graph here is built from agent memories and their lifecycle relationships, so it can represent how the agent’s own durable context evolved over time.</p><pre>linked_rows = [] <br>for parent_rank, result in enumerate(graph_results, start=1): <br>    for linked_rank, linked in enumerate(result.linked_results or [], start=1): <br>        relation, linked_result = linked <br>        linked_rows.append( <br>            { <br>                &quot;parent_rank&quot;: parent_rank, <br>                &quot;linked_rank&quot;: linked_rank, <br>                &quot;relationship&quot;: relation.relation_type, <br>                &quot;linked_memory&quot;: linked_result.record.content, <br>            } <br>        ) <br>display(pd.DataFrame(linked_rows))</pre><p>A tabular inspection is useful while developing the workflow because it makes the graph expansion auditable. The application can later replace this display with a compact prompt context, a trace record, or a user-facing explanation of why a related memory was included.</p><h3>Production considerations for Oracle AI agent memory</h3><p>Memory links make retrieval more useful, but they do not remove the need for application-level decisions. Teams should decide which memories are allowed to be current, how invalid memories are scoped, and which relationships should be created automatically versus explicitly.</p><ul><li>Define a memory scope that matches the user, tenant, case, or workflow boundary of the application.</li><li>Treat valid and invalid as retrieval behavior, not as a reason to destroy the underlying history.</li><li>Use explicit links for deterministic business events and automatic linking for relationships discovered during extraction.</li><li>Keep graph traversal focused. One hop is often enough to add useful context; deeper traversal should be justified by the workflow.</li><li>Do not claim benchmark improvements until approved results are available for the exact release and configuration being described.</li></ul><h3>Conclusion</h3><p>Persistent memory is often described as giving an agent a longer memory. That is only part of the story. The harder requirement is giving the agent a better sense of time: which fact is current, which fact was replaced, which detail supports the answer, and which contradiction needs attention.</p><p>Graph-aware retrieval provides that structure. With typed links, lifecycle states, controlled traversal, and linked_results, Oracle AI Agent Memory can preserve the history around a fact while still helping the agent answer from the right version. The companion notebook shows the mechanics. The larger payoff is a memory layer that can explain change instead of hiding it.</p><h3>Frequently asked questions</h3><p><strong>What is graph-aware retrieval?</strong></p><p>Graph-aware retrieval is a retrieval pattern that starts with the memories that match a query, then follows selected relationships to bring back related context. In Oracle AI Agent Memory, those relationships can show whether a memory supersedes, refines, supports, duplicates, or contradicts another memory.</p><p><strong>Do I still need agent memory if my application already uses RAG?</strong></p><p>Yes, for many agentic applications. RAG is usually about retrieving external knowledge for a task. Agent memory is about preserving durable context from the agent’s own interactions, tool results, user preferences, and workflow history so future turns can use what changed over time.</p><p><strong>How is this different from a general knowledge graph?</strong></p><p>A general knowledge graph often models broad domain entities and relationships. Graph-aware agent memory is narrower and more operational: it connects memories created by an agent workflow so retrieval can understand which facts are current, historical, supporting, repeated, or conflicting.</p><p><strong>Does invalid mean the memory is deleted?</strong></p><p>No. In this workflow, invalid means the memory is no longer the current answer. It can remain available as historical context or through a deliberately scoped retrieval request.</p><p><strong>Do applications have to create every link themselves?</strong></p><p>No. Explicit linking is useful when an application already knows that an event supersedes or supports another memory. Automatic linking during extraction is the more transparent option when the relationship must be inferred from new content and existing memory.</p><p><strong>Why not always retrieve every connected memory?</strong></p><p>Because extra context is not automatically useful context. num_hops gives the application a way to control graph expansion, and scope rules keep the returned context relevant to the current user or workflow.</p><h3>Resources</h3><ul><li><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/agent_memory/graph-aware-retrieval-agent-memory.ipynb">End-to-end Companion notebook</a></li><li><a href="https://docs.oracle.com/en/database/oracle/agent-memory/">Oracle AI Agent Memory documentation</a></li><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/">Oracle AI Database 26ai documentation</a></li><li><a href="https://pypi.org/project/oracleagentmemory/">oracleagentmemory on PyPI</a></li><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/vecse/">Oracle AI Vector Search Documentation</a></li><li><a href="https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/connect-download-wallet.html">Download wallet/ client credentials for Autonomous Database</a></li><li><a href="https://python-oracledb.readthedocs.io/en/latest/user_guide/connection_handling.html#mutual-tls-mtls-connection-to-oracle-autonomous-database">python-oracledb mTLS connection to Oracle Autonomous Database</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bed3a4fb51b7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/oracledevs/graph-aware-retrieval-for-oracle-ai-agent-memory-linking-memories-across-time-bed3a4fb51b7">Graph-Aware Retrieval for Oracle AI Agent Memory: Linking Memories Across Time</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>
        <item>
            <title><![CDATA[How to Build an Antigravity Workflow with the Oracle SQLcl MCP Server and Oracle AI Database]]></title>
            <link>https://medium.com/oracledevs/how-to-build-an-antigravity-workflow-with-the-oracle-sqlcl-mcp-server-and-oracle-ai-database-00b91ff41c2d?source=rss-33455f8a7b66------2</link>
            <guid isPermaLink="false">https://medium.com/p/00b91ff41c2d</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Srinidhi Sathyamurthy]]></dc:creator>
            <pubDate>Mon, 21 Sep 2026 14:29:51 GMT</pubDate>
            <atom:updated>2026-09-21T14:29:51.126Z</atom:updated>
            <content:encoded><![CDATA[<p>This article adapts the same MCP workflow pattern for Antigravity and Oracle AI Database.</p><p><strong>Companion notebook: </strong><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/antigravity_mcp_oracle_ai_database.ipynb"><strong>Antigravity MCP with Oracle AI Database Workflow</strong></a></p><figure><img alt="How to Build an Antigravity Workflow with the Oracle SQLcl MCP Server and Oracle AI Database" src="https://cdn-images-1.medium.com/max/1024/1*hME_aQH5xdPIk9InIYGh_Q.png" /></figure><h3>Key Takeaways</h3><ul><li><a href="https://modelcontextprotocol.io/docs/2026-07-28/getting-started/intro">MCP</a> turns AI-to-database access into an explicit tool contract instead of implicit system access.</li><li><a href="https://docs.oracle.com/en/database/oracle/sql-developer-command-line/25.2/sqcug/sqlcl-mcp-server.html">Oracle SQLcl in MCP</a> mode, sql -mcp, is a practical way to connect Antigravity to Oracle AI Database through a local MCP server.</li><li>Oracle AI Database provides persistent storage and vector search for memory workloads, while <a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.6/guide/api/agentmemory.html">Oracle AI Agent Memory</a> gives teams Python APIs for threads, durable memories, scoped retrieval, and context assembly.</li><li><a href="https://docs.langchain.com/oss/python/integrations/vectorstores/oracle">LangChain</a> can be useful after the Oracle-backed memory and retrieval path exists, mainly as an application-side wrapper and orchestration layer.</li><li>A practical pattern is hybrid: Antigravity plus MCP for interactive database work, Oracle AI Database plus Oracle AI Agent Memory for durable memory, and LangChain only when a consuming application needs reusable retrieval orchestration.</li></ul><p>The Oracle SQLcl MCP server is useful for Antigravity workflows because database questions can run through a declared local MCP tool instead of being copied into the agent context as raw data. SQLcl executes SQL against Oracle AI Database and returns bounded results, which helps an AI coding agent inspect business data without pulling large result sets into the context window.</p><p>Antigravity refers to the MCP-capable AI coding environment used as the developer-facing agent interface. In this pattern, Antigravity does not connect directly to Oracle AI Database. Antigravity calls SQLcl MCP tools, SQLcl uses a saved Oracle connection, and Oracle AI Database remains the durable store for memory records, retrieval evidence, vectors, and tool traces. Oracle AI Agent Memory and LangChain sit in the application layer after that database-backed path is in place.</p><p>Production success depends less on clever prompting and more on boundaries, privileges, logging, scoped retrieval, and repeatable runbooks.</p><p>This guide is for developers who want Antigravity to work with Oracle AI Database through explicit tools, durable memory, and reviewable retrieval evidence.</p><p>The developer path through this guide is simple:</p><ol><li>Start with one approved Oracle connection and a read-only validation query.</li><li>Put SQLcl MCP in front of that connection so Antigravity sees tools, not raw database credentials.</li><li>Check the audit and activity trail before adding more tool access.</li><li>Add Oracle AI Agent Memory when the workflow needs durable thread context, scoped recall, or reusable context cards.</li><li>Add LangChain only when you need application-side retrieval orchestration beyond the MCP interaction loop.</li></ol><figure><img alt="A human operator sends requests through Antigravity CLI and SQLcl MCP Server to Oracle AI Database, which connects to Oracle AI Agent Memory. Memory tables, tool logs, and vector retrieval branch from memory, while LangChain Retrieval returns grounded context." src="https://cdn-images-1.medium.com/max/1024/1*H0OMtxxdIMlokI9YBgqRHw.png" /><figcaption>Controlled Antigravity MCP + Oracle AI Database Workflow</figcaption></figure><h3>Why This Architecture Is Useful for Developers</h3><p>Database-connected assistants are most useful when the access path is visible. The goal is not just to let Antigravity produce SQL-shaped text; the goal is to make the database path approved, observable, and easy to debug later.</p><p>Antigravity sits near the developer’s real work: code, terminal commands, notebooks, configuration, and implementation details. A developer can move from a failing local flow to a database inspection path inside the same working loop. That closeness is useful, but it also makes the database boundary more sensitive.</p><p>A practical workflow preserves the request, the tool call, the database identity, the retrieved context, and the reason a risky action was allowed, blocked, or sent for confirmation.</p><p>By the end of this guide, you should know how to connect Antigravity to Oracle AI Database through a controlled MCP boundary, when local Antigravity context is enough and when Oracle-backed memory is needed, and how to build a retrieval path that can be queried, audited, and scaled.</p><p>The companion notebook is intentionally practical. It validates SQLcl and Java discovery, writes a sanitized Antigravity MCP config preview, checks the saved SQLcl connection alias, creates memory tables, inserts simulated Antigravity/MCP teaching traces, tests lexical, vector, and hybrid retrieval, initializes Oracle AI Agent Memory with the current configuration shape, and finishes with a validation snapshot.</p><p>The workflow has five cooperating layers. Antigravity is the developer-facing agent interface. SQLcl MCP is the tool boundary. Oracle AI Database is the durable substrate for memory, traces, and retrieval. Oracle AI Agent Memory is the application-side memory API. LangChain is the optional orchestration wrapper. The companion notebook sits outside all five, as the build-and-validation harness that proves the pieces are wired correctly before the workflow is handed to Antigravity.</p><figure><img alt="Table with two columns, Layer and Responsibility, describing Antigravity’s agent interface; SQLcl MCP’s Oracle tool boundary; Oracle AI Database storage, retrieval evidence, vectors, metadata, traces, and privileges; Oracle AI Agent Memory APIs and scoped retrieval; and LangChain’s application orchestration." src="https://cdn-images-1.medium.com/max/1024/1*Z02w6RPcByEuOFsVoDkUEQ.png" /><figcaption>AI agent memory architecture table showing the responsibilities of Antigravity, SQLcl MCP, Oracle AI Database, Oracle AI Agent Memory, and LangChain.</figcaption></figure><h3>The Two Execution Loops</h3><p>The system naturally forms two execution loops:</p><ul><li><strong>Loop A: </strong>Antigravity works with MCP to discover tools, inspect data, run bounded read-only queries, and return results immediately.</li><li><strong>Loop B: </strong>Application code writes history, tool logs, memory records, chunks, and embeddings to Oracle AI Database, then retrieves context before a later answer or workflow step.</li></ul><figure><img alt="Loop A routes a user request through Antigravity CLI, SQLcl MCP, and Oracle AI Database to an answer. Loop B records a tool trace in Memory Store, passes it through Oracle AI Agent Memory and Hybrid Retrieval, and returns grounded context to Claude." src="https://cdn-images-1.medium.com/max/1024/1*K8YfSl_NIO2Bbj_V2pRi2Q.png" /><figcaption>Dual Execution Loop: MCP Interaction and Durable Memory</figcaption></figure><p>SQLcl MCP handles live tool use. Oracle AI Agent Memory handles durable memory and scoped recall. Most production setups need both loops, but they solve different problems.</p><h3>Reproducing the Oracle SQLcl MCP Server and Antigravity Workflow</h3><p>The setup should be reproducible. SQLcl runs in MCP mode with sql -mcp. Antigravity launches it as an MCP server and talks to Oracle through declared tools, not through direct access. Connections come from saved SQLcl profiles that you create and test before Antigravity uses them.</p><p>The AI coding agent should not invent database connections at runtime. It should reuse profiles you have already created and validated.</p><p>Prerequisites before you connect Antigravity:</p><ul><li>Oracle SQLcl 25.2.0 or higher.</li><li>Oracle JRE 17 or 21.</li><li>Antigravity with MCP configuration available through mcp_config.json.</li><li>At least one saved SQLcl connection profile under ~/.dbtools, created with password persistence for MCP use.</li><li>A database user with the minimum permissions required for the workflow. Start with read-only access and a sanitized development or replica environment where possible.</li></ul><p>The notebook treats the saved SQLcl connection alias as a first-class artifact. In local development, that alias is what lets SQLcl MCP connect without forcing the agent to assemble credentials dynamically. In this notebook, the alias is antigravity_mcp.</p><p>The notebook then generates a sanitized Antigravity MCP config preview. The preview is intentionally safe: it shows the server command and arguments without exposing secrets. It does not overwrite your real Antigravity MCP configuration.</p><p>For the saved connection itself, the important detail is -savepwd.</p><pre>conn -save antigravity_mcp -savepwd &lt;ORACLE_USER&gt;/&lt;ORACLE_PASSWORD&gt;@&lt;ORACLE_DSN&gt;</pre><p>The notebook validates this alias with SQLcl -name antigravity_mcp before Antigravity uses it.</p><p>MCP cannot stop and ask a human for a password each time the agent invokes a database tool. The saved alias becomes the repeatable local path Antigravity can use after you have reviewed it.</p><pre>{ <br>  &quot;mcpServers&quot;: { <br>    &quot;sqlcl&quot;: { <br>      &quot;command&quot;: &quot;&lt;STANDALONE_SQLCL_EXECUTABLE&gt;&quot;, <br>      &quot;args&quot;: [&quot;-mcp&quot;] <br>    } <br>  } <br>}</pre><p>That JSON block defines the connection between Antigravity and SQLcl MCP Server. Save it in .agents/mcp_config.json for a workspace-scoped setup or ~/.gemini/config/mcp_config.json globally, then reload MCP servers from Antigravity’s MCP manager.</p><pre>def default_antigravity_mcp_config_path() -&gt; Path: <br>    return Path.home() / &quot;.gemini&quot; / &quot;config&quot; / &quot;mcp_config.json&quot; <br> <br>preview_path = PROJECT_ROOT / &quot;antigravity_sqlcl_mcp_config.preview.json&quot; <br>preview_path.write_text(json.dumps(mcp_config_json, indent=2) + &quot;\n&quot;, encoding=&quot;utf-8&quot;)</pre><p>A useful first prompt is intentionally constrained:</p><pre>Use SQLcl MCP to list available saved Oracle connections. Do not run DML or DDL.</pre><p>Validation checklist before expanding access:</p><ul><li>Run sql -mcp locally and confirm the server starts.</li><li>Reload Antigravity MCP servers and confirm the SQLcl tools are discoverable.</li><li>Run one read-only query against an approved schema.</li><li>Check database-side MCP activity logs and session metadata where available.</li><li>Document the connection alias, database user, grant scope, restrict level, and troubleshooting owner.</li></ul><p>Good first proof looks like this:</p><ul><li>The MCP server starts without a Java or path error.</li><li>Antigravity lists the SQLcl MCP tools after the MCP reload.</li><li>A read-only query succeeds against the expected schema.</li><li>The notebook’s simulated teaching audit trail records the expected tool interaction in antigravity_tool_logs.</li><li>For live Antigravity plus SQLcl MCP validation, confirm database/session activity through your normal Oracle monitoring path.</li><li>A denied query fails because of the database role, not because a prompt asked nicely.</li></ul><p>A useful MCP boundary is more than tool discovery. The notebook models read-only defaults, confirmation requirements, scope checks, and controlled failure examples so denied and warning states are visible.</p><ul><li><strong>Read-only default: </strong>start with inspection and diagnostics before allowing changes.</li><li><strong>Confirmation gate: </strong>require explicit approval for medium-risk, write-like, or destructive actions.</li><li><strong>Scope control: </strong>keep user, tenant, and schema filters close to the database query.</li><li><strong>Failure trace: </strong>store denied calls and warnings as evidence instead of hiding them.</li></ul><pre>MCP_TOOL_POLICY = { <br>    &quot;list-connections&quot;: {&quot;readOnlyHint&quot;: True, &quot;risk&quot;: &quot;LOW&quot;}, <br>    &quot;connect&quot;: {&quot;readOnlyHint&quot;: True, &quot;risk&quot;: &quot;LOW_TO_MEDIUM&quot;}, <br>    &quot;run-sql&quot;: {&quot;readOnlyHint&quot;: True, &quot;risk&quot;: &quot;LOW_TO_MEDIUM&quot;}, <br>    &quot;run-sqlcl&quot;: {&quot;readOnlyHint&quot;: False, &quot;destructiveHint&quot;: True, &quot;risk&quot;: &quot;CRITICAL&quot;}, <br>}</pre><h3>What a Successful Notebook Run Shows</h3><p>The notebook is not just setup prose. It produces concrete checkpoints that make the workflow inspectable.</p><p>The first useful result is a deterministic Antigravity/MCP timeline. The sample data uses explicit event sequence values and simulated event timestamps so the workflow order is stable every time the notebook is rerun:</p><pre>step  event_kind    actor             result <br>1     CONVERSATION  user              initial support-job request <br>2     CONVERSATION  assistant         SQLcl MCP read-only plan <br>3     MCP_TOOL      list-connections  SUCCESS <br>4     MCP_TOOL      run-sql           SUCCESS <br>5     MCP_TOOL      run-sql           DENIED / PRIVILEGE_SCOPE <br>6     CONVERSATION  assistant         grounded summary</pre><p>That ordering matters because operational memory is only useful if the answer can be traced back to the request, the tool calls, and the permission boundary that shaped the result.</p><p>The notebook combines lexical search, vector search, and hybrid search so retrieved context can include both exact operational terms and semantic matches.</p><p>The grounding package also returns visible evidence before the assistant answer is assembled:</p><pre>Status: READY <br> <br>Top evidence: <br>- Saved SQLcl connections for MCP <br>- SQLcl MCP execution boundary <br>- Tool logging baseline <br>- LangChain as orchestration glue</pre><p>If retrieval is empty or too weak, the notebook returns INSUFFICIENT_CONTEXT and displays a safe empty-result message instead of trying to select columns from missing evidence.</p><p>In a fully configured local environment, the final snapshot should show the main layers as ready:</p><pre>Antigravity MCP config             generated <br>SQLcl MCP runtime                  ready <br>SQLcl saved connection             ready <br>Oracle AI Database memory          ready <br>Oracle AI Agent Memory package     ready <br>Lexical search                     ready <br>Native VECTOR execution path       ready <br>Demo embeddings                    demo ready <br>Hybrid retrieval                   ready <br>LangChain wrapper                  ready <br>validation_action_needed           0</pre><p>Some rows may show DEMO_READY, FALLBACK, OPTIONAL, or ACTION_NEEDED depending on SQLcl discovery, catalog privileges, vector support, package availability, and local MCP validation.</p><p>That is the practical bar for this demo: setup artifacts are generated, SQLcl MCP prerequisites are validated, Oracle memory tables are populated, retrieval works, Agent Memory initializes, and the notebook separates native VECTOR readiness from deterministic demo embeddings.</p><h3>Simulated Teaching Data, Not Live Antigravity Telemetry</h3><p>One important boundary in the companion notebook is that the operational records are simulated teaching data. The notebook inserts sample conversation rows and sample tool-log rows to show what a production workflow should preserve: the user’s request, Antigravity’s plan, tool calls, outcomes, controlled failures, and retrieval evidence.</p><p>Those rows are not live telemetry captured from Antigravity, and the notebook does not automatically observe, scrape, or stream Antigravity activity. Live Antigravity validation still happens through Antigravity’s MCP configuration and the SQLcl MCP server. The notebook proves the database-backed memory, retrieval, and validation pattern around that workflow so the pieces are inspectable and repeatable.</p><p>The optional live audit cell is separate on purpose. After a real Antigravity plus SQLcl MCP prompt, it tries to inspect DBTOOLS$MCP_LOG and V$SESSION module/action metadata. If catalog visibility is unavailable, it reports ACTION_NEEDED instead of pretending simulated logs prove live MCP traffic.</p><h3>Why Put Application Memory Records in Oracle AI Database, Not Just Outputs</h3><p>Once the first MCP tool calls work, the next challenge is continuity. This is where long-term memory for AI agents becomes different from short-lived chat context.</p><p>If memory lives only in chat context, the system is fragile. If memory is scattered across files without structure, retrieval and auditing become expensive over time. For workflows that need auditability, scoped retrieval, and repeated use across sessions, a database-backed memory model is easier to operate than scattered files or prompt-only context.</p><p>The companion notebook builds this memory layer from scratch so the mechanics are visible, then shows how Oracle AI Agent Memory sits on top of it once the substrate is working.</p><p>Memory categories that matter in practice:</p><ul><li>Conversation memory keeps the important user and assistant turns that future sessions may need.</li><li>Operational memory keeps tool calls, outcomes, warnings, and failures so a team can debug what happened.</li><li>Semantic memory adds embeddings so the system can find relevant context even when the user asks in different words.</li></ul><p>In practice, hybrid retrieval for agent memory usually combines exact operational terms, such as sql -mcp or antigravity_mcp, with semantic search over memory records.</p><p>The notebook shows the lower-level mechanics first so the storage and retrieval path is visible. This is also a context engineering problem: the application has to decide which memories, tool traces, and retrieval results should be assembled before Antigravity or another assistant answers. Oracle AI Agent Memory then gives application code a higher-level package API over that same database-backed idea.</p><h3>Where Oracle AI Agent Memory Fits</h3><p>Oracle AI Agent Memory sits between your application code and Oracle AI Database. The package manages conversation threads, durable memory records, scoped retrieval, and context assembly while Oracle AI Database remains the storage layer underneath.</p><p>The notebook includes an abbreviated package-backed memory pattern. It initializes OracleAgentMemory with a database connection pool and a custom local deterministic embedder. LocalAntigravityEmbedder is notebook code, not a built-in Oracle AI Agent Memory embedder.</p><p>The local embedder is intentionally billing-free, which makes the notebook runnable for people who do not want to attach paid model usage to a tutorial.</p><p>In Oracle AI Agent Memory, use MemoryExtractionConfig(extract_memories=False)and memory_store_id for this notebook’s package-backed setup.</p><pre>from oracleagentmemory.apis.searchscope import SearchScope <br>from oracleagentmemory.core import MemoryExtractionConfig <br>from oracleagentmemory.core.oracleagentmemory import OracleAgentMemory <br> <br>db_pool = oracledb.SessionPool( <br>    user=CONFIG[&quot;ORACLE_USER&quot;], <br>    password=CONFIG[&quot;ORACLE_PASSWORD&quot;], <br>    dsn=CONFIG[&quot;ORACLE_DSN&quot;], <br>    min=1, <br>    max=4, <br>    increment=1, <br>) <br> <br>agent_memory = OracleAgentMemory( <br>    connection=db_pool, <br>    embedder=LocalAntigravityEmbedder(dimensions=32), <br>    llm=None, <br>    memory_extraction_config=MemoryExtractionConfig(extract_memories=False), <br>    schema_policy=&quot;create_if_necessary&quot;, <br>    memory_store_id=&quot;ag_oam_local&quot;, <br>)</pre><p>Use oracleagentmemory from your application layer when you need package-managed users, agents, memories, threads, scoped retrieval, and context assembly. Keep systems of record separate from memory records: memory helps provide context, but application logic and authoritative data sources should still decide what is true, allowed, and final.</p><p>Implementation note: Use a schema whose default tablespace supports the JSON objects created by Agent Memory. For an Antigravity-specific local setup, the notebook now suggests antigravity_memory_ts and antigravity_memory in the sample SQL.</p><pre>CREATE TABLESPACE antigravity_memory_ts <br>DATAFILE &#39;/opt/oracle/oradata/FREE/FREEPDB1/antigravity_memory_ts01.dbf&#39; <br>SIZE 200M <br>AUTOEXTEND ON NEXT 100M <br>SEGMENT SPACE MANAGEMENT AUTO; <br> <br>CREATE USER antigravity_memory IDENTIFIED BY &quot;CHOOSE_A_STRONG_PASSWORD&quot;; <br>GRANT CREATE SESSION, CREATE TABLE, CREATE SEQUENCE, CREATE VIEW, CREATE PROCEDURE TO antigravity_memory; <br>ALTER USER antigravity_memory DEFAULT TABLESPACE antigravity_memory_ts; <br>ALTER USER antigravity_memory QUOTA UNLIMITED ON antigravity_memory_ts;</pre><h3>Store and Search: What a Realistic Memory Looks Like</h3><p>A realistic Antigravity memory is not generic trivia about a user. For this workflow, memory should capture how a developer actually works: the connection name they used, the SQLcl path that succeeded, the MCP config location, the failed privilege boundary, the retrieval query that helped, and the final fix that should be reused later.</p><pre>thread = agent_memory.create_thread( <br>    user_id=AGENT_MEMORY_USER_ID, <br>    agent_id=AGENT_MEMORY_AGENT_ID, <br>) <br> <br>thread.add_memory( <br>    &quot;Developer validated Antigravity CLI with SQLcl MCP alias antigravity_mcp &quot; <br>    &quot;against local Oracle AI Database service FREEPDB1.&quot; <br>) <br> <br>results = agent_memory.search( <br>    query=&quot;Antigravity SQLcl MCP alias validation and Agent Memory setup&quot;, <br>    scope=SearchScope(user_id=AGENT_MEMORY_USER_ID, agent_id=AGENT_MEMORY_AGENT_ID), <br>)</pre><p>That kind of memory pays off because it is operational. It can help Antigravity answer the next question with context from a previous debugging session, but it is still scoped and retrievable through a database-backed API.</p><h3>Vector Search, Native VECTOR, and Demo Embeddings</h3><p>Vector search is part of the Oracle AI Database memory story. In a real application, embeddings usually come from a model and are indexed with Oracle AI Database vector capabilities.</p><p>The notebook separates two ideas that are easy to accidentally blur:</p><ul><li>Native VECTOR readiness means the database can store and search vectors through the Oracle AI Database vector path.</li><li>Deterministic demo embeddings are local, repeatable vectors used so the notebook can run without external model billing.</li></ul><p>The deterministic embeddings are useful for portability and inspection, but they should not be described as production semantic embeddings. For production, replace the notebook’s demo_embed()or LocalAntigravityEmbedder with a supported embedding model after cost, latency, privacy, and retrieval-quality review.</p><p>The final notebook snapshot makes this separation explicit with two rows: Native VECTOR execution path and Demo embeddings.</p><figure><img alt="A user query passes through a tenant filter, Lexical search using Oracle Text, Vector search using Oracle VECTOR, Hybrid scoring, and a Grounding package before producing the final answer." src="https://cdn-images-1.medium.com/max/824/1*mXohODhykSgVYWbGRTg5tg.png" /><figcaption>Retrieval pipeline diagram</figcaption></figure><h3>Where LangChain Adds Value</h3><p>LangChain should not be treated as the source of truth. Antigravity does not call LangChain directly in this architecture, and LangChain is not the permission boundary, memory store, or audit layer.</p><p>In this notebook, LangChain is used as a compatibility layer. The custom Oracle-backed hybrid_search() path performs retrieval, then the results are wrapped as LangChain Document objects so applications that already expect LangChain interfaces can consume them.</p><p>By the time LangChain is introduced, the database tables, package memory, retrieval scores, and validation snapshot already exist. LangChain becomes a wrapper around evidence, not a substitute for evidence.</p><pre>class OracleMemoryRetriever(BaseRetriever): <br>    def _get_relevant_documents(self, query: str): <br>        rows = hybrid_search(query, tenant_id=&quot;TENANT_A&quot;, top_k=3) <br>        return [ <br>            Document(page_content=row[&quot;chunk_text&quot;], metadata={&quot;category&quot;: row[&quot;category&quot;]}) <br>            for _, row in rows.iterrows() <br>        ]</pre><p>Use it when the consuming application already expects retrievers, documents, chains, or tool orchestration. If the application only needs direct SQL, package-backed Agent Memory search, or a simple evidence table, the extra abstraction can make debugging harder.</p><h3>How to Move This from Demo to Production</h3><p>The difference between demo success and production success is disciplined operations. In this workflow, the first failures to check are usually integration issues: SQLcl discovery, Java runtime, saved connection aliases, database permissions, and retrieval configuration.</p><p><strong>Access and privilege model:</strong></p><ul><li>Use a dedicated application schema where possible, then tighten grants with least-privilege roles and quotas.</li><li>Keep saved SQLcl aliases separate by role and environment instead of sharing one broad connection.</li><li>Start read-only wherever possible and gate write operations with explicit confirmation workflows.</li><li>Use schema allowlists and separate accounts for development, test, and production.</li></ul><p><strong>Observability model:</strong></p><ul><li>Log tool name, thread ID, timestamp, status, and sanitized inputs and outputs.</li><li>Classify failures into runtime, discovery, connection, permission, query, and retrieval categories.</li><li>Keep a troubleshooting playbook in the repo so setup issues do not become tribal knowledge.</li><li>Check whether retrieval quality changes as more data and memory records are added.</li></ul><p><strong>Reliability model:</strong></p><ul><li>Prefer deterministic SQL patterns with bounded result sets.</li><li>Use retrieval-first context assembly for memory-heavy tasks.</li><li>Avoid giant context stuffing as a substitute for memory design.</li><li>Review and prune tool surfaces periodically.</li><li>Move from the local deterministic embedder to a supported embedding model after cost, latency, and privacy review.</li></ul><h3>What to Check When the Workflow Fails</h3><p><strong>Runtime failure: sql -mcp does not start.</strong></p><p>Check the absolute SQLcl path, confirm Java is available, and run sql -mcp outside Antigravity first. Resolve runtime issues before checking assistant behavior.</p><p><strong>Discovery failure: Antigravity does not see tools.</strong></p><p>Check the Antigravity MCP configuration, confirm the configured command points to the SQLcl executable, and reload MCP servers after edits.</p><p><strong>Connection failure: tools are present but queries fail immediately.</strong></p><p>Check the saved SQLcl connection alias, confirm the profile lives under the expected SQLcl connection store, and verify password persistence for the MCP workflow. Then test the same connection outside Antigravity.</p><p><strong>Permission failure: queries execute selectively and fail on specific objects.</strong></p><p>Check the database role first. A selective failure can be the right outcome when least privilege is working. Add grants intentionally and keep read-write access separate from the initial validation path.</p><p><strong>Retrieval quality failure: answers are fluent but weakly grounded.</strong></p><p>Inspect the retrieved records before blaming the model. Check chunk size, metadata filters, embedding choice, top-k settings, and whether the query is asking for exact history, semantic similarity, or operational logs.</p><h3>Choosing the Right Mix: MCP, Oracle AI Agent Memory, Direct SQL, and LangChain</h3><p>The hybrid model is not automatically the right answer for every team. It is useful when one workflow needs live tool execution, durable memory, retrieval evidence, and application-side orchestration without forcing one layer to do every job.</p><p>For simple read-only inspection, direct SQL through the Oracle SQLcl MCP server may be enough. Add Oracle AI Agent Memory when the workflow needs durable scoped recall across sessions. Add LangChain when another application already expects retrievers, documents, or chains.</p><p>The hybrid approach works because it does not force one layer to do everything. MCP handles live tool execution, Oracle AI Database keeps durable evidence, Oracle AI Agent Memory provides the memory API, and LangChain is added only when the application needs that shape.</p><p>For this workflow, the value is that the assistant can stay in the developer loop without becoming an unreviewed database actor. Antigravity can help plan, inspect, and explain. SQLcl MCP exposes the database path as tools. Oracle AI Database keeps the durable evidence.</p><h3>Conclusion</h3><p>An Antigravity and SQLcl MCP workflow becomes useful when it is treated as an engineering pattern, not just a setup trick. Antigravity keeps the developer moving, SQLcl MCP keeps database access explicit, and Oracle AI Database keeps the evidence durable enough to inspect later.</p><p>The result is a workflow a team can inspect. You can see what Antigravity asked for, which tool path ran, what the database allowed, which memory records were retrieved, and how the final answer was assembled.</p><p>That is the shift that matters: from assistant access that is implicit and hard to audit, to explicit boundaries, durable memory, and evidence a developer can actually debug.</p><h3>Frequently Asked Questions</h3><p><strong>What is MCP in this context?</strong></p><p>MCP is the protocol boundary that lets Antigravity call explicit tools exposed by a server instead of accessing systems implicitly.</p><p><strong>What does MCP protect, and what does it not protect?</strong></p><p>MCP makes the tool interface explicit and reviewable. It does not replace database security. The saved SQLcl connection profile, database user, grants, roles, network controls, and database policies determine what those tools can actually access or change.</p><p><strong>Why use SQLcl for Oracle MCP?</strong></p><p>SQLcl already understands Oracle workflows and can run as the Oracle SQLcl MCP server with sql -mcp, making the Oracle integration practical and direct.</p><p><strong>Why include Oracle AI Database if MCP already works?</strong></p><p>MCP handles the execution boundary. Oracle AI Database handles durable memory, retrieval, vector search, concurrency, observability, and governance.</p><p><strong>Do I need an external model API key?</strong></p><p>Only if you change the notebook to use a provider-backed embedding or LLM service. The default notebook path uses a local deterministic embedder.</p><p><strong>Why include LangChain if Oracle already stores memory?</strong></p><p>Many teams already use LangChain-shaped retrievers and chains. The notebook shows how Oracle-backed retrieval can fit that interface.</p><p><strong>What is the minimum viable setup?</strong></p><p>SQLcl MCP configured for Antigravity, one safe saved Oracle connection, and a read-only validation flow.</p><p><strong>Should production start with read-write permissions?</strong></p><p>Usually no. Start read-only, log everything important, and add write scopes gradually with explicit approvals.</p><p><strong>What is the best rollout strategy?</strong></p><p>Pilot in development with read-only access and strong logging, then expand capabilities in controlled phases as the team learns which memory and tool paths are actually useful.</p><h3>Companion Troubleshooting Appendix</h3><ul><li><strong>Minimum viable setup: </strong>SQLcl MCP configured in Antigravity, one approved Oracle connection, read-only validation, and database-side activity logging.</li><li><strong>First checks: </strong>confirm sql -mcp starts, Antigravity sees the tools after reload, and the saved SQLcl connection alias resolves.</li><li><strong>Environment model: </strong>use separate credentials and policies for dev, test, and prod, with stricter controls as capability expands.</li><li><strong>Logging model: </strong>capture tool name, timestamp, thread ID, status, sanitized input/output summaries, and relevant SQLcl MCP log records.</li><li><strong>Retrieval quality: </strong>tune chunk size, enrich metadata, review embedding choice, and evaluate retrieval against representative queries.</li><li><strong>Common anti-pattern: </strong>expanding tool surfaces before ownership, logging standards, and runbooks are in place.</li><li><strong>Rollout path: </strong>pilot in dev with read-only access and strong logging, then expand capabilities in controlled phases.</li><li><strong>Schema: </strong>Agent Memory package tables need a schema and tablespace that can create the package’s JSON-backed objects.</li><li><strong>Scheduler job: </strong>package-managed expiry purge needs scheduler-job privilege or managed setup for production.</li><li><strong>Model calls: </strong>an API key can be present but still fail if the model provider account has no quota.</li></ul><h3>Resources</h3><ul><li><a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.6/guide/get-started.html">Oracle AI Agent Memory documentation</a></li><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/">Oracle AI Database 26ai documentation</a></li><li><a href="https://pypi.org/project/oracleagentmemory/">oracleagentmemory on PyPI</a></li><li><a href="https://docs.oracle.com/en/database/oracle/sql-developer-command-line/25.2/sqcug/sqlcl-mcp-server.html">SQLcl MCP Server</a></li><li><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/antigravity_mcp_oracle_ai_database.ipynb">End-to-end companion notebook</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00b91ff41c2d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/oracledevs/how-to-build-an-antigravity-workflow-with-the-oracle-sqlcl-mcp-server-and-oracle-ai-database-00b91ff41c2d">How to Build an Antigravity Workflow with the Oracle SQLcl MCP Server and Oracle AI Database</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>
        <item>
            <title><![CDATA[Build a Controlled Cursor MCP Workflow with Oracle AI Database]]></title>
            <link>https://medium.com/oracledevs/build-a-controlled-cursor-mcp-workflow-with-oracle-ai-database-0ab971c4717e?source=rss-33455f8a7b66------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ab971c4717e</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[cursor-ai]]></category>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Srinidhi Sathyamurthy]]></dc:creator>
            <pubDate>Wed, 02 Sep 2026 11:42:08 GMT</pubDate>
            <atom:updated>2026-11-06T15:53:00.358Z</atom:updated>
            <content:encoded><![CDATA[<h4>A controlled Cursor MCP workflow gives an assistant an explicit tool boundary for Oracle AI Database access. The useful result is a permitted action with an inspectable outcome, not unrestricted access to every database object.</h4><h4><strong>Giving an AI assistant database access is easy. Making that access controlled, inspectable, and repeatable is the hard part. Here is the Cursor CLI and Oracle AI Database workflow that does it.</strong></h4><p><strong>Companion notebook: </strong><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/cursor_mcp_oracle_ai_database.ipynb"><strong>Cursor MCP with Oracle AI Database Workflow</strong></a></p><figure><img alt="Build a Controlled Cursor MCP Workflow with Oracle AI Database" src="https://cdn-images-1.medium.com/max/1024/1*gRzXqNhLSKRDN0_uOrE9oA.png" /></figure><h3>Key Takeaways</h3><ul><li><a href="https://modelcontextprotocol.io/docs/2026-07-28/getting-started/intro">MCP</a> turns AI-to-database access into an explicit tool contract instead of implicit system access.</li><li><a href="https://docs.oracle.com/en/database/oracle/sql-developer-command-line/25.2/sqcug/sqlcl-mcp-server.html">Oracle SQLcl in MCP</a> mode, sql -mcp, is a practical way to connect Cursor CLI to Oracle AI Database through a local MCP server.</li><li>Oracle AI Database provides the persistent storage and vector search layer for memory workloads, while <a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.6/guide/api/agentmemory.html">Oracle AI Agent Memory</a> gives teams a Python API for threads, durable memories, scoped retrieval, and context assembly on top of it.</li><li><a href="https://docs.langchain.com/oss/python/integrations/vectorstores/oracle">LangChain</a> can provide application-side wrappers and orchestration after the Oracle-backed memory and retrieval path is in place.</li><li>A strong default is hybrid: Cursor CLI plus MCP for interactive database work, Oracle AI Database plus Oracle AI Agent Memory for durable memory, and LangChain only when the application needs reusable retrieval orchestration.</li></ul><p>Here is how those components connect in this pattern. The important visual point is that Cursor does not connect directly to Oracle AI Database. Cursor calls SQLcl MCP tools, SQLcl uses a saved Oracle connection, and Oracle AI Database remains the durable store for memory records, retrieval evidence, vectors, and tool traces. Oracle AI Agent Memory and LangChain sit in the application layer after that database-backed path is in place.</p><p>Production success depends less on clever prompting and more on boundaries, privileges, logging, scoped retrieval, and repeatable runbooks.</p><p>This guide is for developers who want Cursor CLI to work with Oracle AI Database through explicit tools, durable memory, and reviewable retrieval evidence.</p><p><strong>The developer path through this guide is simple:</strong></p><ol><li>Start with one approved Oracle connection and a read-only validation query.</li><li>Put SQLcl MCP in front of that connection so Cursor sees tools, not raw database credentials.</li><li>Check the audit and activity trail before adding more tool access.</li><li>Add Oracle AI Agent Memory when the workflow needs durable thread context, scoped recall, or reusable context cards.</li><li>Add <a href="https://docs.langchain.com/oss/python/integrations/vectorstores/oracle">LangChain</a> only when you need application-side retrieval orchestration beyond the MCP interaction loop.</li></ol><figure><img alt="Architecture diagram showing a human operator using Cursor CLI and SQLcl MCP Server to access Oracle AI Database and Oracle AI Agent Memory, with memory tables, tool logs, vector retrieval, LangChain retrieval, and grounded context." src="https://cdn-images-1.medium.com/max/1024/1*cDk46w2Jebzq2vPb2xQ3Tw.png" /><figcaption>Controlled Cursor MCP + Oracle AI Database Workflow</figcaption></figure><h3>Why This Architecture Is Useful for Developers</h3><p>Giving an AI assistant database access is easy. Making that access controlled, inspectable, and repeatable is the hard part.</p><p>Cursor is useful because it sits close to the developer’s actual work: code, terminal commands, notebooks, configuration, and implementation details. A developer can move from “why is this failing?” to “inspect the database state” inside the same working loop. That closeness is powerful, but it also makes the database boundary more sensitive.</p><p>The question is not whether Cursor can produce SQL-shaped text. The question is whether the database path is approved, observable, and easy to debug later. A useful workflow needs to preserve the request, the tool call, the database identity, the retrieved context, and the reason a risky action was allowed or blocked.</p><p>By the end of this guide, you should know how to connect Cursor CLI to Oracle AI Database through a controlled MCP boundary, when Cursor context is enough and when Oracle-backed memory is needed, and how to build a retrieval path that can be queried, audited, and scaled.</p><p>The companion notebook is intentionally practical. It validates SQLcl and Java discovery, writes a sanitized Cursor MCP config preview, checks the saved SQLcl connection alias, creates memory tables, inserts simulated Cursor/MCP teaching traces, tests lexical, vector, and hybrid retrieval, initializes Oracle AI Agent Memory with the current 26.6 configuration shape, and finishes with a validation snapshot.</p><p>The workflow has five layers. Cursor CLI is the developer-facing agent interface. SQLcl MCP is the tool boundary. Oracle AI Database is the durable substrate for memory, traces, and retrieval. The notebook is the build-and-validation harness that proves the pieces are wired correctly before the workflow is handed to Cursor.</p><figure><img alt="Table labeled “Layer” and “Responsibility.” It identifies Cursor CLI as the MCP client and agent interface; SQLcl MCP as the Oracle tool boundary; Oracle AI Database as the store for data, vectors, metadata, traces, and retrieval evidence; Oracle AI Agent Memory as the API layer for memory, scoped retrieval, and context assembly; and LangChain as the application orchestration layer." src="https://cdn-images-1.medium.com/max/1024/1*xFaJqqp-slafQwAkmiGyfQ.png" /><figcaption>Layered architecture diagram mapping Cursor CLI, SQLcl MCP, Oracle AI Database, Oracle AI Agent Memory, and LangChain to their responsibilities.</figcaption></figure><h3>The Two Execution Loops</h3><p>Building on that split between tool boundary and durable store, the system naturally forms two execution loops:</p><ul><li><strong>Loop A </strong>is the operational interaction loop: Cursor CLI works with MCP to discover tools, inspect data, run bounded read-only queries, and return results immediately.</li><li><strong>Loop B</strong> is the durable memory and retrieval loop: application code writes history, tool logs, memory records, chunks, and embeddings to Oracle AI Database, then retrieves context before a later answer or workflow step.</li></ul><figure><img alt="Diagram showing User to Cursor CLI to SQLcl MCP to Oracle AI Database to Answer, with a second loop where tool traces enter a memory store, Oracle AI Agent Memory, hybrid retrieval, and grounded context returned to Claude." src="https://cdn-images-1.medium.com/max/1024/1*Uha8Ltys1mvxFBSvl1PtoA.png" /><figcaption>Dual Execution Loop: MCP Interaction and Durable Memory</figcaption></figure><p>SQLcl MCP handles live tool use. Oracle AI Agent Memory handles durable memory and scoped recall. Most production setups need both loops, but they solve different problems.</p><h3>Reproducing the SQLcl MCP and Cursor CLI Workflow</h3><p>The setup should be reproducible. SQLcl runs in MCP mode with sql -mcp. Cursor CLI launches it as an MCP server and talks to Oracle through declared tools, not through direct access. Connections come from saved SQLcl profiles that you create and test before Cursor uses them.</p><p>Cursor does not invent them at runtime; it reuses profiles you have already created and validated.</p><p><strong>Prerequisites before you connect Cursor CLI:</strong></p><ul><li>Oracle SQLcl 25.2.0 or higher.</li><li>Oracle JRE 17 or 21.</li><li>Cursor IDE or Cursor CLI if you want to use the generated MCP configuration outside the notebook.</li><li>At least one saved SQLcl connection profile under ~/.dbtools, created with password persistence for MCP use.</li><li>A database user with the minimum permissions required for the workflow. Start with read-only access and a sanitized development or replica environment where possible.</li></ul><p>The notebook deliberately treats the saved SQLcl connection alias as a first-class artifact. In local development, that alias is what lets SQLcl MCP connect without forcing the agent to assemble credentials dynamically.</p><p>The notebook then generates a sanitized Cursor MCP config preview. The preview is intentionally safe: it shows the server command and arguments without exposing secrets. It does not overwrite your real Cursor MCP configuration.</p><p>For the saved connection itself, the important detail is -savepwd. MCP cannot stop and ask a human for the password every time Cursor invokes a database tool. The saved alias becomes the repeatable local path Cursor can use after you have reviewed it.</p><pre>{ <br>  &quot;mcpServers&quot;: { <br>    &quot;sqlcl&quot;: { <br>      &quot;command&quot;: &quot;/absolute/path/to/sql&quot;, <br>      &quot;args&quot;: [&quot;-mcp&quot;] <br>    } <br>  } <br>}</pre><p>That small JSON block defines the connection between Cursor and SQLcl MCP Server. Cursor interacts with the database through the tools and permissions exposed by the MCP server, using the saved SQLcl connection profile you created and tested first. Save this configuration in .cursor/mcp.json for a project-scoped setup or ~/.cursor/mcp.json globally, restart Cursor or Cursor CLI, then run:</p><pre>cursor-agent mcp list <br>cursor-agent mcp list-tools sqlcl</pre><p>A useful first prompt is intentionally constrained:</p><pre>Use SQLcl MCP to list available saved Oracle connections. Do not run DML or DDL.</pre><p>Validation checklist before expanding access: Run sql -mcp locally and confirm the server starts.</p><ul><li>Restart Cursor CLI and confirm the SQLcl tools are discoverable.</li><li>Run one read-only query against an approved schema.</li><li>Check database-side MCP activity logs and session metadata.</li><li>Document the connection alias, database user, grant scope, restrict level, and troubleshooting owner.</li></ul><p>Good first proof looks like this:</p><ul><li>The MCP server starts without a Java or path error.</li><li>Cursor lists the SQLcl MCP tools after restart.</li><li>A read-only query succeeds against the expected schema.</li><li>The notebook audit trail records the expected tool interaction in cursor_tool_logs.</li><li>For live Cursor CLI + SQLcl MCP validation, confirm the database/session activity through your normal Oracle monitoring path.</li><li>A denied query fails because of the database role, not because a prompt asked nicely.</li></ul><p>A useful MCP boundary is more than tool discovery. The notebook models read-only defaults, confirmation requirements, scope checks, and controlled failure examples so denied and warning states are visible.</p><ul><li>Read-only default: start with inspection and diagnostics before allowing changes.</li><li>Confirmation gate: require explicit approval for medium-risk, write-like, or destructive actions.</li><li>Scope control: keep user, tenant, and schema filters close to the database query.</li><li>Failure trace: store denied calls and warnings as evidence instead of hiding them.</li></ul><h3>What a Successful Notebook Run Shows</h3><p>The notebook is not just setup prose. It produces concrete checkpoints that make the workflow inspectable.</p><p>The first useful result is a deterministic Cursor/MCP timeline. The sample data uses explicit event sequence values and simulated event timestamps so the workflow order is stable every time the notebook is rerun:</p><pre>step  event_kind    actor                              result <br>1     CONVERSATION  user                               initial support-job request <br>2     CONVERSATION  assistant                          SQLcl MCP read-only plan <br>3     MCP_TOOL      sqlcl.connections/list_connections SUCCESS <br>4     MCP_TOOL      sqlcl.sql/query                    SUCCESS <br>5     MCP_TOOL      sqlcl.sql/query                    DENIED / PRIVILEGE_SCOPE <br>6     CONVERSATION  assistant                          grounded summary</pre><p>That ordering matters because operational memory is only useful if the answer can be traced back to the request, the tool calls, and the permission boundary that shaped the result.</p><p>The grounding package also returns visible evidence before the assistant answer is assembled:</p><pre>Status: READY <br><br>Top evidence: <br><br>- Saved SQLcl connections for MCP <br><br>- SQLcl MCP execution boundary <br><br>- Tool logging baseline <br><br>- LangChain as orchestration glue</pre><p>If retrieval is empty or too weak, the notebook returns INSUFFICIENT_CONTEXT and displays a safe empty-result message instead of trying to select columns from a missing evidence table.</p><p>The final snapshot should show every local layer that is ready:</p><pre>Cursor MCP config                  generated <br>SQLcl MCP runtime                  ready <br>SQLcl saved connection             ready <br>Oracle AI Database memory          ready <br>Oracle AI Agent Memory package     ready <br>Lexical search                     ready <br>Native VECTOR execution path       ready <br>Demo embeddings                    demo ready <br>Hybrid retrieval                   ready <br>LangChain wrapper                  ready <br>validation_action_needed           0</pre><p>That is the practical bar for this demo: Cursor setup artifacts are generated, SQLcl MCP prerequisites are validated, Oracle memory tables are populated, retrieval works, Agent Memory initializes, and the notebook separates native VECTOR readiness from deterministic demo embeddings.</p><h3>Simulated Teaching Data, Not Live Cursor Telemetry</h3><p>One important boundary in the companion notebook is that the operational records are simulated teaching data. The notebook inserts sample conversation rows and sample tool-log rows to show what a production workflow should preserve: the user’s request, Cursor’s plan, tool calls, outcomes, controlled failures, and retrieval evidence.</p><p>Those rows are not live telemetry captured from Cursor CLI, and the notebook does not automatically observe, scrape, or stream Cursor CLI activity. Live Cursor validation still happens through Cursor’s MCP configuration and the SQLcl MCP server. The notebook proves the database-backed memory, retrieval, and validation pattern around that workflow so the pieces are inspectable and repeatable.</p><h3>Why Put Application Memory Records in Oracle AI Database, Not Just Outputs</h3><p>Once the first MCP tool calls work, the next challenge is continuity. This is where long-term memory for AI agents becomes different from short-lived chat context.</p><p>If memory lives only in chat context, the system is fragile. If memory is scattered across files without structure, retrieval and auditing become expensive over time.</p><p>A database-backed memory model is usually cleaner and more scalable. The companion notebook builds this memory layer from scratch so the mechanics are visible, then shows how Oracle AI Agent Memory sits on top of it once the substrate is working.</p><p>Memory categories that matter in practice:</p><ul><li>Conversation memory keeps the important user and assistant turns that future sessions may need.</li><li>Operational memory keeps tool calls, outcomes, warnings, and failures so a team can debug what happened.</li><li>Semantic memory adds embeddings so the system can find relevant context even when the user asks in different words.</li></ul><p>In practice, hybrid retrieval for agent memory usually combines exact operational terms, such as sql -mcp or cursor_mcp, with semantic search over memory records.</p><p>The notebook shows the lower-level mechanics first so the storage and retrieval path is visible. This is also a context engineering problem: the application has to decide which memories, tool traces, and retrieval results should be assembled before Cursor or another assistant answers. Oracle AI Agent Memory then gives application code a cleaner package API over that same database-backed idea.</p><h3>Where Oracle AI Agent Memory Fits</h3><p>Oracle AI Agent Memory sits between your application code and Oracle AI Database. The package manages conversation threads, durable memory records, scoped retrieval, and context assembly while Oracle AI Database remains the storage layer underneath.</p><p>The notebook includes an abbreviated package-backed memory pattern. It initializes OracleAgentMemory with a database connection pool and a custom local deterministic embedder. LocalCursorEmbedder is notebook code, not a built-in Oracle AI Agent Memory embedder.</p><p>The local embedder is intentionally billing-free, which makes the notebook runnable for people who do not want to attach paid model usage to a tutorial.</p><p>In Oracle AI Agent Memory 26.6, use MemoryExtractionConfig(extract_memories=False) instead of the older inline extract_memories=False parameter, and use memory_store_id instead of table_name_prefix.</p><pre>from oracleagentmemory.apis.searchscope import SearchScope <br>from oracleagentmemory.core import MemoryExtractionConfig <br>from oracleagentmemory.core.oracleagentmemory import OracleAgentMemory <br>  <br>db_pool = oracledb.SessionPool( <br>    user=CONFIG[&quot;ORACLE_USER&quot;], <br>    password=CONFIG[&quot;ORACLE_PASSWORD&quot;], <br>    dsn=CONFIG[&quot;ORACLE_DSN&quot;], <br>    min=1, <br>    max=4, <br>    increment=1, <br>) <br>  <br>agent_memory = OracleAgentMemory( <br>    connection=db_pool, <br>    embedder=LocalCursorEmbedder(dimensions=32), <br>    llm=None, <br>    memory_extraction_config=MemoryExtractionConfig(extract_memories=False), <br>    schema_policy=&quot;create_if_necessary&quot;, <br>    memory_store_id=&quot;cursor_oam_local&quot;, <br>)</pre><p>Use oracleagentmemory from your application layer when you need package-managed users, agents, memories, threads, scoped retrieval, and context assembly. Keep systems of record separate from memory records: memory helps provide context, but application logic and authoritative data sources should still decide what is true, allowed, and final.</p><p>Implementation note: use a schema whose default tablespace supports the JSON objects created by Agent Memory. If a local SYSTEM schema sits on a tablespace that rejects JSON object creation, the better production answer is a dedicated application schema.</p><p>Production note: the package-managed expired-record purge job needs CREATE JOB or an equivalent scheduler-job privilege, or a managed schema setup flow. Without that privilege, expired messages and memories will not be purged automatically. For a local notebook demo, this is acceptable as long as the limitation is visible.</p><h3>Store and Search: What a Realistic Memory Looks Like</h3><p>A realistic Cursor memory is not generic trivia about a user. For this workflow, memory should capture how a developer actually works: the connection name they used, the SQLcl path that succeeded, the MCP config location, the failed privilege boundary, the retrieval query that helped, and the final fix that should be reused later.</p><pre>thread = agent_memory.create_thread( <br>    user_id=AGENT_MEMORY_USER_ID, <br>    agent_id=AGENT_MEMORY_AGENT_ID, <br>) <br>  <br>thread.add_memory( <br>    &quot;Developer validated Cursor CLI with SQLcl MCP alias cursor_mcp &quot; <br>    &quot;against local Oracle AI Database service FREEPDB1.&quot; <br>) <br>  <br>results = agent_memory.search( <br>    query=&quot;Cursor SQLcl MCP alias validation and Agent Memory setup&quot;, <br>    scope=SearchScope(user_id=AGENT_MEMORY_USER_ID, agent_id=AGENT_MEMORY_AGENT_ID), <br>)</pre><p>That kind of memory pays off because it is operational. It can help Cursor answer the next question with context from the previous debugging session, but it is still scoped and retrievable through a database-backed API.</p><h3>Vector Search, Native VECTOR, and Demo Embeddings</h3><p>Vector search is part of the Oracle AI Database memory story. In a real application, embeddings usually come from a model and are indexed with Oracle AI Database vector capabilities.</p><p>The notebook separates two ideas that are easy to accidentally blur:</p><ul><li>Native VECTOR readiness means the database can store and search vectors through the Oracle AI Database vector path.</li><li>Deterministic demo embeddings are local, repeatable vectors used so the notebook can run without external model billing.</li></ul><p>The deterministic embeddings are useful for portability and inspection, but they should not be described as productionsemantic embeddings. For production, replace the notebook’s demo_embed() or LocalCursorEmbedder with a supported embedding model after cost, latency, privacy, and retrieval-quality review.</p><p>The final notebook snapshot makes this separation explicit with two rows: Native VECTOR execution path and Demo embeddings.</p><figure><img alt="Vertical flow from user query through tenant filter, lexical search using Oracle Text, vector search using Oracle VECTOR, hybrid scoring, grounding package, and final answer." src="https://cdn-images-1.medium.com/max/824/1*mXohODhykSgVYWbGRTg5tg.png" /><figcaption>Hybrid search pipeline combining tenant filtering, Oracle Text lexical search, Oracle VECTOR search, scoring, and a grounding package.</figcaption></figure><h3>Where <a href="https://docs.langchain.com/oss/python/integrations/vectorstores/oracle">LangChain</a> Adds Value</h3><p>LangChain should not be treated as the source of truth. Cursor CLI does not call LangChain directly in this architecture, and LangChain is not the permission boundary, memory store, or audit layer.</p><p>In this notebook, LangChain is used as a compatibility layer. The custom Oracle-backed hybrid_search() path performs retrieval, then the results are wrapped as LangChain Document objects so applications that already expect LangChain interfaces can consume them.</p><p>By the time LangChain is introduced, the database tables, package memory, retrieval scores, and validation snapshot already exist. LangChain becomes a wrapper around evidence, not a substitute for evidence.</p><p>Use it when the consuming application already expects retrievers, documents, chains, or tool orchestration. If the application only needs direct SQL, package-backed Agent Memory search, or a simple evidence table, the extra abstraction can make debugging harder.</p><h3>How to Move This from Demo to Production</h3><p>The difference between demo success and production success is disciplined operations. In this workflow, the first failures to check are usually integration issues: SQLcl discovery, Java runtime, saved connection aliases, database permissions, and retrieval configuration. A local notebook can prove the wiring. A production workflow needs smaller database roles, managed secrets, clear MCP approval policy, repeatable environment setup, and monitoring aroundmemory writes and tool calls.</p><p>Access and privilege model:</p><ul><li>Use a dedicated application schema where possible, then tighten grants with least-privilege roles and quotas.</li><li>Keep saved SQLcl aliases separate by role and environment instead of sharing one broad connection.</li><li>Start read-only wherever possible and gate write operations with explicit confirmation workflows.</li><li>Use schema allowlists and separate accounts for development, test, and production.</li></ul><p>Observability model:</p><ul><li>Log tool name, thread ID, timestamp, status, and sanitized inputs and outputs.</li><li>Classify failures into runtime, discovery, connection, permission, query, and retrieval categories.</li><li>Keep a troubleshooting playbook in the repo so setup issues do not become tribal knowledge.</li><li>Check whether retrieval quality changes as more data and memory records are added.</li></ul><p>Reliability model:</p><ul><li>Prefer deterministic SQL patterns with bounded result sets.</li><li>Use retrieval-first context assembly for memory-heavy tasks.</li><li>Avoid giant context stuffing as a substitute for memory design.</li><li>Review and prune tool surfaces periodically.</li><li>Move from the local deterministic embedder to a supported embedding model after cost, latency, and privacy review.</li></ul><h3>What to Check When the Workflow Fails</h3><p>When this workflow fails, start with the integration points below.</p><ul><li>Runtime failure: sql -mcp does not start.</li></ul><p>Check the absolute SQLcl path, confirm Java is available, and run sql -mcp outside Cursor first. Resolve runtime issues before checking assistant behavior.</p><ul><li>Discovery failure: Cursor does not see tools.</li></ul><p>Check the Cursor MCP configuration, confirm the configured command points to the SQLcl executable, and restart or reload Cursor CLI after edits.</p><ul><li>Connection failure: tools are present but queries fail immediately.</li></ul><p>Check the saved SQLcl connection alias, confirm the profile lives under the expected SQLcl connection store, and verify password persistence for the MCP workflow. Then test the same connection outside Cursor.</p><ul><li>Permission failure: queries execute selectively and fail on specific objects.</li></ul><p>Check the database role first. A selective failure can be the right outcome when least privilege is working. Add grants intentionally and keep read-write access separate from the initial validation path.</p><ul><li>Retrieval quality failure: answers are fluent but weakly grounded.</li></ul><p>Inspect the retrieved records before blaming the model. Check chunk size, metadata filters, embedding choice, top-k settings, and whether the query is asking for exact history, semantic similarity, or operational logs. The notebook’s grounding package includes an INSUFFICIENT_CONTEXT path and guards empty evidence before displaying result columns.</p><h3>Why the Hybrid Model Is Usually the Best Long-Term Design</h3><p>No single layer handles both execution and memory well. Trying to force everything into Cursor context gets messy fast: you either lose control over execution, or you stuff too much state into prompts just to keep things working. On the other side, if you only build backend memory systems, you lose the speed and usability that makes an assistant useful during development.</p><p>The hybrid approach works because it does not force one layer to do everything. MCP handles live tool execution, Oracle AI Database keeps durable evidence, Oracle AI Agent Memory provides the memory API, and LangChain is added only when the application needs that shape.</p><p>In real teams this usually evolves over time. Start with Cursor CLI, SQLcl MCP, read-only access, and strong logging. Once people rely on the workflow, the gaps become visible: lost context, weak traceability, repeated setup work, or retrieval that is hard to explain. That is when database-backed memory and structured retrieval become worth adding.</p><p>For Cursor specifically, the value is that the assistant can stay in the developer loop without becoming an unreviewed database actor. Cursor can help plan, inspect, and explain. SQLcl MCP exposes the database path as tools. Oracle AI Database keeps the durable evidence. That is the combination that makes the workflow useful after the demo.</p><h3>Conclusion</h3><p>A Cursor and SQLcl MCP workflow becomes useful when it is treated as an engineering pattern, not just a setup trick. Cursor keeps the developer moving, SQLcl MCP keeps database access explicit, and Oracle AI Database keeps the evidence durable enough to inspect later.</p><p>The result is a workflow a team can inspect. You can see what Cursor asked for, which tool path ran, what the database allowed, which memory records were retrieved, and how the final answer was assembled.</p><p>That is the shift that matters: from assistant access that is implicit and hard to audit, to explicit boundaries, durable memory, and evidence a developer can actually debug. For database-connected development, that is what turns Cursor from a helpful local assistant into part of a controlled engineering workflow.</p><h3>Frequently Asked Questions</h3><p><strong>What is MCP in this context?</strong></p><p>MCP is the protocol boundary that lets Cursor call explicit tools exposed by a server instead of accessing systems implicitly.</p><p><strong>What does MCP protect, and what does it not protect?</strong></p><p>MCP makes the tool interface explicit and reviewable: Cursor can call only the tools exposed by the server. It does not replace database security. The saved SQLcl connection profile, database user, grants, roles, network controls, and database policies determine what those tools can actually access or change.</p><p><strong>Why use SQLcl for Oracle MCP?</strong></p><p>SQLcl already understands Oracle workflows and can run as the Oracle SQLcl MCP server with sql -mcp, making the Oracle integration practical and direct.</p><p><strong>Is this Cursor IDE or Cursor CLI?</strong></p><p>The workflow is Cursor CLI oriented because the notebook validates the SQLcl MCP path using a local MCP serverdefinition and manual Cursor CLI checks. The same MCP server can be configured in project-scoped .cursor/mcp.json or global ~/.cursor/mcp.json, depending on how your team uses Cursor.</p><p><strong>Why include Oracle AI Database if MCP already works?</strong></p><p>MCP handles the execution boundary. Oracle AI Database handles durable memory, retrieval, vector search, concurrency, observability, and governance.</p><p><strong>Do I need an OpenAI API key?</strong></p><p>An external model-provider API key is only needed if you change the notebook to use a provider-backed embedding or LLM service. The default notebook path uses a local deterministic embedder so people can run the Agent Memory package section without adding billing details.</p><p><strong>Why include LangChain if Oracle already stores memory?</strong></p><p>Because many teams already use LangChain-shaped retrievers and chains. The notebook shows how Oracle-backed retrieval can fit that interface.</p><p><strong>Is this RAG vs agent memory?</strong></p><p>Not exactly. RAG retrieves external knowledge for a response, while agent memory preserves useful context, decisions, tool traces, and workflow state across sessions. In practice, production systems often use both.</p><p><strong>What is the minimum viable setup?</strong></p><p>SQLcl MCP configured in Cursor CLI, one safe saved Oracle connection, and a read-only validation flow.</p><p><strong>Should production start with read-write permissions?</strong></p><p>Usually no. Start read-only, log everything important, and add write scopes gradually with explicit approvals.</p><p><strong>What is the best rollout strategy?</strong></p><p>Pilot in development with read-only access and strong logging, then expand capabilities in controlled phases as the team learns which memory and tool paths are actually useful.</p><h3>Companion Troubleshooting Appendix</h3><p><strong>Minimum viable setup:</strong> SQLcl MCP configured in Cursor CLI, one approved Oracle connection, read-only validation, and database-side activity logging.</p><p><strong>First checks: </strong>confirm sql -mcp starts, Cursor sees the tools after restart, and the saved SQLcl connection alias resolves.</p><p><strong>Environment model:</strong> use separate credentials and policies for dev, test, and prod, with stricter controls as capability expands.</p><p><strong>Logging model:</strong> capture tool name, timestamp, thread ID, status, sanitized input/output summaries, and relevant SQLcl MCP log records.</p><p><strong>Retrieval quality:</strong> tune chunk size, enrich metadata, review embedding choice, and evaluate retrieval against representative queries.</p><p><strong>Common anti-pattern:</strong> expanding tool surfaces before ownership, logging standards, and runbooks are in place.</p><p><strong>Rollout path: </strong>pilot in dev with read-only access and strong logging, then expand capabilities in controlled phases.</p><p><strong>Schema:</strong> Agent Memory package tables need a schema and tablespace that can create the package’s JSON-backed objects.</p><p><strong>Scheduler job: </strong>package-managed expiry purge needs scheduler-job privilege or managed setup for production.</p><p><strong>Model calls:</strong> an API key can be present but still fail if the model provider account has no quota.</p><h3>Resources</h3><ul><li><a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.6/guide/get-started.html">Oracle AI Agent Memory documentation</a></li><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/">Oracle AI Database 26ai documentation</a></li><li><a href="https://pypi.org/project/oracleagentmemory/">oracleagentmemory on PyPI</a></li><li><a href="https://docs.oracle.com/en/database/oracle/sql-developer-command-line/25.2/sqcug/sqlcl-mcp-server.html">SQLcl MCP Server</a></li><li><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/cursor_mcp_oracle_ai_database.ipynb">End-to-end Companion notebook</a></li></ul><h3>What should I validate before allowing more tools?</h3><p>Start with a read-only task using an approved connection. Verify the active identity, accessible objects, returned result, and available audit evidence. Treat the notebook’s simulated data as teaching fixtures, not observed production telemetry. Expand permissions only when the additional action has an explicit approval and validation path.</p><p><strong>Continue the implementation:</strong> <a href="https://blogs.oracle.com/developers/controlled-oracle-actions-with-sqlcl-mcp">Controlled Oracle Actions with SQLcl MCP</a>. Use the validation described above as the acceptance check for your next step.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ab971c4717e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/oracledevs/build-a-controlled-cursor-mcp-workflow-with-oracle-ai-database-0ab971c4717e">Build a Controlled Cursor MCP Workflow with Oracle AI Database</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>
        <item>
            <title><![CDATA[How to Build a Controlled MCP Workflow for Codex and Oracle AI Database]]></title>
            <link>https://medium.com/oracledevs/how-to-build-a-controlled-mcp-workflow-for-codex-and-oracle-ai-database-6ea4c55a0f86?source=rss-33455f8a7b66------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ea4c55a0f86</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[openai-codex]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Srinidhi Sathyamurthy]]></dc:creator>
            <pubDate>Wed, 12 Aug 2026 15:24:46 GMT</pubDate>
            <atom:updated>2026-11-10T14:52:35.270Z</atom:updated>
            <content:encoded><![CDATA[<h4>A controlled Codex MCP workflow connects an assistant to Oracle AI Database through approved tools and credentials. Treat database access, persistent memory, and the assistant’s working context as separate responsibilities with separate validation checks.</h4><p><strong>Connect Codex CLI to Oracle AI Database through SQLcl MCP, then Add Oracle AI agent memory and LangChain Retrieval.</strong></p><p><strong>Companion notebook:</strong> <a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/codex_mcp_oracle_ai_database_memory_langchain.ipynb">Codex MCP Oracle AI Database</a></p><figure><img alt="How to Build a Controlled MCP Workflow for Codex and Oracle AI Database" src="https://cdn-images-1.medium.com/max/1024/1*uBz2wEkkh7G7qeTdbM8Y_g.png" /></figure><h3>Key Takeaways</h3><ul><li><a href="https://modelcontextprotocol.io/docs/getting-started/intro">MCP</a> turns AI-to-database access into an explicit tool contract instead of implicit system access.</li><li><a href="https://docs.oracle.com/en/database/oracle/sql-developer-command-line/25.4/sqcug/using-oracle-sqlcl-mcp-server.html">Oracle SQLcl in MCP</a> mode (sql -mcp) is a direct, documented way to connect Codex CLI to Oracle AI Database through an MCP server.</li><li>Oracle AI Database provides the persistent storage and vector search layer for memory workloads, while <a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.4/agmea/get-started.html">Oracle AI Agent Memory</a> gives teams a Python API for threads, durable memory records, scoped retrieval, and context assembly on top of it.</li><li><a href="https://docs.langchain.com/oss/python/integrations/vectorstores/oracle">LangChain</a> can provide application-side wrappers and orchestration after the Oracle-backed memory and retrieval path is in place.</li><li>A strong default is hybrid: Codex CLI plus MCP for interactive database work, Oracle AI Database plus Oracle AI Agent Memory for durable memory, and LangChain only when the application needs reusable retrieval orchestration.</li></ul><p>Here is how those components connect in this pattern. Codex works with Oracle through SQLcl MCP’s explicit tools. The saved SQLcl profile, database user, grants, and database policies remain the enforcement boundary. Oracle AI Agent Memory is the Python package your application uses to manage memory records on Oracle AI Database. LangChain is optional application-side orchestration after the database-backed memory and evidence path is in place; it is not the permission boundary or source of truth.</p><p>Production success depends less on clever prompting and more on boundaries, privileges, logging, scoped retrieval, and repeatable runbooks.</p><p>This guide is for developers who want Codex CLI to work with Oracle AI Database through explicit tools, durable memory, and reviewable retrieval evidence. It also shows an AI agent memory architecture where Codex handles the developer interaction, SQLcl MCP provides the tool boundary for database access; the saved SQLcl profile and database user permissions determine what Codex can actually do, and Oracle AI Database stores durable memory and retrieval evidence.</p><p><strong>The developer path through this guide is simple:</strong></p><ul><li>Start with one approved Oracle connection and a read-only validation query.</li><li>Put SQLcl MCP in front of that connection so Codex sees tools, not raw database credentials.</li><li>Check the audit and activity trail before adding more tool access.</li><li>Add Oracle AI Agent Memory when the workflow needs durable thread context, scoped recall, or reusable context cards.</li><li>Add LangChain only when you need application-side retrieval orchestration beyond the MCP interaction loop.</li></ul><figure><img alt="Architecture diagram showing a human operator using Codex CLI through a controlled SQLcl MCP tool path to Oracle AI Database and Oracle AI Agent Memory. Agent Memory connects to memory tables, tool logs, and vector retrieval. A separate LangChain retrieval path queries the database and returns grounded context to Codex CLI, forming the memory and retrieval loop." src="https://cdn-images-1.medium.com/max/1024/1*pa_apIYw4NUJMVeruqvXNA.png" /><figcaption>Controlled Codex MCP + Oracle AI Database Workflow</figcaption></figure><h3>Why This Architecture Is Useful for Developers</h3><p>Giving an AI assistant database access is easy. But making that access controlled, inspectable, and repeatable is the hard part.</p><p>Codex is useful because it sits close to the developer’s actual work: files, commands, notebooks, configuration, and implementation details. That closeness becomes more sensitive when the workflow touches a database.</p><p>The question is not whether Codex can produce SQL-shaped text. The question is whether the database path is approved, observable, and easy to debug later. A useful workflow needs to preserve the request, the tool call, the database identity, the retrieved context, and the reason a risky action was allowed or blocked.</p><p>By the end of this guide, you should know how to connect Codex CLI to Oracle AI Database through a controlled MCP boundary, when Codex context is enough and when Oracle-backed memory is needed, and how to build a retrieval path that can be queried, audited, and scaled.</p><p>The workflow has five layers. Codex CLI is the developer-facing agent interface. SQLcl MCP is the tool boundary. Oracle AI Database is the durable substrate for memory, traces, and retrieval. The notebook is the build-and-validation harness that proves the pieces are wired correctly before the workflow is handed to Codex.</p><p>That separation matters. Codex does not need raw credentials in its prompt. SQLcl MCP can be configured once using the saved alias. Oracle AI Database owns persistence and retrieval. The notebook shows the setup in a way that can be rerun, inspected, and debugged.</p><p>A simple way to divide the responsibilities:</p><figure><img alt="Table listing five layers: Codex CLI is the developer-facing agent interface; SQLcl MCP exposes Oracle tools to Codex; Oracle AI Database stores data, vectors, metadata, traces, and privileges; Oracle AI Agent Memory provides APIs and scoped retrieval; LangChain wraps retrieval results as Document objects." src="https://cdn-images-1.medium.com/max/1024/1*NrRyhFk-Pf856ixv4mLSHQ.png" /><figcaption>Layered architecture diagram mapping Codex CLI, SQLcl MCP, Oracle AI Database, Oracle AI Agent Memory, and LangChain to their responsibilities.</figcaption></figure><h3>The Two Execution Loops</h3><p>Building on the separation of responsibilities above, the system naturally forms two execution loops:</p><ul><li>Loop A is the operational interaction loop: Codex CLI works with MCP to discover tools, inspect data, run bounded read-only queries, and return results immediately.</li><li>Loop B is the durable memory and retrieval loop: application code writes history, tool logs, memory records, chunks, and embeddings to Oracle AI Database, then retrieves context before a later answer or workflow step.</li></ul><figure><img alt="Diagram showing two linked loops. Loop A handles real-time interaction from user through Codex CLI, SQLcl MCP, Oracle AI Database, and answer. Loop B records tool traces into a memory store and Oracle AI Agent Memory, then uses hybrid retrieval to produce grounded context. Retrieved context returns to the agent for later interactions." src="https://cdn-images-1.medium.com/max/1024/1*opGsmAnTMnbR-_TAFXBojg.png" /><figcaption>Dual Execution Loop: MCP Interaction and Durable Memory</figcaption></figure><p>SQLcl MCP is for Codex operating interactively through declared tools. Oracle AI Agent Memory is for application code that stores turns, retrieves history, and assembles context before Codex or another assistant sees a prompt. You can drop either one for a narrower use case, but most production setups need both loops.</p><h3>Reproducing the SQLcl MCP and Codex CLI Workflow</h3><p>The setup should be reproducible. SQLcl runs in MCP mode with sql -mcp. Codex CLI launches it as an MCP server and talks to Oracle through declared tools, not through direct access. Connections come from saved SQLcl profiles that you create and test before Codex uses them.</p><p>Codex does not invent them at runtime; it reuses profiles you have already created and validated.</p><p><strong>Prerequisites before you connect Codex CLI:</strong></p><ul><li>Oracle SQLcl 25.2.0 or higher.</li><li>Oracle JRE 17 or 21.</li><li>Codex CLI or another MCP-capable client you are explicitly configuring and testing.</li><li>At least one saved SQLcl connection profile under <em>~/.dbtools</em>, created with password persistence for MCP use.</li><li>A database user with the minimum permissions required for the workflow. Start with read-only access and a sanitized development or replica environment where possible.</li></ul><p>The notebook deliberately treats the saved SQLcl connection alias as a first-class artifact. In local development, that alias is what lets SQLcl MCP connect without forcing the agent to assemble credentials dynamically.</p><p>The notebook then generates a sanitized Codex MCP config preview. The preview is intentionally safe: it shows the server command and arguments without exposing secrets.</p><p>For the saved connection itself, the important detail is -savepwd. MCP cannot stop and ask a human for the password every time Codex invokes a database tool. The saved alias becomes the repeatable local path Codex can use after you have reviewed it.</p><pre>```toml <br>[mcp_servers.sqlcl]<br>command = &quot;/absolute/path/to/sql&quot;<br>args = [&quot;-mcp&quot;]<br>```</pre><p>That small TOML block defines the connection between Codex and SQLcl MCP Server. Codex interacts with the database through the tools and permissions exposed by the MCP server, using the saved SQLcl connection profile you created and tested first. Save this configuration in ~/.codex/config.toml, restart Codex, then run codex mcp list to confirm that the SQLcl MCP server and its tools are discoverable.</p><p><strong>Validation checklist before expanding access</strong></p><ul><li>Run <em>sql -mcp</em> locally and confirm the server starts.</li><li>Restart Codex CLI and confirm the SQLcl tools are discoverable.</li><li>Run one read-only query against an approved schema.</li><li>Check database-side MCP activity logs and session metadata.</li><li>Document the connection alias, database user, grant scope, restrict level, and troubleshooting owner.</li></ul><p><strong>Good first proof looks like this:</strong></p><ul><li>The MCP server starts without a Java or path error.</li><li>Codex lists the SQLcl MCP tools after restart.</li><li>A read-only query succeeds against the expected schema.</li><li>The notebook audit trail records the expected tool interaction in codex_tool_logs.</li><li>For live Codex CLI + SQLcl MCP validation, confirm the database/session activity through your normal Oracle monitoring path.</li><li>A denied query fails because of the database role, not because a prompt asked nicely.</li></ul><p>A useful MCP boundary is more than tool discovery. It is an operating contract. The notebook models that contract with risk levels, read-only defaults, confirmation requirements, scope checks, and controlled failure examples. Denied and warning states are useful because they prove the workflow can say no.</p><ul><li>Read-only default: start with inspection and diagnostics before allowing changes.</li><li>Confirmation gate: require explicit approval for medium-risk, write-like, or destructive actions.</li><li>Scope control: keep user, tenant, and schema filters close to the database query.</li><li>Failure trace: store denied calls and warnings as evidence instead of hiding them.</li></ul><h3>Why put application memory records in Oracle AI Database, not just outputs</h3><p>Once the first MCP tool calls work, the next challenge is continuity. This is where long-term memory for AI agents becomes different from short-lived chat context.</p><p>If memory lives only in chat context, the system is fragile. If memory is scattered across files without structure, retrieval and auditing become expensive over time.</p><p>A database-backed memory model is usually cleaner and more scalable. The companion notebook builds this memory layer from scratch so the mechanics are visible, then shows how Oracle AI Agent Memory sits on top of it once the substrate is working.</p><p><strong>Memory Categories That Matter in Practice:</strong></p><p>You do not need to start by memorizing table names or column names. The useful idea is simpler: different kinds of memory serve different jobs.</p><ul><li>Conversation memory: Keeps the important user and assistant turns that future sessions may need.</li><li>Operational memory: Keeps tool calls, outcomes, warnings, and failures so a team can debug what happened.</li><li>Semantic memory: Adds embeddings so the system can find relevant context even when the user asks in different words.</li></ul><p>In practice, hybrid retrieval for agent memory usually combines exact operational terms, such as sql -mcp or codex_mcp, with semantic search over memory records.</p><p>The notebook shows the lower-level mechanics first so the storage and retrieval path is visible. This is also a context engineering problem: the application has to decide which memories, tool traces, and retrieval results should be assembled before Codex or another assistant answers. Oracle AI Agent Memory then gives application code a cleaner package API over that same database-backed idea.</p><h3>Where Oracle AI Agent Memory Fits</h3><p>Oracle AI Agent Memory sits between your application code and Oracle AI Database. The package manages conversation threads, durable memory records, scoped retrieval, and context assembly. Oracle AI Database remains the storage and enforcement layer underneath; the package does not replace that, it makes working with it faster and more consistent.</p><p>The notebook includes an abbreviated package-backed memory pattern. It initializes OracleAgentMemory with a database connection pool and a custom local deterministic embedder. LocalCodexEmbedder is notebook code, not a built-in Oracle AI Agent Memory embedder.</p><p>The local embedder is intentionally billing-free, which makes the notebook runnable for people who do not want to attach paid model usage to a tutorial.</p><p>Abbreviated setup pattern: define CONFIG, import and initialize oracledb, implement LocalCodexEmbedder, and set stable values for AGENT_MEMORY_USER_ID and AGENT_MEMORY_AGENT_ID before running this example.</p><pre>```python <br>from oracleagentmemory.core.oracleagentmemory import OracleAgentMemory <br>from oracleagentmemory.apis.searchscope import SearchScope <br> <br>db_pool = oracledb.SessionPool( <br>    user=CONFIG[&quot;ORACLE_USER&quot;], <br>    password=CONFIG[&quot;ORACLE_PASSWORD&quot;], <br>    dsn=CONFIG[&quot;ORACLE_DSN&quot;], <br>    min=1, <br>    max=4, <br>    increment=1, <br>) <br> <br>agent_memory = OracleAgentMemory( <br>    connection=db_pool, <br>    embedder=LocalCodexEmbedder(dimensions=32), <br>    llm=None, <br>    extract_memories=False, <br>    schema_policy=&quot;create_if_necessary&quot;, <br>) <br>```</pre><p>Use oracleagentmemory from your application layer when you need package-managed users, agents, memories, threads, scoped retrieval, and context assembly. Keep systems of record separate from memory records: memory helps provide context, but application logic and authoritative data sources should still decide what is true, allowed, and final.</p><p>Implementation note: Use a schema whose default tablespace supports the JSON objects created by Agent Memory. If a local SYSTEM schema sits on a tablespace that rejects JSON object creation, the better production answer is a dedicated application schema. The notebook can still explain the issue clearly instead of hiding it.</p><h3>Store and Search: What a Realistic Memory Looks Like</h3><p>A realistic Codex memory is not generic trivia about a user. For this workflow, memory should capture how a developer actually works: the connection name they used, the SQLcl path that succeeded, the MCP config location, the failed privilege boundary, the retrieval query that helped, and the final fix that should be reused later.</p><pre>```python <br>thread = agent_memory.create_thread(<br>    user_id=AGENT_MEMORY_USER_ID,<br>    agent_id=AGENT_MEMORY_AGENT_ID,<br>)<br> <br>thread.add_memory( <br>    &quot;Developer validated Codex CLI with SQLcl MCP alias codex_mcp &quot; <br>    &quot;against local Oracle AI Database service FREEPDB1.&quot; <br>) <br> <br>results = agent_memory.search(<br>    query=&quot;Codex SQLcl MCP alias validation and Agent Memory setup&quot;, <br>    scope=SearchScope(user_id=AGENT_MEMORY_USER_ID), <br>) <br>```</pre><p>That kind of memory pays off because it is operational. It can help Codex answer the next question with context from the previous debugging session, but it is still scoped and retrievable through a database-backed API.</p><h3>Where LangChain Adds Value</h3><p>LangChain should not be treated as the source of truth. Codex CLI does not call LangChain directly in this architecture.</p><p>LangChain runs in your application layer, where it can format context, wrap retrieval behavior, expose a familiar retriever shape, and plug Oracle-backed memory into chains or agents that already expect LangChain interfaces. In this notebook, LangChain is used as a compatibility layer: the notebook’s custom Oracle-backed hybrid_search() path performs hybrid retrieval, and its results are wrapped as LangChain Document objects so they can flow into applications that already expect LangChain interfaces.</p><ul><li>Use Oracle AI Database for persistence, retrieval, tenancy, validation evidence, and tool traces.</li><li>Use Oracle AI Agent Memory for package-backed memory threads, durable memories, and scoped search.</li><li>Use LangChain for retriever wrappers and orchestration compatibility when the application already expects that shape.</li><li>Use Codex CLI for developer interaction, planning, and guided execution.</li></ul><p>The notebook’s LangChain section is valuable because it comes late. By the time it appears, the database tables, package memory, retrieval scores, and validation snapshot already exist. LangChain becomes a wrapper around evidence, not a substitute for evidence.</p><p>Do not add LangChain just to make the workflow sound more agentic. If the application only needs direct SQL, package-backed Agent Memory search, or a simple evidence table, the extra abstraction can make debugging harder. LangChain is a good fit when the consuming application already expects retrievers, documents, chains, or tool orchestration. It is not the permission boundary, the memory store, or the audit layer.</p><h3>Engineering Guidance</h3><p>The difference between demo success and production success is disciplined operations. Most failures at this stage come from integration gaps, not model behavior. A local notebook can prove the wiring. A production workflow needs smaller database roles, managed secrets, clear MCP approval policy, repeatable environment setup, and monitoring around memory writes and tool calls.</p><p><strong>Access and privilege model</strong></p><ul><li>Use a dedicated application schema where possible, then tighten grants with least-privilege roles and quotas.</li><li>Keep saved SQLcl aliases separate by role and environment instead of sharing one broad connection.</li><li>Start read-only wherever possible and gate write operations with explicit confirmation workflows.</li><li>Use schema allowlists and separate accounts for development, test, and production.</li></ul><p><strong>Observability model</strong></p><ul><li>Log tool name, thread ID, timestamp, status, and sanitized inputs and outputs.</li><li>Classify failures into runtime, discovery, connection, permission, query, and retrieval categories.</li><li>Keep a troubleshooting playbook in the repo so setup issues do not become tribal knowledge.</li><li>Check whether retrieval quality changes as more data and memory records are added.</li></ul><p><strong>Reliability model</strong></p><ul><li>Prefer deterministic SQL patterns with bounded result sets.</li><li>Use retrieval-first context assembly for memory-heavy tasks.</li><li>Avoid giant context stuffing as a substitute for memory design.</li><li>Review and prune tool surfaces periodically.</li><li>Move from the local deterministic embedder to a supported embedding model after cost, latency, and privacy review.</li></ul><h3>Typical Failure Modes</h3><p>Most teams hit a predictable set of issues.</p><p><strong>Runtime failure: sql -mcp does not start</strong></p><p>Check the absolute SQLcl path, confirm Java is available, and run sql -mcp outside Codex first. Resolve runtime issues before checking assistant behavior.</p><p><strong>Discovery failure: Codex does not see tools</strong></p><p>Check the Codex MCP configuration, confirm the configured command points to the SQLcl executable, and restart or reload Codex CLI after edits.</p><p><strong>Connection failure: tools are present but queries fail immediately</strong></p><p>Check the saved SQLcl connection alias, confirm the profile lives under the expected SQLcl connection store, and verify password persistence for the MCP workflow. Then test the same connection outside Codex.</p><p><strong>Permission failure: queries execute selectively and fail on specific objects</strong></p><p>Check the database role first. A selective failure can be the right outcome when least privilege is working. Add grants intentionally and keep read-write access separate from the initial validation path.</p><p><strong>Retrieval quality failure: answers are fluent but weakly grounded</strong></p><p>Inspect the retrieved records before blaming the model. Check chunk size, metadata filters, embedding choice, top-k settings, and whether the query is asking for exact history, semantic similarity, or operational logs.</p><h3>Why the Hybrid Model Is Usually the Best Long-Term Design</h3><p>No single layer handles both execution and memory well. Trying to force everything into Codex context gets messy fast: you either lose control over execution, or you stuff too much state into prompts just to keep things working. On the other side, if you only build backend memory systems, you lose the speed and usability that makes an assistant useful during development.</p><p>The hybrid approach works because it does not try to solve everything in one place. Execution stays controlled through MCP. Memory stays durable and queryable in Oracle AI Database. Oracle AI Agent Memory gives application code a cleaner memory API. LangChain adds orchestration only after evidence exists.</p><p>In real teams this usually evolves over time. Start with Codex CLI, SQLcl MCP, read-only access, and strong logging. Once people rely on the workflow, the gaps become visible: lost context, weak traceability, repeated setup work, or retrieval that is hard to explain. That is when database-backed memory and structured retrieval become worth adding.</p><h3>Conclusion</h3><p>A Codex and SQLcl MCP workflow becomes useful when it is treated as an engineering pattern, not just a setup trick. Codex keeps the developer moving. MCP makes tool access explicit. SQLcl connects those tools to reviewed Oracle profiles. Oracle AI Database stores durable memory records, traces, and retrieval evidence. Oracle AI Agent Memory gives applications a practical memory API. LangChain helps when retrieval needs to become reusable orchestration.</p><p>The result is a workflow a team can inspect. You can see what Codex asked for, which tool path ran, what the database allowed, which memory records were retrieved, and how the final answer was assembled.</p><p>That is the shift that matters: from assistant access that is implicit and hard to audit, to explicit boundaries, durable memory, and evidence a developer can actually debug.</p><h3>Frequently Asked Questions</h3><p><strong>What is MCP in this context?</strong></p><p>MCP is the protocol boundary that lets Codex call explicit tools exposed by a server instead of accessing systems implicitly.</p><p><strong>What does MCP protect, and what does it not protect?</strong></p><p>MCP makes the tool interface explicit and reviewable: Codex can call only the tools exposed by the server. It does not replace database security. The saved SQLcl connection profile, database user, grants, roles, network controls, and database policies determine what those tools can actually access or change.</p><p><strong>Why use SQLcl for Oracle MCP?</strong></p><p>SQLcl already understands Oracle workflows and can run as the Oracle SQLcl MCP server with sql –mcp, making the Oracle integration practical and direct.</p><p><strong>Is this Codex CLI or Codex app?</strong></p><p>The workflow should be described as Codex CLI/TUI oriented because the MCP configuration is written as a local Codex config preview and the SQLcl MCP server is launched as a command.</p><p><strong>Why include Oracle AI Database if MCP already works?</strong></p><p>MCP handles the execution boundary. Oracle AI Database handles durable memory, retrieval, vector search, concurrency, observability, and governance.</p><p><strong>Do I need an OpenAI API key?</strong></p><p>Only if you switch the demo to OpenAI-backed embeddings or LLM calls. The practical notebook path can use a local deterministic embedder so people can run the Agent Memory package section without adding billing details.</p><p><strong>Why use SQLcl MCP instead of connecting directly from Codex?</strong></p><p>MCP gives the workflow a defined tool boundary. Direct connections can be useful in notebooks, but Codex should call tools through a contract that can be logged, scoped, and reviewed.</p><p><strong>Why include LangChain if Oracle already stores memory?</strong></p><p>Because many teams already have LangChain-shaped retrievers and chains. The notebook shows how to expose Oracle-backed retrieval through that shape while keeping memory and enforcement in the database.</p><p><strong>Is this RAG vs agent memory?</strong></p><p>Not exactly. RAG retrieves external knowledge for a response, while agent memory preserves useful context, decisions, tool traces, and workflow state across sessions. In practice, production systems often use both.</p><p><strong>What is the minimum viable setup?</strong></p><p>SQLcl MCP configured in Codex CLI, one safe saved Oracle connection, and a read-only validation flow.</p><p><strong>Should production start with read-write permissions?</strong></p><p>Usually no. Start read-only, log everything important, and add write scopes gradually with explicit approvals.</p><p><strong>What is the best rollout strategy?</strong></p><p>Pilot in development with read-only access and strong logging, then expand capabilities in controlled phases as the team learns which memory and tool paths are actually useful.</p><h3>Companion Troubleshooting Appendix</h3><p><strong>Minimum viable setup:</strong> SQLcl MCP configured in Codex CLI, one approved Oracle connection, read-only validation, and database-side activity logging.</p><p><strong>First checks:</strong> confirm <em>sql -mcp</em> starts, Codex sees the tools after restart, and the saved SQLcl connection alias resolves.</p><p><strong>Environment model:</strong> use separate credentials and policies for dev, test, and prod, with stricter controls as capability expands.</p><p><strong>Logging model:</strong> capture tool name, timestamp, thread ID, status, sanitized input/output summaries, and relevant SQLcl MCP log records.</p><p><strong>Retrieval quality:</strong> tune chunk size, enrich metadata, review embedding choice, and evaluate retrieval against representative queries.</p><p><strong>Common anti-pattern:</strong> expanding tool surfaces before ownership, logging standards, and runbooks are in place.</p><p><strong>Rollout path:</strong> pilot in dev with read-only access and strong logging, then expand capabilities in controlled phases.</p><p><strong>Schema</strong>: Agent Memory package tables need a schema and tablespace that can create the package’s JSON-backed objects.</p><p><strong>Model calls</strong>: an API key can be present but still fail if the model provider account has no quota.</p><h3>Resources</h3><ul><li><a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.4/">Oracle AI Agent Memory documentation</a></li><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/">Oracle Database 26ai documentation</a></li><li><a href="https://pypi.org/project/oracleagentmemory/">oracleagentmemory on PyPI</a></li><li><a href="https://docs.oracle.com/en/database/oracle/sql-developer-command-line/25.2/sqcug/sqlcl-mcp-server.html">SQLcl MCP Server</a></li><li><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/codex_mcp_oracle_ai_database_memory_langchain.ipynb">End-to-end support notebook</a></li></ul><h3><strong>What should a successful first run show?</strong></h3><p>Complete a bounded read-only task and verify its result independently. Then test that an out-of-scope request is rejected and that no credential is copied into the chat. If memory is added, validate it in a second session rather than assuming the MCP connection itself provides persistence.</p><p><strong>Continue the implementation:</strong> <a href="https://blogs.oracle.com/developers/the-trust-layer-for-enterprise-ai-on-oracle-prove-identity-scope-policy-and-evidence-for-every-assistant-action">The trust layer for enterprise AI on Oracle: prove identity, scope, policy, and evidence for every assistant action</a>. Use the validation described above as the acceptance check for your next step.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ea4c55a0f86" width="1" height="1" alt=""><hr><p><a href="https://medium.com/oracledevs/how-to-build-a-controlled-mcp-workflow-for-codex-and-oracle-ai-database-6ea4c55a0f86">How to Build a Controlled MCP Workflow for Codex and Oracle AI Database</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>
        <item>
            <title><![CDATA[Hybrid Search for Oracle AI Agent Memory: Combining Semantic Recall with Exact Match]]></title>
            <link>https://medium.com/oracledevs/hybrid-search-for-oracle-ai-agent-memory-combining-semantic-recall-with-exact-match-6d3f45404401?source=rss-33455f8a7b66------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d3f45404401</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent-memory]]></category>
            <category><![CDATA[oracle-ai-database]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Srinidhi Sathyamurthy]]></dc:creator>
            <pubDate>Tue, 11 Aug 2026 11:40:13 GMT</pubDate>
            <atom:updated>2026-11-11T17:59:23.324Z</atom:updated>
            <content:encoded><![CDATA[<h4>Hybrid retrieval for agent memory combines semantic candidates, lexical matches, and explicit scope before assembling context. Fusion and reranking are useful only when they improve a labeled workload without admitting stale or unauthorized memory.</h4><h4><strong>Use Oracle AI Agent Memory hybrid search when persistent AI agent memory needs both semantic similarity and exact text precision.</strong></h4><p><strong>Companion Notebook:</strong> <a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/agent_memory/hybrid_search_agent_memory.ipynb">Hybrid Search for Oracle AI Agent Memory: Combining Semantic Recall with Exact Match</a></p><figure><img alt="Hybrid Search for Oracle AI Agent Memory: Combining Semantic Recall with Exact Match" src="https://cdn-images-1.medium.com/max/1024/1*C0XralYbnBE43sUocMGDwQ.png" /></figure><h3>Key Takeaways</h3><ul><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/vecse/overview-ai-vector-search.html">Vector search</a> is strong for semantic recall, but agent memory often contains exact strings that should remain first-class retrieval signals.</li><li>Hybrid search combines semantic retrieval and exact text matching so agents can recall both the named item and the surrounding context.</li><li>Scoped retrieval and hybrid search solve different parts of the problem: scope controls which memories are eligible to be searched, while hybrid search controls how those eligible memories are ranked.</li><li><a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.4/agmea/get-started.html">Oracle AI Agent Memory</a> uses `SearchStrategy.HYBRID` with `OracleDBEmbedder`, while `SearchIndexSyncMode` controls managed search-index refresh behavior.</li><li>The companion notebook validates hybrid retrieval across five exact, semantic, and mixed-query scenarios using deliberately similar memories and confirms the expected memory at rank one in every scenario.</li></ul><p>This guide shows how to build hybrid retrieval for agent memory with Oracle AI Agent Memory, combining semantic recall with exact text matching.</p><h3>The retrieval problem hybrid search solves</h3><p>A useful agent memory system has to do two things at once. It must remember by meaning when the user paraphrases, and it must stay exact when the user refers to a specific business object, system event, or operational handle. Many retrieval misses happen in the gap between those two needs: the query is semantically close to several memories, but only one memory contains the exact identifier that should anchor the answer. <br> <br>Hybrid search closes that gap. Instead of treating semantic recall and exact text matching as separate retrieval systems, it gives the memory layer a combined path for vector and keyword search. The agent can retrieve the surrounding context and preserve the literal token that makes the memory trustworthy.</p><p>That is the core value of agent memory hybrid search: long-term agent memory can stay flexible without losing the exact text that enterprise workflows depend on.</p><p>This article starts with a simple retrieval problem: a user may ask about a business event in natural language, then later refer to the same event by an invoice number, issue ID, error code, customer alias, or filename. A useful memory system should handle both query styles.</p><h3>Setting up Oracle AI Agent Memory</h3><p><a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.4/agmea/">Oracle AI Agent Memory</a> provides a durable memory layer for AI agents. It stores scoped memories, retrieves relevant context for later turns, and helps applications separate what the agent is allowed to remember from how memories are ranked.</p><p>Hybrid search expands that retrieval model so an agent can recall by semantic meaning and by exact text in the same workflow, while memory governance remains tied to scope and application policy. <br> <br>The setup has four main components:</p><ul><li>`OracleAgentMemory` is the durable memory layer. It stores memories, applies scope, and exposes search.</li><li>`OracleDBEmbedder` connects retrieval to Oracle-backed embedding behavior used by the memory store.</li><li>`SearchStrategy.HYBRID` tells the memory layer to combine semantic and exact-text retrieval signals.</li><li>`SearchIndexSyncMode` controls when the managed search index is refreshed after memories are written.</li></ul><p>Start by installing the oracleagentmemory package in the notebook or application environment. The hybrid-search API is configured in application code; the database schema and index setup are handled through the Oracle-backed memory store.</p><p>This makes Oracle AI Database agent memory a practical pattern for applications that need durable memories, scoped retrieval, and database-managed search.</p><pre>```bash <br>pip install oracleagentmemory==26.6.0 <br>```</pre><p>The core imports for a hybrid-search configuration look like this:</p><pre>```python <br>from oracleagentmemory.apis.searchscope import SearchScope <br>from oracleagentmemory.core import ( <br>    MemoryExtractionConfig, <br>    OracleAgentMemory, <br>    SchemaPolicy, <br>    SearchIndexSyncMode, <br>    SearchStrategy, <br>) <br>from oracleagentmemory.core.embedders import OracleDBEmbedder <br>```</pre><h3>Why vector memory is not always enough</h3><p>Agent memory is not only a semantic archive of previous conversations. In enterprise systems, memory records often include short strings that carry operational meaning.</p><p>A single identifier can point to the correct incident, invoice, customer, model, file, run, or database error. If retrieval treats that identifier like ordinary prose, the agent can return a memory that is semantically related but operationally wrong.</p><p>Vector search helps when users paraphrase. It is especially useful when a user asks about a topic without repeating the exact words stored in memory.</p><p>But vector similarity is not the same as exactness. A short token can be diluted by the rest of the sentence, especially when the surrounding context is broad or when several memories are about similar workflows.</p><h3>Where exact text matters</h3><p>Exact text matters whenever a memory must point to a specific object rather than a general topic. Common examples include:</p><ul><li>Issue IDs and ticket references used in engineering and support workflows.</li><li>Invoice, order, contract, and purchase-order numbers used in business workflows.</li><li>Database, application, and integration error codes used in troubleshooting.</li><li>Customer aliases, account IDs, and tenant names used for scoped recall.</li><li>Product SKUs, model numbers, filenames, branch names, and run IDs used by operational agents.</li></ul><p>These values are small, but they often carry more authority than nearby prose. A robust agent memory layer should preserve that literal signal while still supporting semantic lookup and exact-match retrieval.</p><h3>Types of search</h3><figure><img alt="Table comparing vector, keyword, and hybrid search. Vector search finds meaning and paraphrases, such as “What blocked the renewal?” Keyword search finds exact text and identifiers, such as “INV-48291.” Hybrid search combines semantic and exact-text signals in one ranked retrieval path, supporting both types of query." src="https://cdn-images-1.medium.com/max/1024/1*Pej6-ii4i-frVVWPOxRRnw.png" /><figcaption>Table 1: Conceptual search-mode comparison</figcaption></figure><p>The differences become clearer when you compare what each mode optimizes for.</p><p>The following comparison explains the retrieval modes conceptually. The companion notebook executes the hybrid configuration and evaluates it across exact, semantic, and mixed queries; it is not a benchmark of three separately executed strategies.</p><figure><img alt="Table comparing search modes by strengths, weaknesses, and agent-memory fit. Vector search excels at paraphrase and concept recall but may miss short identifiers. Keyword search handles exact identifiers well but is brittle when wording changes. Hybrid search combines natural-language and exact-text retrieval, making it a strong fit when both signals matter." src="https://cdn-images-1.medium.com/max/1024/1*JqCY-4M4XT1jyRY7eqmYwg.png" /><figcaption>Table 2: Search mode comparison</figcaption></figure><p>Use hybrid search when:</p><ul><li>Users ask in natural language but refer to exact business objects.</li><li>Memories include identifiers, aliases, filenames, error codes, or transaction IDs.</li><li>Several memories are semantically similar, but one exact token should decide the result.</li><li>The agent needs scoped retrieval across user, agent, tenant, or thread boundaries.</li></ul><h3>How Oracle AI Agent Memory supports hybrid retrieval for agent memory</h3><p>Oracle AI Agent Memory exposes hybrid retrieval as a memory-store configuration. The application supplies an Oracle-backed embedder, selects `SearchStrategy.HYBRID`, and chooses an index synchronization mode. The result is one memory layer that can retrieve by meaning and exact text over the same stored memories, while still respecting user, agent, and thread scope. <br> <br>`OracleDBEmbedder` is important because hybrid search relies on the database-managed embedding and index path. `SearchStrategy.HYBRID` selects the hybrid retrieval backend. `SearchIndexSyncMode` defines when new or updated memory content becomes searchable through the managed index. Together, these settings make retrieval behavior explicit in application code rather than hiding it behind an ad hoc query pipeline.</p><p>The configuration below shows the minimum pattern: choose an Oracle-backed embedder, set `SearchStrategy.HYBRID`, and choose how the search index should refresh:</p><pre>```python <br>db_embedder = OracleDBEmbedder( <br>    connection=connection, <br>    model=CONFIG[&quot;ORACLE_DB_EMBEDDING_MODEL&quot;], <br>    embedding_dimension=CONFIG[&quot;ORACLE_DB_EMBEDDING_DIMENSION&quot;], <br>) <br>memory = OracleAgentMemory( <br>    connection=connection, <br>    embedder=db_embedder, <br>    memory_extraction_config=MemoryExtractionConfig( <br>        extract_memories=False <br>    ), <br>    schema_policy=SchemaPolicy.CREATE_IF_NECESSARY, <br>    search_strategy=SearchStrategy.HYBRID, <br>    search_index_sync=SearchIndexSyncMode.ON_COMMIT, <br>    memory_store_id=&quot;hybrid_blog&quot;, <br>) <br>```</pre><p>Memory extraction is disabled because the example inserts controlled durable memories directly and focuses specifically on retrieval behavior.</p><p>In a typical workflow, the agent writes durable memories with user, agent, or thread scope. Later, search requests use `SearchScope` to restrict eligible records before ranking happens. That separation matters: scope decides what the agent is allowed to remember, while hybrid search decides how eligible memories are ranked.</p><h3>Hybrid retrieval flow</h3><p>In an agent workflow, hybrid search is most useful when it sits between memory scoping and context assembly:</p><figure><img alt="Flowchart titled &amp;quot;Scoped Hybrid Retrieval.&amp;quot; A user query passes through a SearchScope filter to select eligible durable memories. Those memories are searched using hybrid retrieval, combining semantic and exact matching. The ranked results are then assembled into the prompt context for the language model. Each stage is connected by downward arrows, showing a linear retrieval pipeline." src="https://cdn-images-1.medium.com/max/656/1*QEkNg7znuremsg_raUy8Fg.png" /><figcaption>Figure 1. Scoped hybrid retrieval flow</figcaption></figure><p>`SearchScope` and hybrid search are complementary. Scope determines which records are eligible for retrieval; hybrid search ranks only those eligible records. In the notebook, each evaluation query uses the same generated finance-user and support-agent scope, and retrieval is restricted to durable memory records by passing `record_types=[“memory”]`.</p><p>This flow is the reason hybrid search fits agent memory well. The application first narrows the memory universe with scope. Hybrid retrieval then combines semantic and exact-text signals only over eligible records. The final output is not just a matching row; it is a ranked context package the agent can use in the next step.</p><pre>```python <br>user_id = &quot;finance_user_123&quot; <br>agent_id = &quot;support_finance_agent&quot; <br>  <br>scope = SearchScope(user_id=user_id, agent_id=agent_id) <br>  <br>memory.add_memory( <br>    content=( <br>        &quot;Northstar Renewals has a renewal blocker: invoice INV-48291 &quot;<br>        &quot;failed reconciliation after ORA-27102 during month-end processing.&quot; <br>    ), <br>    user_id=user_id, <br>    agent_id=agent_id, <br>) <br> <br>async def search_memory(query, scope, max_results=5): <br>    return await memory.search_async( <br>        query=query, <br>        scope=scope, <br>        max_results=max_results, <br>        record_types=[&quot;memory&quot;], <br>    ) <br> <br>exact_results = await search_memory(&quot;INV-48291&quot;, scope) <br> <br>semantic_results = await search_memory( <br>    &quot;What blocked the Northstar renewal?&quot;, <br>    scope, <br>) <br> ```</pre><p>Both calls use the same `SearchScope`, hybrid strategy, and managed hybrid index. Only the query style changes.</p><p>For example, a user might ask “INV-48291” or “What blocked the renewal?” over the same scoped memories.</p><p>A vector-only search may understand the renewal-blocker question but underweight the exact invoice or error code. A keyword-only search may find INV-48291 or ORA-27102 but miss a paraphrased question such as “What blocked the renewal?”</p><p>Hybrid search gives both signals a chance to influence ranking, so the agent can retrieve the Northstar Renewals memory with the exact invoice ID, the ORA-27102 error code, and the natural-language explanation.</p><h3>Testing hybrid retrieval with deliberately similar memories</h3><p>The companion notebook does not test hybrid retrieval against a single obvious memory. It creates a deliberately similar set of memories, so the retrieval path has to choose between records that share overlapping business, invoice, customer, renewal, and error-code vocabulary.</p><p>The notebook stores five durable memories:</p><ul><li>A target renewal-blocker memory for Northstar Renewals, containing invoice INV-48291, Oracle error ORA-27102, and the failed reconciliation that blocked the renewal.</li><li>A neighboring invoice memory for Northstar Renewals, containing invoice INV-48290, which is marked as paid and does not require follow-up.</li><li>A different customer renewal-delay memory for Milan Office Supplies, where the delay is caused by an approval workflow rather than reconciliation.</li><li>A general ORA-27102 troubleshooting memory that explains the database error without tying it to the Northstar invoice.</li><li>A Northstar customer-alias memory that maps Northstar Renewals to its enterprise account name.</li></ul><p>This setup makes the demonstration more realistic. The expected result must outrank memories that are partially similar, such as another Northstar invoice, another renewal delay, or another ORA-27102-related record. That is the behavior an enterprise agent memory system needs: not just finding something related but retrieving the memory that preserves the right operational detail.</p><h3>Evaluating exact, semantic, and mixed queries</h3><p>The notebook then evaluates the same hybrid-search configuration across five query scenarios. Each query uses the same `SearchScope`, the same `SearchStrategy.HYBRID` configuration, and the same managed hybrid index. Only the query wording changes.</p><p>The five query categories are:</p><ul><li>Exact invoice identifier: a query for INV-48291.</li><li>Exact Oracle error code: a query for ORA-27102.</li><li>Semantic renewal-blocker question: a natural-language question about what blocked the Northstar renewal.</li><li>Semantic customer question: a natural-language question about the Milan customer renewal delay.</li><li>Mixed customer and invoice question: a question that combines customer context with invoice reconciliation.</li></ul><p>The validation checks whether the expected memory appears as the top-ranked result.</p><figure><img alt="Evaluation table showing five retrieval tests: exact invoice ID, exact error code, semantic renewal question, semantic customer question, and a mixed customer-and-invoice query. In every case, the expected memory ranked first and validation passed, demonstrating successful retrieval across exact, semantic, and mixed query types." src="https://cdn-images-1.medium.com/max/1024/1*v9NdDdnOJyN2H0mc2gzBng.png" /><figcaption>Table 3: Evaluation results table</figcaption></figure><p>This is a controlled functional evaluation, not a statistical benchmark comparing vector, keyword, and hybrid search. The purpose is to show that one hybrid-search configuration can retrieve the expected durable memory across exact, semantic, and mixed query styles.</p><h3>Reading the notebook results</h3><p>The results show that exact identifiers remained useful retrieval signals. The invoice query returned the renewal-blocker memory, while the ORA-27102 query returned the general error-reference memory. This matters because both the target renewal memory and the general troubleshooting memory contain the same error code, but they serve different user intents.</p><p>The semantic queries also returned the intended memories without requiring the user to repeat the exact stored wording. For example, the renewal-blocker question retrieved the Northstar renewal memory, while the Milan customer question retrieved the separate Milan renewal-delay memory.</p><p>The mixed query is the most representative enterprise case. It combines business context with an implied operational object: the user asks which invoice failed reconciliation for Northstar. The expected result is the memory containing INV-48291, ORA-27102, and the failed reconciliation context.</p><p>The notebook also displays distance values for the ranked results. In this result set, smaller distance values indicate stronger matches. However, distance should be treated as a retrieval signal for inspection, not as a universal accuracy score. The more important validation is whether the expected memory was returned at rank one for each query.</p><h3>How hybrid search improves agent memory retrieval</h3><p>Hybrid search can improve retrieval behavior because it matches how enterprise memory is actually written. A memory record rarely contains only natural-language explanation or only an identifier. It usually contains both: a named handle plus the context that explains why the handle matters.</p><ul><li>Higher precision for identifier-driven questions because exact strings can influence ranking.</li><li>Better recall for paraphrased questions because semantic search still finds related memory records.</li><li>More useful context packages because the agent can retrieve both the handle and the surrounding explanation.</li><li>Lower risk of plausible but wrong recall when several memories are semantically similar.</li><li>Developers can inspect the ranked memories, metadata, and distances to verify whether the expected operational context was retrieved.</li></ul><p>This is especially useful for support agents, finance assistants, operations copilots, developer agents, and workflow agents that must remember prior decisions, tool outputs, system errors, or customer-specific context. <br> <br>The practical benefit is not only better search quality; it is better agent behavior.</p><p>Better retrieval can improve grounding, but the model still needs normal validation and application controls. Hybrid search gives the retrieval layer a stronger chance of selecting the memory that a human operator would have recognized immediately.</p><h3>Production notes: schema and index setup</h3><p>For production, treat hybrid search as part of the memory-store design, not as a last-minute query option. The schema should be owned by a dedicated application user with the right privileges, tablespace quota, and deployment controls. Memory scope should also match the application boundary, such as user, agent, tenant, or thread.</p><p>`SchemaPolicy.CREATE_IF_NECESSARY` is useful during first-time setup or when upgrading a schema so it can support hybrid search. For a large existing memory store, the first hybrid index build may take time because Oracle needs to prepare the managed search structures over stored memory content. Treat that step as a planned migration rather than a normal application startup task.</p><p>After the schema and index are ready, production applications may prefer `SchemaPolicy.REQUIRE_EXISTING`. That lets startup validate the expected schema instead of creating or modifying database objects.</p><p>`SearchIndexSyncMode` is a freshness and operations tradeoff:</p><ul><li>`ON_COMMIT` is best for notebooks, demos, and interactive applications because newly committed memories become searchable immediately.</li><li>`MANUAL` is useful for bulk loads, backfills, and migrations where teams want to ingest many records first and refresh the index on a controlled schedule.</li><li>`AUTO` delegates background maintenance to Oracle-managed behavior, which can fit production workloads where some freshness lag is acceptable. `AUTO` is supported for `SearchStrategy.HYBRID`; keyword-only search does not support `AUTO`.</li></ul><p>The database-resident embedding model is also part of the production contract. The same model and embedding dimension should be used by `OracleDBEmbedder` and the managed hybrid index so query embeddings and indexed memory vectors remain compatible.</p><p>Before publishing an agent that depends on durable memory, test the retrieval path with representative records. Include exact-identifier queries, semantic queries, mixed queries, scoped retrieval checks, and index freshness checks after writes. If the application has many similar records, include distractor memories in the test set so the expected result has to outrank nearby alternatives.</p><p>Teams can also pair hybrid retrieval with custom memory extraction when they need more predictable stored facts. Extraction controls what gets remembered; scope controls which records are eligible; hybrid search controls how eligible memories are ranked.</p><h3>Conclusion</h3><p>AI agent memory needs more than semantic similarity. Vector search helps agents remember by meaning, but enterprise workflows often depend on exact strings such as invoice numbers, error codes, customer aliases, file names, and transaction IDs. Keyword search helps with those strings, but it can be brittle when users ask in natural language.</p><p>Hybrid search gives the memory layer a practical middle ground. It preserves literal identifiers while still supporting semantic recall, so an agent can retrieve both the named object and the context that explains why it matters.</p><p>In the companion notebook, one `SearchStrategy.HYBRID` configuration retrieves the expected durable memory across exact, semantic, and mixed query styles. The deliberately similar memory set makes the demo more realistic: the target memory has to outrank records that overlap on customer, invoice, renewal, or error-code vocabulary.</p><p>For Oracle AI Agent Memory, `SearchStrategy.HYBRID`, `OracleDBEmbedder`, `SearchScope`, and `SearchIndexSyncMode` provide the core application controls for this pattern. Together, they help developers build memory systems that are scoped, durable, searchable by meaning, and precise when exact text matters.</p><p>Run the companion notebook to configure Oracle AI Agent Memory hybrid search, load the deliberately similar memory set, and inspect the ranked results for exact, semantic, and mixed queries.</p><h3>Frequently Asked Questions</h3><p><strong>What is Oracle AI Agent Memory?</strong></p><p>Oracle AI Agent Memory is a durable memory layer for AI agents. It lets applications store memories, retrieve relevant context later, and use scope controls such as user, agent, and thread scope so the agent searches only eligible memories before ranking results.</p><p><strong>Why use hybrid search for agent memory</strong>?</p><p>Hybrid search is useful for agent memory because many memories contain both meaning and exact text. Vector search helps with paraphrased questions, while keyword search helps with identifiers such as issue IDs, SKUs, invoice numbers, aliases, and error codes. Hybrid search combines both signals so the agent can retrieve the right memory and the surrounding context. <br> <br><strong>Is vector search still useful for agent memory?</strong></p><p>Yes. Vector search remains essential for paraphrase, concept recall, and long natural-language memories. Hybrid search adds exact-text strength instead of replacing vector search.</p><p><strong>How do I build hybrid retrieval for agent memory?</strong></p><p>Configure OracleAgentMemory with `OracleDBEmbedder`, set `SearchStrategy.HYBRID`, choose `SearchIndexSyncMode`, store scoped memories, then test exact, semantic, and mixed queries.</p><p><strong>When should I use keyword-only search?</strong></p><p>Use keyword-only search when retrieval is almost entirely literal text matching and embeddings are unnecessary. Many agent memory workloads need both exact strings and semantic context, which makes hybrid search a better default.</p><p><strong>What is the difference between scoped retrieval and hybrid search?</strong></p><p>Scoped retrieval controls which memories are eligible to be searched. Hybrid search controls how those eligible memories are ranked using both semantic and exact-text signals. <br> <br><strong>Why does hybrid search require `OracleDBEmbedder`?</strong></p><p>The hybrid path uses Oracle-managed indexing and database-side embedding metadata. `OracleDBEmbedder` keeps the application embedder aligned with the database-backed retrieval path.</p><p><strong>Which `SearchIndexSyncMode` should I start with?</strong></p><p>For notebooks and interactive demos, `ON_COMMIT` is the simplest starting point. For bulk ingestion, `MANUAL` gives more control. `AUTO` is useful when Oracle-managed hybrid index maintenance fits the workload. <br> <br><strong>What should I test before publishing an agent memory workflow?</strong></p><p>Test exact-identifier queries, semantic queries, scoped retrieval, index freshness after writes, and behavior when multiple similar memories exist. The strongest demos show both exact and natural-language retrieval over the same records.</p><h3>Resources</h3><ul><li><a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.4/">Oracle AI Agent Memory documentation</a></li><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/">Oracle Database 26ai documentation</a></li><li><a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.4/agmea/store-search.html">Store and Search Memory documentation</a></li><li><a href="https://pypi.org/project/oracleagentmemory/">oracleagentmemory on PyPI</a></li><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/vecse/index.html">Oracle AI Vector Search User’s Guide</a></li><li><a href="https://blogs.oracle.com/developers/whats-new-in-oracle-ai-agent-memory-custom-extraction-hybrid-search-and-more-control">What’s New in Oracle AI Agent Memory: Custom Extraction, Hybrid Search, and More Control</a></li><li><a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/agent_memory/hybrid_search_agent_memory.ipynb">End-to-end support notebook</a></li></ul><h3><strong>What must stay consistent across retrieval stages?</strong></h3><p>Apply the same authorized scope to vector candidates, lexical candidates, reranking inputs, and cached results. Keep rank scores distinct from permission decisions. Compare the full pipeline with each simpler baseline on exact identifiers, paraphrases, conflicting memories, and no-answer cases.</p><p><strong>Continue the implementation:</strong> <a href="https://blogs.oracle.com/developers/hybrid-search-for-oracle-ai-agent-memory-combining-semantic-recall-with-exact-match">Hybrid Search for Oracle AI Agent Memory: Combining Semantic Recall with Exact Match</a>. Use the validation described above as the acceptance check for your next step.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d3f45404401" width="1" height="1" alt=""><hr><p><a href="https://medium.com/oracledevs/hybrid-search-for-oracle-ai-agent-memory-combining-semantic-recall-with-exact-match-6d3f45404401">Hybrid Search for Oracle AI Agent Memory: Combining Semantic Recall with Exact Match</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>
        <item>
            <title><![CDATA[When to use Claude memory, Oracle AI Agent Memory, and LangChain together]]></title>
            <link>https://medium.com/oracledevs/when-to-use-claude-memory-oracle-ai-agent-memory-and-langchain-together-6d141567b773?source=rss-33455f8a7b66------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d141567b773</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[oracle-ai-database]]></category>
            <dc:creator><![CDATA[Srinidhi Sathyamurthy]]></dc:creator>
            <pubDate>Tue, 23 Jun 2026 12:47:44 GMT</pubDate>
            <atom:updated>2026-11-14T17:26:00.115Z</atom:updated>
            <content:encoded><![CDATA[<h4>Build a controlled Claude MCP workflow with Oracle SQLcl, Oracle AI Database, Oracle AI Agent Memory, and LangChain.</h4><p>Claude’s own memory, Oracle-backed application memory, and LangChain components serve different boundaries. Use the assistant’s features for its supported user experience, an application memory layer for governed persistent records, and framework integrations where they simplify a tested workflow.</p><p><strong>Example scope:</strong> Code fragments and architecture diagrams in this article explain the pattern; they are not all standalone programs. Use the linked complete sample and its prerequisites for execution, and validate it in a controlled environment before adapting it.</p><p><strong>Companion notebook:</strong> <a href="https://github.com/oracle-devrel/oracle-ai-developer-hub/blob/main/notebooks/claude_mcp_oracle_ai_database_memory_langchain.ipynb">Claude MCP Oracle AI Database: When to use Claude memory, Oracle AI Agent Memory, and LangChain together</a></p><figure><img alt="Claude MCP Oracle AI Database: When to use Claude memory, Oracle memory, and LangChain together" src="https://cdn-images-1.medium.com/max/720/1*1HnSe63pg67axSqe1l6o5w.jpeg" /></figure><h4>Key Takeaways</h4><ul><li><a href="https://modelcontextprotocol.io/docs/getting-started/intro">MCP</a> turns AI-to-database access into an explicit tool contract instead of implicit system access.</li><li><a href="https://docs.oracle.com/en/database/oracle/sql-developer-command-line/25.4/sqcug/using-oracle-sqlcl-mcp-server.html">Oracle SQLcl in MCP mode</a> (sql -mcp) is a direct, documented way to connect Claude Desktop to Oracle AI Database through an MCP server.</li><li>Oracle AI Database provides the persistent storage and <a href="https://docs.oracle.com/en/database/oracle/oracle-database/26/vecse/overview-ai-vector-search.html">vector search</a> layer for memory workloads, while <a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.4/agmea/get-started.html">Oracle AI Agent Memory</a> gives teams a Python API for threads, durable memory records, scoped retrieval, and context assembly on top of it.</li><li><a href="https://docs.langchain.com/oss/python/integrations/vectorstores/oracle">LangChain plus langchain-oracledb</a> is useful for structured retrieval pipelines once the memory layer is in place.</li><li>A hybrid model is a strong default for many teams: Claude + MCP for operational interaction, Oracle AI Database + LangChain for durable memory records and retrieval.</li></ul><p>Here is how those components connect in this pattern. Claude talks to Oracle through SQLcl MCP, using the tools and database permissions you expose. Oracle AI Agent Memory is the Python package your app uses to manage durable memory records and context assembly. LangChain is an optional wrapper at the end of the retrieval path. The knowledge base is data in Oracle tables, with retrieval and access governed by your application and database design.</p><p>Production success depends less on “prompt quality” and more on boundaries, privileges, logging, and repeatable runbooks.</p><p>Many AI assistant demos fail in the same place: not in the first interaction, but in week two. The assistant can generate SQL and explain concepts, but the workflow often lacks durable context across sessions. Teams also struggle to answer basic operational questions, like who executed what, where, and with which permissions.</p><p>That is why this topic matters for developer teams right now. If you are integrating AI into workflows that query, analyze, or modify data in Oracle- running reports, inspecting schemas, retrieving context, or writing results back- you need two things at once: controlled execution and durable memory. <br>MCP defines the execution boundary. Oracle AI Database provides durable storage, vector search, and database controls for application memory records. You can build that layer directly with tables and retrieval logic, but the Oracle AI Agent Memory Python package makes the integration easier once memory workflows start getting more complex. LangChain comes in later when you need structured retrieval and orchestration on top of that.</p><p>By the end of this guide you will know how to connect Claude to Oracle AI Database through a controlled MCP boundary, when Claude’s built-in memory is sufficient and when your application needs Oracle AI Agent Memory to manage durable memory records in Oracle AI Database, and how to build a retrieval pipeline you can query, audit, and grow over time.</p><p><strong>The developer path through this guide is simple:</strong></p><ul><li>Start with one approved Oracle connection and a read-only validation query.</li><li>Put SQLcl MCP in front of that connection so Claude sees tools, not raw database credentials.</li><li>Check the audit and activity trail before adding more tool access.</li><li>Add Oracle AI Agent Memory when the workflow needs durable thread context, scoped recall, or reusable context cards.</li><li>Add LangChain only when you need application-side retrieval orchestration beyond the MCP interaction loop.</li></ul><figure><img alt="Conceptual workflow showing Claude Desktop connecting to Oracle AI Database through SQLcl MCP, with Oracle AI Agent Memory and LangChain used for durable memory and retrieval paths." src="https://cdn-images-1.medium.com/max/1024/1*TLvD-PoCeywUBQEp07EtZQ.png" /><figcaption>Controlled Claude MCP + Oracle AI Database Workflow</figcaption></figure><h3>Claude Memory vs Oracle AI Agent Memory</h3><p>Claude’s built-in memory has improved significantly, with support for chat history and project-level context. It works well for assistant continuity, but it is still scoped to the assistant experience.</p><p>Before getting into the memory categories, it is worth introducing Oracle AI Agent Memory properly. It is a Python package that sits on top of Oracle AI Database and provides the application-facing API for conversation threads, durable memory records, scoped retrieval, and context cards you can pass back to an assistant. You can build the same tables and retrieval logic yourself, and the companion notebook shows exactly how that works at the table level. But once memory workflows grow-multiple users, cross-session context, retrieval at scale, this package saves a lot of repeated work. Think of Oracle AI Agent Memory as the API your application talks to, and Oracle AI Database as the storage and enforcement layer underneath it.</p><p>In practice, “memory” means different things depending on the layer you are talking about. Claude Memory and Oracle AI Agent Memory solve different problems:</p><figure><img alt="Comparison diagram showing Claude memory as assistant-scoped context and Oracle AI Agent Memory using Oracle AI Database for storage, retrieval, and access control." src="https://cdn-images-1.medium.com/max/1024/1*I0dnT0mp6xz8Hx-ch44oXA.png" /><figcaption>Claude Memory vs Oracle AI Agent Memory</figcaption></figure><p>As of writing, Claude’s memory makes conversations smoother, but it’s still scoped to the assistant experience. It’s not built for querying application history, sharing context across users, or enforcing database-level audit and access controls. That’s where Oracle AI Agent Memory comes in. It gives you a persistent application memory layer you can query and manage across sessions and teams. Important decisions should still be grounded in systems of record, application authorization, and human or workflow review where required.</p><p>A simple way to think about it: Claude remembers for the conversation. Oracle AI Agent Memory remembers for the system.</p><p>Because memory records live in Oracle AI Database and not on one local machine, they can become portable across approved clients. Point a new machine at the same database with the right credentials and policies, and the application can retrieve the same memory records.</p><p>Even with Claude memory, teams often need an application-level memory layer. Claude memory is not designed for querying history across users, storing tool logs, or applying database access controls. Oracle AI Database can help fill that gap by providing durable, shared, and queryable memory records for application workflows.</p><p><strong>Use the layers this way:</strong></p><ul><li>Use Claude memory for assistant continuity: preferences, project context, and conversational convenience inside the assistant experience.</li><li>Use SQLcl MCP when Claude needs to inspect or query Oracle through an explicit tool boundary.</li><li>Use Oracle AI Agent Memory when your application needs durable threads, searchable memory records, scoped retrieval, or context cards across users, agents, and sessions.</li><li>Use LangChain when your app needs reusable retrieval chains, routing logic, or orchestration around the memory and vector search layer.</li></ul><h3>Why this architecture is useful for developers</h3><p>The developer value is practical: each layer gives you something concrete to test before you trust the whole workflow. You can validate the MCP server, the saved SQLcl connection, the database role, the durable application-memory write path, and the retrieval query separately.</p><p>That matters after the demo. When an answer looks wrong, a developer can inspect whether the tool call ran, which database user executed it, what SQL or retrieval path was used, which durable memory records or tool traces were returned, and whether the application assembled the right context. The failure stops being “the model was wrong” and becomes a narrower engineering problem.</p><p>The responsibilities break down into testable layers:</p><ul><li>The assistant translates user intent into a plan your app or MCP client can inspect.</li><li>MCP exposes a declared tool surface instead of broad implicit system access.</li><li>SQLcl MCP gives developers a reproducible bridge from Claude Desktop to approved Oracle connections.</li><li>Oracle AI Database keeps roles, privileges, memory records, tool logs, and vector retrieval close to the data layer.</li><li>Oracle AI Agent Memory gives Python developers a package API for threads, durable memory records, scoped search, and context cards. This is application memory, not just chat history.</li><li>LangChain handles retrieval workflows and tool coordination where application logic is needed, without becoming the permission boundary.</li></ul><p>The payoff is a workflow that is easier to review, easier to debug, and easier to grow. You can start read-only, prove the connection and logging path, add durable memory when the application needs continuity across sessions or workflows, and keep each new capability attached to a named layer instead of burying everything in prompts or a custom agent framework.</p><h3>Understanding the two execution loops</h3><p>Building on the separation of responsibilities above, the system naturally forms two execution loops:</p><ul><li>Loop A: An operational loop for real-time interaction (Claude + MCP): This is the real-time interaction where Claude works with MCP to run queries, inspect data, and respond immediately.</li><li>Loop B: A persistence loop for cross-session memory (Oracle AI Database + LangChain): This is where Oracle AI Database and LangChain handle durable memory records, tool logs, and context retrieval across sessions.</li></ul><p>One loop handles real-time interaction, the other handles durable memory records and retrieval.</p><p>SQLcl MCP is for Claude operating interactively- real-time queries during a conversation, routed through a declared tool contract. Oracle AI Agent Memory is for your application code- storing turns, retrieving history, assembling context before Claude sees a prompt. They serve different loops at different times. You can drop either one depending on your use case, but many production setups benefit from both.</p><figure><img alt="Dual execution loop diagram showing Claude and SQLcl MCP for interactive tool calls, and Oracle AI Database with LangChain for durable memory records and retrieval." src="https://cdn-images-1.medium.com/max/1024/1*fS_n2tx3cGq75yhKFmJGjw.png" /><figcaption>Dual Execution Loop: MCP Interaction and Durable Memory</figcaption></figure><h3>Setup Guide: Reproducing the Oracle SQLcl MCP and Claude Workflow</h3><p>The SQLcl MCP setup is documented by Oracle and reproducible in the way that matters for developers: you can install it, test it, validate the saved connection, and inspect activity before Claude runs a real query.</p><p><strong>Prerequisites before you connect Claude</strong></p><ul><li>Oracle SQLcl 25.2.0 or higher.</li><li>Oracle JRE 17 or 21.</li><li>Claude Desktop or another MCP-capable client you are explicitly configuring and testing.</li><li>At least one saved SQLcl connection profile under <em>~/.dbtools</em>, created with password persistence for MCP use.</li><li>A database user with the minimum permissions required for the workflow. Start with read-only access and a sanitized development or replica environment where possible.</li></ul><p>The core idea is simple. SQLcl runs in MCP mode with <em>sql -mcp</em>. Claude Desktop launches it as an MCP server and talks to the database through declared tools and the permissions attached to the saved connection. Connections come from saved profiles in the SQLcl connection store under <em>~/.dbtools</em>. Claude does not invent them at runtime, it reuses ones you have already created and validated.</p><p>One setup detail that catches people out: MCP-compatible saved connections need the password persisted. That is what the <em>-savepwd</em> flag does when you create the connection. Treat that saved profile as a credentialed application path: use a purpose-specific database user, keep the grant surface small, and avoid pointing first experiments at production data.</p><p>Once that is done, you configure Claude Desktop to point at the SQLcl executable and pass -mcp as the argument. Claude Desktop manages the server lifecycle from there, and SQLcl translates tool calls into database operations. Oracle recommends granting the minimum permissions required, considering sanitized copies or read-only replicas for AI access, and auditing LLM activity. SQLcl MCP activity can be inspected through database-side traces such as <em>DBTOOLS$MCP_LOG</em>and session views such as <em>V$SESSION</em>. (<a href="https://docs.oracle.com/en/database/oracle/sql-developer-command-line/25.4/sqcug/using-oracle-sqlcl-mcp-server.html">docs.oracle.com</a>)</p><p>SQLcl MCP also supports restrict levels. The documented default is restrict level 4, which disables sensitive commands such as unrestricted file system access and host execution. Treat changes to the restrict level as an explicit security decision, not as a convenience toggle. (<a href="https://docs.oracle.com/en/database/oracle/sql-developer-command-line/25.4/sqcug/configuring-restrict-levels-sqlcl-mcp-server.html">docs.oracle.com</a>)</p><p>A minimal configuration looks like this:</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;sqlcl&quot;: {<br>      &quot;command&quot;: &quot;PATH/bin/sql&quot;,<br>      &quot;args&quot;: [&quot;-mcp&quot;]<br>    }<br>  }<br>}</pre><p>That small JSON block defines the connection between Claude and SQLcl MCP Server. Claude interacts with the database through the tools and permissions exposed by the MCP server, using the saved SQLcl connection profile you created and tested first.</p><p><strong>Validation checklist before expanding access</strong></p><ul><li>Run <em>sql -mcp</em> locally and confirm the server starts.</li><li>Restart Claude Desktop and confirm the SQLcl tools are discoverable.</li><li>Run one read-only query against an approved schema.</li><li>Check database-side MCP activity logs and session metadata.</li><li>Document the connection alias, database user, grant scope, restrict level, and troubleshooting owner.</li></ul><p><strong>Good first proof looks like this:</strong></p><ul><li>The MCP server starts without a Java or path error.</li><li>Claude lists the SQLcl MCP tools after restart.</li><li>A read-only query succeeds against the expected schema.</li><li>The database-side activity trail shows the MCP interaction.</li><li>A denied query fails because of the database role, not because a prompt asked nicely.</li></ul><h3>Why put application memory records in Oracle AI Database, not just outputs</h3><p>Once your first tool calls work, the next challenge is continuity. If memory lives only in chat context, the system is fragile. If memory is scattered across files without structure, retrieval and auditing become expensive over time.</p><p>It’s worth calling out the difference here. At this point, the challenge shifts from conversation persistence to system-level memory.</p><p>A model that uses Oracle AI Agent Memory is often cleaner and easier to operate as the workflow grows.</p><p>The companion notebook builds this memory layer from scratch, so the mechanics are visible and then shows how Oracle AI Agent Memory slots on top of it once the substrate is working.</p><p><strong>Memory categories that matter in practice</strong></p><ul><li>Conversational memory <br>Stores user and assistant turns, thread IDs, timestamps, and metadata.</li><li>Operational memory <br>Stores tool inputs, outputs, status, and error classes for troubleshooting and audit.</li><li>Semantic memory <br>Stores chunks and embeddings for meaning-based retrieval when exact keywords are absent.</li></ul><p><strong>Why this matters technically</strong></p><ul><li>SQL tables give deterministic filtering and ordering.</li><li>Transactions improve integrity under concurrent writes.</li><li>Vector retrieval helps with paraphrases and conceptual matches.</li><li>Keeping memory on one platform makes it easier to manage, audit, and keep consistent over time.</li></ul><p>This works well with Oracle AI Database because structured records and semantic retrieval data can stay in one place.</p><figure><img alt="Oracle AI Database Memory and Retrieval Model" src="https://cdn-images-1.medium.com/max/1024/1*j0CUOgkKaCbk_1SoLdaXpQ.png" /><figcaption>Oracle AI Database Memory and Retrieval Model</figcaption></figure><h3>Where LangChain adds value (and where it should not be overused)</h3><p>LangChain is useful as orchestration glue, especially when teams want a documented path for tool definitions and retrieval calls. One thing worth stating clearly: in the architecture shown here, Claude Desktop does not call LangChain directly. LangChain runs in your application layer to format context before it reaches Claude’s prompt. With langchain-oracledb, teams can wire vector retrieval in Oracle AI Database while keeping control in database roles and runtime policies.</p><p><strong>Good uses of LangChain in this architecture</strong></p><ul><li>Declaring retrieval and memory tools in a consistent format.</li><li>Running retrieval-first answer pipelines.</li><li>Standardizing how context is assembled before generation.</li><li>Building reusable agent patterns across teams.</li></ul><p><strong>Poor uses of LangChain in this architecture</strong></p><ul><li>Assuming LangChain automatically makes database access safe.</li><li>Relying only on prompts to limit what the assistant is allowed to do.</li><li>Adding too many tools before your team knows how to manage and troubleshoot them.</li></ul><p>A good rule is to enforce permissions in the database and infrastructure layer, not only in framework code or prompts.</p><h3>Practical Implementation Snippets</h3><p>The snippets below show the minimum useful shape of the implementation: the MCP boundary, the memory substrate, a package-level memory API, and the retrieval policy that keeps generated answers grounded.</p><p><strong>1)MCP boundary snippet</strong></p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;sqlcl&quot;: {<br>      &quot;command&quot;: &quot;C:\\tools\\sqlcl\\bin\\sql.exe&quot;,<br>      &quot;args&quot;: [&quot;-mcp&quot;]<br>    }<br>  }<br>}</pre><p><strong>2) Memory schema concept snippet</strong></p><pre>-- CONVERSATIONAL_MEMORY  <br>THREAD_ID, ROLE, CONTENT, METADATA_JSON, CREATED_AT  <br>  <br>-- TOOL_LOGS  <br>THREAD_ID, TOOL_NAME, TOOL_INPUT, TOOL_OUTPUT, STATUS, ERROR_MESSAGE, CREATED_AT  <br>  <br>-- KB_CHUNKS (used for vector retrieval via langchain-oracledb)  <br>TEXT_CHUNK, METADATA_JSON, EMBEDDING</pre><p><strong>3) Oracle AI Agent Memory package path</strong></p><pre>pip install &quot;oracleagentmemory==26.4.0&quot;</pre><p>The package path expects Python 3.10 or later, Oracle AI Database, version 26ai or later for compatibility, an Oracle AI Database connection or connection pool, an embedding model for retrieval, and an optional LLM for memory extraction, summaries, and context cards. The exact adapters depend on your application, but the API shape is intentionally small:</p><pre>from oracleagentmemory.apis.searchscope import SearchScope<br>from oracleagentmemory.core.oracleagentmemory import OracleAgentMemory<br>from oracleagentmemory.core.embedders.embedder import Embedder<br>from oracleagentmemory.core.llms.llm import Llm<br><br>embedder = Embedder(model=&quot;YOUR_EMBEDDING_MODEL&quot;)<br>llm = Llm(model=&quot;YOUR_LLM&quot;)<br>db_pool = ...  # your oracledb connection or connection pool<br><br>memory = OracleAgentMemory(connection=db_pool, embedder=embedder, llm=llm)<br><br>thread = memory.create_thread(user_id=&quot;user_123&quot;)<br>thread.add_messages([<br>    {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Remember that I prefer morning deployment reviews.&quot;},<br>    {&quot;role&quot;: &quot;assistant&quot;, &quot;content&quot;: &quot;Got it. I will keep that preference in mind.&quot;},<br>])<br><br>thread.add_memory(&quot;The user prefers morning deployment reviews.&quot;)<br><br>results = memory.search(<br>    query=&quot;When does this user prefer deployment reviews?&quot;,<br>    scope=SearchScope(user_id=&quot;user_123&quot;),<br>)<br><br>context = thread.get_context_card()</pre><p>Use <em>oracleagentmemory</em> from your application layer when you need package-managed users, agents, memories, threads, scoped retrieval, and context assembly. Keep systems of record separate from memory records: memory helps provide context, but application logic and authoritative data sources should still decide what is true, allowed, and final. (<a href="https://docs.oracle.com/en/database/oracle/agent-memory/26.4/agmea/get-started.html">docs.oracle.com</a>)</p><p><strong>4) Retrieval-first policy snippet (pseudo-policy)</strong></p><ul><li>Retrieve relevant memory before synthesizing final answer.</li><li>If retrieval is empty, say context is insufficient.</li><li>Keep answers evidence-first and concise.</li><li>Log tool calls with status and timestamp.</li></ul><h3>Engineering guidance for production teams</h3><p>The difference between demo success and production success is disciplined operations. Most failures at this stage come from integration gaps, not model behavior.</p><p><strong>Access and privilege model</strong></p><ul><li>Separate accounts per environment (dev, test, prod).</li><li>Start read-only wherever possible.</li><li>Use least privilege grants and schema allowlists.</li><li>Gate write operations with explicit confirmation workflows.</li></ul><p><strong>Observability model</strong></p><ul><li>Log tool name, thread ID, timestamp, status, and sanitized inputs.</li><li>Classify failures into runtime, connection, privilege, query, and retrieval.</li><li>Keep a troubleshooting playbook in your repo.</li><li>Check whether retrieval results become less accurate as more data is added.</li></ul><p><strong>Reliability model</strong></p><ul><li>Prefer deterministic SQL patterns with bounded result sets.</li><li>Use retrieval-first context assembly for memory-heavy tasks.</li><li>Avoid giant context stuffing as a substitute for memory design.</li><li>Review and prune tool surfaces periodically.</li></ul><p>This is also where teams should align with platform and security teams early. Governance should be designed into the architecture, not bolted on after incidents.</p><h3>Typical failure modes and how to diagnose them fast</h3><p>Most teams hit a predictable set of issues.</p><p><strong>Runtime failure: sql -mcp does not start</strong></p><p>Check the absolute SQLcl path, confirm Java is available, and run <em>sql -mcp</em> outside Claude first. Resolve runtime first before checking assistant behavior.</p><p><strong>Discovery failure: Claude does not see tools</strong></p><p>Check the Claude Desktop JSON, confirm the configured command points to the SQLcl executable, and restart Claude Desktop after edits. If the server starts in a terminal but not from Claude, treat it as a config or environment-path problem.</p><p><strong>Connection failure: tools are present but queries fail immediately</strong></p><p>Check the saved SQLcl connection alias, confirm the profile lives under the expected SQLcl connection store, and verify password persistence for the MCP workflow. Then test the same connection outside Claude.</p><p><strong>Permission failure: queries execute selectively and fail on specific objects</strong></p><p>Check the database role first. A selective failure can be the right outcome when least privilege is working. Add grants intentionally, prefer schema allowlists, and keep read-write access separate from the initial validation path.</p><p><strong>Retrieval quality failure: answers are fluent but weakly grounded</strong></p><p>Inspect the retrieved records before blaming the model. Check chunk size, metadata filters, embedding choice, top-k settings, and whether the query is asking for exact history, semantic similarity, or operational logs.</p><h3>Why the hybrid model is a strong long-term default</h3><p>By this point, you’ve probably noticed a pattern: no single layer handles both execution and memory well.</p><p>Trying to force everything into the assistant gets messy fast. You either lose control over execution, or you end up stuffing too much context into prompts just to keep things working. On the other side, if you only build backend memory systems, you lose the speed and usability that makes assistants useful in the first place.</p><p>The hybrid approach works because it doesn’t try to solve everything in one place:</p><ul><li>Execution stays controlled through MCP.</li><li>Memory stays durable and queryable in the database.</li><li>The two are connected where needed, not tightly coupled.</li></ul><p>In real teams, this usually evolves over time. It starts simple: Claude with SQLcl MCP, read-only access, and basic workflows. Once people start relying on it, the gaps show up: we lose context, we can’t trace what happened, or we are repeating work.</p><p>That’s when it makes sense to introduce Oracle AI Agent Memory and retrieval. Not earlier.</p><p>The goal isn’t to build perfect architecture upfront. It’s to add structure where the system starts to break.</p><h3>Conclusion</h3><p>Setting up Claude with SQLcl MCP works well when treated as an architectural pattern, not just a series of setup steps. Each layer has one job: Claude handles intent, MCP enforces the execution boundary, Oracle AI Database stores durable memory records and audit data, and LangChain handles retrieval orchestration where needed.</p><p>With clear execution boundaries and durable memory, you can trace what happened, understand failures, and evolve the workflow without introducing hidden behaviour.</p><p>That shift, from implicit access and adhoc context to explicit boundaries and durable memory, is what moves AI-assisted workflows from experiments to operational systems.</p><h3>Frequently Asked Questions</h3><p><strong>What is MCP in this context?</strong></p><p>MCP is a protocol that lets Claude call explicit tools exposed by a server, rather than accessing systems implicitly.</p><p><strong>Why use SQLcl for Oracle MCP?</strong></p><p>SQLcl already understands Oracle workflows and can run as MCP server with sql -mcp, making integration practical and direct.</p><p><strong>Is this setup only for Claude Desktop?</strong></p><p>No. The same MCP and memory architecture concepts can be reused with other MCP-capable clients and backend services.</p><p><strong>Why include Oracle AI Database if MCP already works?</strong></p><p>MCP handles execution boundaries. Oracle AI Database handles durable memory records, retrieval, concurrency, and database access controls. Claude’s own memory helps within a session, but it is not designed as an application memory layer.</p><p><strong>What versions are required for the SQLcl MCP setup?</strong></p><p>Oracle documents that the SQLcl MCP Server requires Oracle SQLcl 25.2.0 or higher, Oracle JRE 17 or 21, Claude Desktop, and at least one saved SQLcl connection profile with password persistence enabled via -savepwd. Teams should verify the latest compatibility guidance in the official Oracle documentation as MCP support evolves.</p><p><strong>Where does Oracle AI Agent Memory fit?</strong></p><p>Oracle AI Agent Memory sits between your application code and Oracle AI Database. The package manages threads, durable memories, scoped retrieval, and context cards, while Oracle AI Database remains the storage and enforcement layer underneath.</p><p><strong>Where does LangChain fit?</strong></p><p>LangChain is an orchestration layer for tools and retrieval. It can help assemble context and retrieval pipelines, but permissions still belong in the database, infrastructure, and application runtime.</p><p><strong>Do I need vector search for every use case?</strong></p><p>No. Start with structured memory. Add vector retrieval when paraphrase-heavy or concept-level retrieval becomes important.</p><p><strong>How do I prevent risky SQL operations?</strong></p><p>Use least privilege roles, schema allowlists, read-only access where possible, SQLcl MCP restrict levels, and explicit confirmation workflows for high-impact actions.</p><p><strong>Can this support audit or compliance needs?</strong></p><p>It can support audit-oriented workflows if tool traces, SQL-level controls, retention policies, and review processes are implemented consistently. Do not treat memory records as the sole authoritative record for regulated or high-impact decisions.</p><h3>Companion Troubleshooting Appendix</h3><ul><li><strong>Minimum viable setup:</strong> SQLcl MCP configured in Claude, one approved Oracle connection, read-only validation, and database-side activity logging.</li><li><strong>First checks:</strong> confirm <em>sql -mcp</em> starts, Claude sees the tools after restart, and the saved SQLcl connection alias resolves.</li><li><strong>Environment model:</strong> use separate credentials and policies for dev, test, and prod, with stricter controls as capability expands.</li><li><strong>Logging model:</strong> capture tool name, timestamp, thread ID, status, sanitized input/output summaries, and relevant SQLcl MCP log records.</li><li><strong>Retrieval quality:</strong> tune chunk size, enrich metadata, review embedding choice, and evaluate retrieval against representative queries.</li><li><strong>Common anti-pattern:</strong> expanding tool surfaces before ownership, logging standards, and runbooks are in place.</li><li><strong>Rollout path:</strong> pilot in dev with read-only access and strong logging, then expand capabilities in controlled phases.</li></ul><h3><strong>What should own enterprise memory?</strong></h3><p>Choose ownership from the application’s identity, retention, deletion, and audit requirements. Do not assume an assistant’s personal memory is the system of record for a multi-user application. Validate MCP access separately from memory persistence and verify a recall in a second session under the intended identity.</p><p><strong>Continue the implementation:</strong> <a href="https://blogs.oracle.com/developers/langgraph-persistence-with-oracle-ai-database">LangGraph persistence with Oracle AI Database</a>. Use the validation described above as the acceptance check for your next step.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d141567b773" width="1" height="1" alt=""><hr><p><a href="https://medium.com/oracledevs/when-to-use-claude-memory-oracle-ai-agent-memory-and-langchain-together-6d141567b773">When to use Claude memory, Oracle AI Agent Memory, and LangChain together</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>
        <item>
            <title><![CDATA[Wings Unfolding]]></title>
            <link>https://medium.com/@srinidhisathya/wings-unfolding-70ecc13e0feb?source=rss-33455f8a7b66------2</link>
            <guid isPermaLink="false">https://medium.com/p/70ecc13e0feb</guid>
            <category><![CDATA[self-love]]></category>
            <category><![CDATA[self-discovery]]></category>
            <category><![CDATA[mindfulness]]></category>
            <category><![CDATA[life]]></category>
            <category><![CDATA[personal-growth]]></category>
            <dc:creator><![CDATA[Srinidhi Sathyamurthy]]></dc:creator>
            <pubDate>Mon, 03 Nov 2025 20:40:43 GMT</pubDate>
            <atom:updated>2025-11-03T20:40:43.609Z</atom:updated>
            <content:encoded><![CDATA[<p>Sometimes I don’t know what to write. Sometimes the keyboard clicks faster than my brain can keep up. Today, I’m brimming with thoughts.</p><p>Before I begin, I want to say one thing, especially to those who may have ever taken what I said or wrote the wrong way. I’ve never written for anyone to find me relatable. I’ve always written for myself, and I’ll continue to do so.</p><p>The last few months have been a complete rollercoaster. As I reflect, I realise how much the people around me have changed and how much I have, too. I am not the same person I was last year. Or six months ago. Or even three.</p><p>I’ve shut out situations the only way I know how, by binge-reading books or playing songs so loud and so long that no single thought can escape my head. But that doesn’t make it easier.</p><p>Even when people twisted my words or misunderstood my intentions, I’ve come to see something deeper. Every misunderstanding, every moment of distance, has brought me closer to the person I’m becoming.</p><p>Lately, I’ve reconnected with old friends, people I knew only briefly in my teens. I rant to people I didn’t even know existed around me a few years ago in the same familiar surroundings. And somehow, I’ve stumbled upon new friends too, the kind I never thought possible. It’s funny how the person you least expect to bond with ends up being the one you’re closest to. And yet, there are a few friends who have stuck with me through years, through distance, through ups and downs, quietly proving that loyalty and love exist. I hold them close in my heart.</p><p>I think about this a lot. Who would I have been if certain things hadn’t happened? What if I hadn’t met certain people, or misunderstood them, or built a bridge so wide that I can’t go back to the friendship we once had? Was I not vulnerable enough? Not honest enough? Not present enough to recognise their efforts and struggles? Oh, I don’t know.</p><p>What I do know is that I’m learning to be present, not for anyone else, but for me.<br>Showing up. Working hard. Working out. Loving my hobbies and making them part of my everyday life. Rediscovering the things that remind me who I am. Understanding myself. Dissecting my thoughts.</p><p>And that’s when I realise I’m not even the person I was a month ago. I’ve had a software update.</p><p>I’ve fallen so deeply into the person I’m becoming that everything else stopped making sense. And as they say, I started watering my own grass.<br>I’m learning who I am, what I want, what I love, and what I can’t tolerate. What I have patience for. What truly matters and what doesn’t.<br>And honestly, it no longer matters what others make of me, my words, or my behaviour.</p><p>The more I learn about myself, the more I realise how powerful energy really is. When you know who you are and what you stand for, you stop chasing connections. You start attracting them. The right people are drawn to authenticity because energy doesn’t lie. When your energy aligns with who you are, it naturally filters out those who were never meant to stay. With that awareness comes clarity, not just about who belongs in your life, but about what has shaped you to become who you are.</p><p>I’ve also learnt that we’re not responsible for everything that’s happened to us, the surroundings we grew up in, the circumstances we were thrown into, or the trials we had to survive. Life can feel dystopian sometimes. But we are responsible for what we make of it, for what we learn from it, and for how we rise, rebuild, and grow from it. We may not control the plot twists life throws at us, but we always control how we rewrite the story.</p><p>And in the hardest moments, I hope we all remember what a mastermind woman, Taylor Swift, of course, once said, “<em>This is just a storm inside a teacup, but failure brings you freedom.</em>”</p><p>Earlier today, I was FaceTiming my best friend, and she said something that stuck with me.</p><blockquote>“The only people who’ll truly think the best of you and genuinely be happy for you are your family and maybe four friends around you. And by the time you find those four good friends, you’ll meet a lot of temporary ones along the way.”</blockquote><p>She’s right. Life goes on.</p><p>If you think you wouldn’t survive someone talking or not talking to you, you’re mistaken. Life has already moved through the thousand problems you thought you’d never get past, and there’s still a long way to go. This is just the beginning.</p><p>Fall so deeply in love with who you are that it doesn’t break you when someone fails to show up the way you hoped they would. “<em>People can only meet you as deeply as they have met themselves,”</em> as Matt Kahn says. This doesn’t mean they are wrong or that they’ve made the biggest mistake by not showing up for you. Often, we build them up in our minds through rose-coloured glasses, imagining the person they could be, the potential we think they have. We script their character in our heads based on what we would do in their place, based on our life lessons and the way we’ve grown. But they are not us. They haven’t lived our experiences, they haven’t walked our paths, and they cannot follow the script we’ve written for them. Even when our head insists that this is their character arc, in real life, it simply isn’t. And that’s okay.</p><p>So show up for yourself, even if the only person cheering for you is your mother.<br>You don’t have to be perfect. You don’t have to have it all figured out. You don’t have to go from zero to eighty overnight.<br>But what you absolutely do have to do is push that one per cent more, just today.</p><p>Be better for yourself. Know yourself. Love yourself.<br>You were placed on this planet to do what’s right for you, to be the main character of your own story. Stop giving so much power to people and situations that aren’t in your control. Let them stay out of your mind.</p><p>I think that’s what growth really feels like: messy, uncertain, but real.</p><p>I don’t know what the next few months will bring, or who I’ll be by then. But I know I’ll keep showing up, for myself, for my dreams, and for the small, quiet moments that make it all worth it.</p><p>I’ll keep learning, unlearning, forgiving, and rebuilding. I’ll keep growing into the person I was always meant to be, even if it takes time.</p><p>And maybe, like Ariana says, “<em>So for now it’s only me, and maybe that’s all I need.</em>”</p><p>So starting today, fall in love with yourself again and again.<br>Fall in love with yourself again and again.<br>Fall in love with yourself again and again.<br>Fall in love so deeply that it spills into every choice, every connection, every day.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70ecc13e0feb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Becoming My Own Horizon]]></title>
            <link>https://medium.com/@srinidhisathya/becoming-my-own-horizon-25e254e1e604?source=rss-33455f8a7b66------2</link>
            <guid isPermaLink="false">https://medium.com/p/25e254e1e604</guid>
            <category><![CDATA[friendship]]></category>
            <category><![CDATA[personal-growth]]></category>
            <category><![CDATA[self-worth]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[family]]></category>
            <dc:creator><![CDATA[Srinidhi Sathyamurthy]]></dc:creator>
            <pubDate>Wed, 13 Aug 2025 20:17:17 GMT</pubDate>
            <atom:updated>2025-11-03T19:34:41.222Z</atom:updated>
            <content:encoded><![CDATA[<p>When I was young, I thought the world was too kind. Or maybe not that kind, but I chose to believe the best anyway. Somehow, that hopeful girl still lives in me, tucked away like a secret I protect. Then life grows up around you, and adulthood arrives. “Humbling” is the polite word. Imagine using a nail gun to hammer every lesson into your body. Loud. Sharp. Scars you carry. Some fade, some stay.</p><p>In between those scars are people. I’ve crossed paths with so many people from different places and backgrounds. Some stayed longer than I expected, some disappeared quietly, and some I had to let go. Even when it hurt, I’m glad I met them.</p><p>Once, I was pouring my heart out to a stranger, my friend’s flatmate, who I’d literally just met, and she said:<br><em>“You know nobody enters or re-enters your life without a reason, right?”</em></p><p>In that moment, it clicked. People enter our lives for reasons, sometimes temporary, sometimes lasting.</p><p>You make friends, you lose friends, and sometimes you just drift. Life happens. People grow in different directions. One day, you’re sitting across from someone you used to share everything with, and it’s fine, hauntingly comfortable even, but the closeness is gone.</p><p>My Amma always says, “But you have wonderful memories with them, why not stay in touch?” And I get it. I do. But memories aren’t the same as connection.</p><p>The more I’ve worked on myself, the clearer it’s become. I never needed anyone’s validation. I wake myself up, make my own breakfast, drag myself to workouts on no sleep, and still smile brightly. And honestly? My favourite animal is me when I remember who I am.</p><p>But the first time someone really saw me was when I was crying on the couch for four hours straight because my friends were leaving. They told me I felt too deeply and was too genuine. Later, a kind lady even called me an “Angel”, maybe the first time I realised others could see my light even when I didn’t feel it.</p><p>When you start putting yourself first, your self-worth shifts. And yes, sometimes even friends and family won’t support what you do, but that doesn’t make you any less worthy.</p><p>As a kid, I was always “too quiet”, “too nerdy”, “too artsy”, maybe even too unrelatable. I thought if I made myself smaller, people would like me more. Now, I’m louder, still nerdy, still artsy, and I own it. Like finding an old sweater you forgot about, only to realise it still fits perfectly.</p><p>So when someone talks about marriage, I take a U-turn. Not because I’m against it, but because I’m not everything I want to be yet. How could I promise myself to someone else when I’m still in the middle of becoming?</p><p>What devastates isn’t losing friends. It’s realising some people only wanted to be close because they were competing with you in their heads. When the pedestal you put them on crashes, it’s brutal. But it’s also a lesson. Sometimes you have to get hurt to grow. And sometimes growth means letting the garden look empty for a while.</p><p>I still remember existing in a foreign land with exactly one good friend, literally my emergency contact. And other than that, it was my family back home. My true support has always been my best friends, who somehow dare to stay in a different country. Thankfully, I later found some wonderful friends here, too.</p><p>I think about moments at school when I felt left out, and I understand my Amma now, how much it hurt her to see me in pain. She just wanted the best for me. Maybe adulthood is just learning their perspective, sad but true.</p><p>And to everyone who hates how they’re slowly turning into their parents, I hope you become that, and more, by unlearning the toxic bits and carrying forward the love.</p><p>My mother is my best friend now, my loudest cheerleader. My father is still my favourite badminton partner. They had dreams of their own, too, and sometimes I wish that in their next lives, they would live such rich, fulfilling lives, even if I’m not a part of it. They deserve it.</p><p>They say you don’t miss something until it’s gone. I’ve had enough practice at that to call myself an expert. Every person I truly connect with seems to move away eventually. Or maybe I do. But when you meet a pure soul, someone who makes the world feel softer, you hold them close for as long as you can. Even if it’s just through fleeting Instagram reels and WhatsApp texts.</p><p>This isn’t a polished essay. It’s just a random spill of everything I’ve been feeling as I walk further toward the woman I’m becoming. And maybe, in the process, we all find the wings we were meant to fly with.</p><p>So here’s your sign. Go be everything you want to be, and spread your wings in every direction until you’ve flown across horizons you didn’t even know existed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25e254e1e604" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>