5.5 Use Ingested Documents with the SQLcl MCP Server

model ingest can be used with SQLcl MCP retrieval capabilities to implement a retrieval-augmented generation workflow.

5.5.1 Retrieval Workflow

model ingest prepares the knowledge base. The context_retrieve MCP tool searches that knowledge base and returns relevant document context.

The tool uses the same embedding-model configuration that was used during ingestion. It returns context to the MCP client. it does not generate the final answer or modify the vector tables.

A typical workflow is:

  1. Configure an embedding model.
  2. Ingest one or more documents into an Oracle vector table.
  3. Send a semantic query from an MCP client.
  4. context_retrieve embeds the query.
  5. The tool searches compatible SQLcl RAG vector tables.
  6. The tool returns relevant document context.
  7. The MCP Client provides the context to the configured chat model.

RAG Retrieval Workflow

Prepare the Knowledge Base

Local Documents
      ↓
MODEL INGEST
      ↓
Embedding Model
      ↓
Oracle Vector Table
(chunks and embeddings)

      ↓
Retrieve Relevant Context

User Query
      ↓
context_retrieve
      ↓
Embed Query + Search Compatible
SQLcl RAG Vector Tables
      ↓
Relevant Document Context

      ↓
Generate a Response

MCP Client
      ↓
Chat Model
      ↓
Generated Response

5.5.2 Vector Table Compatibility for Retrieval

The MCP server searches only SQLcl RAG vector tables that are compatible with the active embedding model.

A compatible table contains the following metadata:

Metadata Required Value
purpose sqlcl-rag
model_fingerprint Fingerprint of the active embedding model.
vector_dimension Vector dimension of the active embedding model.

The MCP tool discovers matching tables through the database vector APIs. It searches each table and combines the returned document chunks into one text result. Each table can contribute up to seven results, subject to the configured minimum similarity score of 0.7.

The tool returns context to the MCP client. It does not return the final answer and does not modify the vector tables.

If no compatible table is found, the tool reports that no tables matched the active embedding-model fingerprint. If compatible tables are found but the search returns no chunks, the tool reports that no retrieval context was found.

For more information about semantic retrieval from an MCP client, see Using the Oracle SQLcl MCP Server.