Skip to content

Azure Functions LangGraph

PyPI Python Version CI License: MIT

Deploy LangGraph agents as Azure Functions HTTP endpoints with zero boilerplate.

Alpha Notice — This package is in early development (0.1.0a0). APIs may change without notice between releases.

What it does

  • Zero-boilerplate deployment — register a compiled graph, get HTTP endpoints automatically
  • Invoke endpointPOST /api/graphs/{name}/invoke for synchronous execution
  • Stream endpointPOST /api/graphs/{name}/stream for buffered SSE responses
  • Health endpointGET /api/health listing registered graphs with checkpointer status
  • Protocol-based — works with any object that has invoke() and stream() methods
  • Checkpointer pass-through — thread-based conversation state via LangGraph's native config

Quick example

from langgraph.graph import END, START, StateGraph
from typing_extensions import TypedDict

from azure_functions_langgraph import LangGraphApp


class AgentState(TypedDict):
    messages: list[dict[str, str]]


def chat(state: AgentState) -> dict:
    user_msg = state["messages"][-1]["content"]
    return {"messages": state["messages"] + [{"role": "assistant", "content": f"Echo: {user_msg}"}]}


builder = StateGraph(AgentState)
builder.add_node("chat", chat)
builder.add_edge(START, "chat")
builder.add_edge("chat", END)
graph = builder.compile()

app = LangGraphApp()
app.register(graph=graph, name="echo_agent")
func_app = app.function_app

This gives you:

  1. POST /api/graphs/echo_agent/invoke — invoke the agent
  2. POST /api/graphs/echo_agent/stream — stream agent responses (buffered SSE)
  3. GET /api/health — health check

Next steps

Ecosystem

Part of the Azure Functions Python DX Toolkit:

Package Role
azure-functions-validation Request and response validation
azure-functions-openapi OpenAPI spec and Swagger UI
azure-functions-logging Structured logging and observability
azure-functions-langgraph LangGraph agent deployment
azure-functions-durable-graph Manifest-first graph runtime with Durable Functions