diff --git a/Dockerfile b/Dockerfile index 3c70efc..f9aa26d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,11 @@ FROM ghcr.io/astral-sh/uv:python3.12-bookworm # Install uv. COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv +# Install system dependencies including libpq +RUN apt-get update && apt-get install -y \ + libpq-dev \ + && rm -rf /var/lib/apt/lists/* + WORKDIR /app # Pre-cache the application dependencies. diff --git a/README.md b/README.md index ad7de29..784530f 100644 --- a/README.md +++ b/README.md @@ -392,11 +392,24 @@ This will enable trace visualization in LangGraph Studio and send your traces to 3. Supports saving and loading checkpoints for workflow execution. 4. Supports saving chat stream events for replaying conversations. -Note: +*Note: About langgraph issue #5557* The latest langgraph-checkpoint-postgres-2.0.23 have checkpointing issue, you can check the open issue:"TypeError: Object of type HumanMessage is not JSON serializable" [https://github.com/langchain-ai/langgraph/issues/5557]. To use postgres checkpoint you should install langgraph-checkpoint-postgres-2.0.21 +*Note: About psycopg dependencies* +Please read the following document before using postgres: https://www.psycopg.org/psycopg3/docs/basic/install.html + +BY default, psycopg needs libpq to be installed on your system. If you don't have libpq installed, you can install psycopg with the `binary` extra to include a statically linked version of libpq mannually: + +```bash +pip install psycopg[binary] +``` +This will install a self-contained package with all the libraries needed, but binary not supported for all platform, you check the supported platform : https://pypi.org/project/psycopg-binary/#files + +if not supported, you can select local-installation: https://www.psycopg.org/psycopg3/docs/basic/install.html#local-installation + + The default database and collection will be automatically created if not exists. Default database: checkpoing_db Default collection: checkpoint_writes_aio (langgraph checkpoint writes)