AI / LangGraph LangChain Interview questions
How do you deploy LangGraph applications?
LangGraph applications can be deployed in three main ways: LangGraph Cloud (managed service), self-hosted with Docker + FastAPI, and embedded in a larger application. The right choice depends on your team's infrastructure requirements and SLA needs.
LangGraph Cloud — LangChain's managed deployment platform. You push your graph code to a GitHub repo, connect it to LangGraph Cloud, and it handles scaling, checkpointing (PostgreSQL), streaming, and monitoring automatically. Provides REST and WebSocket APIs out of the box.
Self-hosted FastAPI — wrap the compiled graph with a FastAPI app and use PostgresSaver for multi-process state:
from fastapi import FastAPI from langgraph.checkpoint.postgres.aio import AsyncPostgresSaver app = FastAPI() @app.on_event("startup") async def startup(): saver = await AsyncPostgresSaver.from_conn_string(DB_URL) global graph graph = graph_builder.compile(checkpointer=saver) @app.post("/chat/{thread_id}") async def chat(thread_id: str, message: str): config = {"configurable": {"thread_id": thread_id}} result = await graph.ainvoke({"messages": [HumanMessage(message)]}, config) return {"response": result["messages"][-1].content}
Containerise with Docker, expose via Kubernetes or a managed container service, and use LangSmith for production observability.
More Related questions...