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.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
