DBMS_AI_GRAPHRAG

The DBMS_AI_GRAPHRAG package provides PL/SQL APIs for creating, querying, and managing knowledge graphs for GraphRAG workflows.

Graph creation processes text from a database source, extracts entities and relationships, and prepares graph and vector data for retrieval.

Use the query API to retrieve relevant chunks and graph components. The API can return the retrieved context or generate an answer. JSON parameters configure options such as LLM generation, embeddings, chunking, and retrieval.

DBMS_AI_GRAPHRAG Subprograms

Subprogram Description
CREATE_KNOWLEDGE_GRAPH Creates a knowledge graph from a source and configures graph extraction and retrieval.
QUERY_KNOWLEDGE_GRAPH Searches a knowledge graph and returns the result as JSON. The result can contain retrieved context and a generated answer.
ADD_SOURCE Adds a source and column to a knowledge graph.
REMOVE_SOURCE Removes a source and column from a knowledge graph.
GET_KNOWLEDGE_GRAPH_STATUS Returns the status of a knowledge graph as JSON.
RECOVER_KNOWLEDGE_GRAPH Recovers processing for a knowledge graph.
DROP_KNOWLEDGE_GRAPH Drops the specified knowledge graph.
CLEAR_LLM_CACHE Clears cached LLM responses, optionally for a specified owner.

Graph creation can optionally enable DML-based maintenance to process changes to source data. Use the status and recovery APIs to monitor and recover graph processing.