-
Hi, So, I am building a conversational interface that requires to store convos. First, I went with SQlite, and the implementation was quite straightforward: import sqlite3
from langgraph.checkpoint.sqlite import SqliteSaver
# Creating the directory if it doesn't exist
db_dir = "agent_db"
db_path = os.path.join(db_dir, "memory_convos.db")
# Ensuring the directory does exist
os.makedirs(db_dir, exist_ok=True)
# Connecting to the DB, creating it if it's not there
conn = sqlite3.connect(db_path, check_same_thread=False)
memory = SqliteSaver(conn)
# Some code implementing my graph
# ...
graph = workflow.compile(checkpointer=memory) My question is: how do I replicate such implementation, but using from langgraph.checkpoint.duckdb import DuckDBSaver
# Implementation
# ...
graph = workflow.compile(checkpointer=memory) Unfortunately I couldn't find a reference, and I need to make the transition since https://github.com/langchain-ai/langgraph/blob/main/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py#L37C5-L40C35 mentions that the SQLite implementation is not suited for production. Thank you a lot in advance :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@aevedis there is a duckdb implementation here https://pypi.org/project/langgraph-checkpoint-duckdb/ |
Beta Was this translation helpful? Give feedback.
it's not only in memory, you can specify the file path, like
DuckDBSaver.from_conn_string("my_database.db")