LangGraph

Use LangGraph with Oracle AI Database to persist agent state, checkpoints, and searchable long-term memory.

LangGraph is an open source framework for building stateful, agentic applications. The langgraph-oracledb package adds Oracle-backed persistence implementations for Python LangGraph checkpoints and stores, and langgraph4j-oracle-saver adds Oracle-backed checkpoint persistence for LangGraph4j.

Why LangGraph with Oracle AI Database

Oracle AI Database can store graph checkpoints, JSON state, relational data, and vector embeddings in one database. This design reduces the number of services that a production agent must deploy, secure, monitor, and back up.

Key capabilities of the integration:

Architecture

A typical LangGraph and Oracle AI Database application follows this flow:

  1. Connect: Create an Oracle connection, connection pool, or connection string.
  2. Prepare persistence: Initialize OracleSaver for checkpoints and OracleStore for long-term memory.
  3. Run setup: Call setup() once for each persistence object to create or upgrade tables.
  4. Compile: Pass checkpointer= and, when needed, store= to the graph or agent.
  5. Invoke: Run the graph with a thread_id in the LangGraph configuration.
  6. Resume: Reuse the same thread_id to load previous graph state from Oracle AI Database.
  7. Recall: Search store entries by namespace, metadata, or vector similarity.

Integration Components

The langgraph-oracledb package provides synchronous and asynchronous implementations.

Component Import or Package Use
OracleSaver langgraph_oracledb.checkpoint.oracle Synchronous checkpoint saver for graph state.
AsyncOracleSaver langgraph_oracledb.checkpoint.oracle Asynchronous checkpoint saver for graph state.
OracleStore langgraph_oracledb.store.oracle Synchronous namespaced key/value store with optional vector search.
AsyncOracleStore langgraph_oracledb.store.oracle Asynchronous namespaced key/value store with optional vector search.
OracleSaver org.bsc.langgraph4j:langgraph4j-oracle-saver Java checkpoint saver for LangGraph4j workflow state.

Use the checkpoint saver for short-term graph state that belongs to a specific thread. Use the store for long-term memories, user preferences, retrieved facts, or other values that should be searchable across threads.

Resources