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:
- Durable checkpoints: Store LangGraph graph state with
OracleSaverorAsyncOracleSaver. - Java checkpointing: Store LangGraph4j workflow state with the Java
OracleSaver. - Thread continuity: Resume a conversation or workflow by invoking the graph with the same
thread_id. - Durable stores: Store namespaced JSON values with
OracleStoreorAsyncOracleStore. - Vector search: Add semantic search to store entries by using Oracle AI Vector Search.
- Asynchronous applications: Use async checkpoint and store classes in
asyncorawaitruntimes. - Connection pooling: Use a single Oracle connection pool across checkpointers and stores.
Architecture
A typical LangGraph and Oracle AI Database application follows this flow:
- Connect: Create an Oracle connection, connection pool, or connection string.
- Prepare persistence: Initialize
OracleSaverfor checkpoints andOracleStorefor long-term memory. - Run setup: Call
setup()once for each persistence object to create or upgrade tables. - Compile: Pass
checkpointer=and, when needed,store=to the graph or agent. - Invoke: Run the graph with a
thread_idin the LangGraph configuration. - Resume: Reuse the same
thread_idto load previous graph state from Oracle AI Database. - 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
- LangGraph documentation: Official LangGraph documentation.
- LangGraph persistence concepts: Concepts for checkpointing and durable execution.
- PyPI:
langgraph-oracledb: Oracle persistence package for LangGraph. - Source:
langgraph-oracledbpackage: Package source code. - Source:
langgraph4j-oracle-saverpackage: Java checkpoint saver source and README. - Oracle AI Vector Search documentation: Oracle vector search capabilities.
- Oracle AI Developer Hub: Notebooks, applications, and reference materials.