Skip to content

6.1 Create a deployment ​

This chapter reorganizes the upstream notebook and Python implementation into a web lesson. The teaching notes were prepared for this site with a matching Chinese edition.

Source notebook · Python implementation and configuration

Version and environment

Code follows the upstream snapshot dated 2025-10-12, not a compatibility promise for current SDKs. Original code cells appear below in notebook order, including Jupyter magic such as %pip / %%capture; execute them separately in a notebook. Configure credentials locally, never in a web page or Git. This site renders lessons; the paid model calls and Docker exercises have not been executed here.

Package the application ​

The deployment folder contains langgraph.json, task_maistro.py, configuration.py, requirements.txt and a Compose example. The JSON maps task_maistro to its graph implementation; dependencies and environment settings complete the server package.

Build and start services ​

The historical workflow installs langgraph-cli and runs langgraph build -t my-image from module-6/deployment. Copy docker-compose-example.yml to docker-compose.yml, set the image field (my-image by default) and the required provider credentials privately, then run docker compose up. Docker must already be available.

Server, Redis and PostgreSQL ​

The example launches API, Redis and PostgreSQL containers. Port 8123 exposes the API and /docs. Graph execution is separate from hosting these static lessons on Vercel: publishing the website does not deploy this Python service. Check current LangGraph licensing and CLI requirements before reproducing this historical setup.

sh
cd module-6/deployment
cp docker-compose-example.yml docker-compose.yml
langgraph build -t my-image
# Configure the image field and credentials locally before starting services.
docker compose up

Original code cells ​

Comments and identifiers remain as supplied upstream. Cells share variables from earlier cells; saved outputs and historical screenshots are not results from this website.

Cell 1 ​

python
%%capture --no-stderr
%pip install -U langgraph-cli

Practice and checks ​

Inspect langgraph.json and confirm its graph entry resolves. After starting your own server, open /docs and check container health; do not interpret a successful website build as a successful agent deployment.

For the full original narrative, saved outputs and diagrams, consult the notebook.

English translation of community learning materials. MIT licensed.