LangStitch SDK
Multi-language agent SDK — two IR compilers shipping
One IR v2 contract, one canvas export, two runtimes you can install today: Python on PyPI (langstitch-sdk) and Spring AI on Maven Central (com.langstitch:langstitch-spring-ai). Go and Rust share the same layout and are expanding.
Pick the stack you ship in. Design once in LangTailor, compile with the matching IR compiler, run idiomatic Python LangGraph or Spring Boot + Spring AI.
Python
pip install "langstitch-sdk[compiler,server,graph]" langstitch compile graph.langstitch.json --out ./build --force
Spring AI (Java)
java -jar langstitch-spring-ai-0.2.0-all.jar \ compile graph.langstitch.json --out ./build --force
What you get
Two IR compilers
langstitch compile (Python) and langstitch-spring-ai compile (Java) both read the same *.langstitch.json IR and emit runnable projects for their stack.
Shared contracts
application.yaml, graph semantics, skills/guardrails layout, and LangTailor canvas export stay aligned across languages.
Python runtime
Decorators, typed YAML, GraphBuilder → LangGraph, MCP, A2A, HITL, FastAPI server, and the langstitch CLI.
Spring AI runtime
IR → Spring Boot 3.4 + Spring AI Maven project with graph controller, node classes, and AI config — via Maven Central or LangTailor Spring AI export.
Canvas round-trip
Design in LangTailor, export Python or Spring AI, keep iterating in code. Go and Rust follow as those compilers land.
Capability honesty
Each runtime publishes a capability matrix — unsupported node kinds fail loudly at compile time instead of generating broken stubs.
Design principles
- Language-agnostic contracts. Graphs, skills, guardrails, and
application.yamldescribe behavior once; each runtime implements the same structure in idiomatic code. - Compiler per runtime. Python and Spring AI each ship a first-class IR compiler — not a thin wrapper around the other language.
- Convention over configuration. Scaffolded / compiled projects give every concept a clear package layout so imports and codegen stay predictable.
- Declarative first. Behavior lives in IR + YAML (+ idiomatic code), so the same description powers the SDK, LangTailor, and multi-language codegen.
Runtimes
Pick the runtime that matches your stack. Both shipping compilers consume the same IR v2 documents LangTailor saves from the canvas.
Python
Available · PyPI 0.3.0Full runtime: decorators, typed YAML, LangGraph, MCP, guardrails, A2A, and langstitch CLI + IR compiler.
pip install langstitch-sdk
Spring AI (Java)
Available · Maven Central 0.2.0IR v2 → Spring Boot + Spring AI Maven project. LLM, router, function, tool, response_transformer supported. Also exportable from LangTailor as Spring AI (Java).
com.langstitch:langstitch-spring-ai:0.2.0
Go
ExpandingSame IR + project conventions as Python/Spring AI exports. Compiler and modules on the roadmap.
Rust
ExpandingSame canvas round-trip target. Crates and IR compiler expanding on the shared layout.
Install
Two packages, two package managers — install the runtime you need (or both).
Python · PyPI
- Python 3.10–3.13
- pip / uv / poetry in a venv
pip install langstitch-sdk pip install "langstitch-sdk[compiler,server,graph,llm,http]" langstitch version
Or in pyproject.toml: langstitch-sdk>=0.3.0
Spring AI · Maven Central
- Java 21+
- Maven 3.9+
<dependency> <groupId>com.langstitch</groupId> <artifactId>langstitch-spring-ai</artifactId> <version>0.2.0</version> </dependency>
# Runnable fat CLI (classifier: all) mvn -q org.apache.maven.plugins:maven-dependency-plugin:3.8.1:copy \ -Dartifact=com.langstitch:langstitch-spring-ai:0.2.0:jar:all \ -DoutputDirectory=. java -jar langstitch-spring-ai-0.2.0-all.jar version
Spring AI (Java)
langstitch-spring-ai is the IR v2 compiler for Spring Boot + Spring AI.
Artifact: com.langstitch:langstitch-spring-ai:0.2.0
· Source: GitHub
· LangTailor export format: Spring AI (Java)
langstitch compile or langstitch-spring-ai compile) — not when you browse or acquire from the catalog.
Connector manifests ship codegen.templates["python-langstitch"] and codegen.templates["spring-ai"].
Compile IR → Spring AI project
java -jar langstitch-spring-ai-0.2.0-all.jar \ compile my_graph.langstitch.json --out my_graph-spring --force cd my_graph-spring mvn -q test mvn -q spring-boot:run
CLI protocol (same shape as other LangStitch compilers):
langstitch-spring-ai compile <document.langstitch.json> --out <dir> [--force] langstitch-spring-ai capabilities langstitch-spring-ai version
LangTailor discovers the CLI via PATH, LANGSTITCH_SPRING_AI_JAR, or a sibling *-all.jar. If the Java CLI is unavailable, the canvas can still emit a Spring AI project via its TypeScript fallback exporter.
Maven install
<dependency> <groupId>com.langstitch</groupId> <artifactId>langstitch-spring-ai</artifactId> <version>0.2.0</version> </dependency>
Generated project layout
application.yaml # includes mcp.servers when IR has mcpServers env.yaml pom.xml .langstitch-build-manifest.json src/main/java/com/langstitch/<pkg>/ Application.java GraphState.java graph/MainGraph.java nodes/*.java mcp/McpToolClient.java # when logical.mcpServers is present config/AiConfig.java web/GraphController.java src/main/resources/application.yml
Capability matrix (0.2.0)
| Area | Status |
|---|---|
start, end, llm, tool, router, function, response_transformer | Supported |
MCP (logical.mcpServers + tool connectionType: mcp) | Supported |
LLM boundToolIds | Supported (wired to MCP client when present) |
Marketplace connectors (custom + codegen.templates["spring-ai"]) | Template-required |
subgraph, agent, rag, intent_classifier, hitl | Unsupported (fail loudly) |
| Streaming / RunEvents | Supported |
| Reverse-sync / A2A / checkpointing | Planned / unsupported |
Python runtime
Everything below documents the Python package langstitch-sdk on PyPI — decorators, LangGraph runtime, FastAPI server, and langstitch CLI.
For Spring AI, see Spring AI (Java).
Python extras
| Extra | Pulls in | Enables |
|---|---|---|
(core) | PyYAML | decorators, config, registries, context, CLI scaffold |
server | fastapi, uvicorn | langstitch run, create_app() (/health, /info, /invoke) |
graph | langgraph, langchain-core | GraphBuilder.compile() → real StateGraph |
llm | langchain | get_llm_provider() (+ a provider, e.g. langchain-openai) |
http | httpx | get_http_client() / external services |
tracing | langsmith | configure_tracing(), register_graph, langstitch register |
compiler | IR compile deps | langstitch compile IR → Python project |
all | all of the above | everything |
Python quickstart
Scaffold, install, and run a Python LangStitch agent in a couple of minutes.
langstitch new my-agent # scaffold cd my-agent python -m venv .venv && . .venv/bin/activate # (Windows: .venv\Scripts\activate) pip install -e . # editable install (add extras as needed) python -m app # bootstrap + print registered components (JSON) pytest -q # run the generated smoke tests langstitch run # start the API server
The server exposes:
GET /health— livenessGET /info— registered componentsPOST /invoke— run the entrypoint graph
curl -s localhost:8000/info | python -m json.tool
curl -s -X POST localhost:8000/invoke \
-H 'content-type: application/json' \
-d '{"messages": [{"role": "user", "content": "hi"}]}'Your first Python project
Every decorator works bare or parameterized and registers at import time.
from langstitch import skill
@skill
def echo(text: str) -> str:
return text
@skill(name="search", tools=["web"], tags=["retrieval"])
def web_search(query: str) -> list[str]:
...Build and run a graph in code
from langstitch import LangStitchApp
app = LangStitchApp.bootstrap()
graph = app.build_graph() # compiles to a LangGraph StateGraph
result = app.invoke({"messages": [{"role": "user", "content": "hi"}]})
print(result)Python project structure
langstitch new generates a conventional layout where every concept gets its own package. A single import app wires up the whole application. For Spring AI layout, see generated Spring AI layout.
my-agent/
application.yaml # application config (or precompiled application.json)
env.yaml # runtime environment variables (gitignored in real projects)
pyproject.toml # depends on langstitch; your package is "app"
app/
__init__.py # imports submodules so decorators register on import
graphs/ # @graph — main graph (main.py) + subgraphs
nodes/ # @graph_node — node handlers (state -> dict)
skills/ # @skill
guardrails/ # @input_guardrail / @output_guardrail
policies/ # @business_policy
personas/ # @persona
tools/ # @tool
agents/ # @worker_agent
mcp/ # @langstitch_mcp_server + @mcp_tool/resource/prompt
config.py # @configuration — typed application.yaml sections
state.py # graph state schema (TypedDict)
main.py # @langstitch_graph_server — server + bootstrap()
tests/ # smoke testsHow registration works
Decorators record a spec on a process-global registry at import time. app/__init__.py imports every submodule, so a single import app wires up the whole application.
# app/__init__.py from . import graphs, nodes, skills, guardrails, policies from . import personas, tools, agents, mcp, config
import app stays fast — the actual work happens when a node runs.
The two config files
| File | Purpose |
|---|---|
application.yaml | Declarative app config (metadata, model, graph, server, custom sections). Precompile to application.json for production. |
env.yaml | Runtime env vars exported into os.environ at startup. Nested keys flatten to UPPER_SNAKE (openai.api_key → OPENAI_API_KEY). Keep it out of version control. |
Decorators & registration
LangStitch describes an application as a set of decorated functions and classes. Each decorator records a lightweight spec on a process-global registry at import time; nothing heavy is instantiated until a node actually needs it.
The decorator catalog
| Decorator | Purpose |
|---|---|
@graph_node | Register a node handler (state -> dict). |
@graph | Register a graph builder (entrypoint=True for the root, parent=... for subgraphs). |
@skill | Register a reusable capability. |
@input_guardrail / @output_guardrail | Validate inbound requests / outbound responses. |
@business_policy | Register an organizational rule (evaluated by priority). |
@persona | Register an agent identity / system prompt. |
@configuration | Bind a section of application.yaml to a dataclass. |
@langstitch_graph_server | Turn a class into a runnable graph API server. |
@tool | Register a callable an LLM can invoke (roles, tags, input_schema). |
@worker_agent | Register a delegatable local sub-agent (role, tools, persona). |
@agent | Register a delegatable agent of any transport (local / remote / a2a), with roles for delegation RBAC. |
@supervisor | Register a router over member agents (router="llm" or "custom"). |
@langstitch_mcp_server | Mark the MCP server class + transport. |
@mcp_tool / @mcp_resource / @mcp_prompt | Expose MCP tools, resources, and prompts. |
@langstitch_a2a_server | Publish the app as an A2A agent behind auth + RBAC. |
@a2a_skill / @a2a_agent / @a2a_authenticator | Advertise A2A skills, declare remote peers, or plug in a custom credential verifier. |
Worked example
from langstitch import (
graph, graph_node, skill, persona,
input_guardrail, business_policy,
tool, langstitch_graph_server, GraphBuilder, END,
)
@persona(role="assistant", tone="helpful, concise")
def assistant() -> str:
return "You are a helpful LangStitch support assistant."
@tool(tags=["billing"], roles=["agent"])
def lookup_invoice(invoice_id: str) -> dict:
"""Fetch an invoice by id."""
...
@input_guardrail(description="Reject empty/oversized input.", action="block")
def non_empty(text: str) -> bool:
return bool(text and 0 < len(text) <= 8000)
@business_policy(priority=100, description="Deny refunds over policy limit.")
def refund_limit(context: dict) -> dict:
amount = context.get("amount", 0)
return {"decision": "deny" if amount > 1000 else "allow"}
@graph_node(description="Answer the latest message.")
def respond(state: dict) -> dict:
return {"response": "...", "messages": [...]}
@graph(name="main", entrypoint=True)
def main_graph() -> GraphBuilder:
g = GraphBuilder("main")
g.add_node("respond", respond)
g.set_entry_point("respond")
g.add_edge("respond", END)
return g
@langstitch_graph_server(name="my-agent", protocol="http", port=8000)
class Server:
"""Graph API server."""app/__init__.py. If a component is missing from langstitch info, its module almost certainly wasn't imported.
Configuration & secrets
Configuration is declarative. application.yaml holds app metadata, the model, graph, server, and any custom sections; env.yaml holds runtime environment variables. Secrets always resolve from the environment — never inlined in code.
load_config & get_config
At startup load_config() parses the application config once into an in-memory store. Use get_config(path) (or the CLI) for JSON-path-lite lookups — dotted keys, [index], optional defaults:
from langstitch import load_config, get_config
cfg = load_config() # loads env.yaml then application config
get_config("server.port") # -> 8000
get_config("model") # -> {...}
get_config("missing.key", default="fallback")
get_config("server", as_json=True)
# CLI equivalents:
# langstitch get server.port
# langstitch get external_services.billing.auth.typeTyped sections
Bind a section of application.yaml to a dataclass with @configuration, so settings are validated and typed where you use them.
from dataclasses import dataclass
from langstitch import configuration
@configuration(section="server")
@dataclass
class ServerConfig:
host: str = "0.0.0.0"
port: int = 8000env.yaml, nested keys flatten to UPPER_SNAKE and are exported into os.environ at startup — e.g. openai.api_key becomes OPENAI_API_KEY.
Graphs & nodes
A node is a function from state to a partial state update (state -> dict); a graph wires nodes together and compiles to a real LangGraph StateGraph.
from langstitch import graph, graph_node, GraphBuilder, END
@graph_node
def respond(state: dict) -> dict:
return {"response": "hello"}
@graph(name="main", entrypoint=True)
def main_graph() -> GraphBuilder:
g = GraphBuilder("main")
g.add_node("respond", respond)
g.set_entry_point("respond")
g.add_edge("respond", END)
return g- Mark exactly one graph
entrypoint=True— it's the graph the server invokes. - Create subgraphs with
@graph(parent="main")and compose them like nodes. GraphBuilder.compile()(via thegraphextra) returns a LangGraphStateGraphyou can run anywhere.
Multi-agent systems
Agents register as AgentSpec records and are delegated to uniformly via run_agent, regardless of transport. RBAC roles gate who may delegate; remote/A2A auth reuses the services layer.
@agent & run_agent
from langstitch import agent, remote_agent, run_agent
@agent(tools=["web"], roles=["analyst"])
def researcher(state: dict) -> dict:
return {"findings": "..."}
# Remote graph (HTTP /invoke) — auth via an external_services entry:
remote_agent("legal", url="/invoke", service="legal_svc", roles=["counsel"])
# A2A peer — url is the Agent Card:
agent(name="billing", transport="a2a",
url="https://billing/.well-known/agent.json", service="billing_a2a")
out = run_agent({"input": "review contract"}, "legal", caller_roles=["counsel"])@supervisor
Route over member agents with an LLM or a custom function. Members return control until the supervisor routes to finish (defaults to END).
from langstitch import supervisor, get_supervisor
@supervisor(agents=["researcher", "legal"], router="custom")
def triage(state) -> str:
return "legal" if state.get("contract") else "researcher"
team = get_supervisor("triage").build()
graph = team.compile() # needs the graph extraHandoffs (swarm)
from langstitch import graph_node, handoff, make_handoff_tool
@graph_node
def intake(state):
return handoff("billing", update={"reason": "refund"})
transfer = make_handoff_tool("legal") # LLM-invokable handoff toolhandoff() and supervisor routing build LangGraph Command objects and need the graph extra; the decorators and routing decisions work without it.
Agent-to-Agent (A2A)
Publish your app as an A2A agent and consume peers — reusing the same auth and RBAC layers as the rest of the SDK.
Publish
from langstitch import langstitch_a2a_server, a2a_skill
@langstitch_a2a_server(title="Billing Agent", url="https://billing.acme.com/")
class BillingAgent:
...
@a2a_skill(skill_id="refund", roles=["billing"], tags=["payments"])
def refund(state: dict) -> dict:
caller = state["a2a_identity"]["subject"]
return {"output": f"refund processed for {caller}"}Configure a2a.server auth (bearer / api_key token table) and RBAC in YAML. For IdPs, plug in @a2a_authenticator.
Consume
from langstitch import a2a_agent, a2a_client, invoke_a2a_agent
a2a_agent("orders",
agent_card_url="https://orders.acme.com/.well-known/agent.json",
service="orders_a2a", roles=["billing"])
result = invoke_a2a_agent("create order #42", agent="orders", skill_id="create")
with a2a_client("orders") as client:
reply = client.send_message("status of #42", skill_id="status")Human interrupt (HITL)
Pause graph execution and surface a payload to a human reviewer. human_interrupt wraps LangGraph's interrupt; when the graph resumes via Command(resume=...), the human's value is returned to the node.
from langstitch import human_interrupt, graph_node
@graph_node
def review(state: dict) -> dict:
decision = human_interrupt({"question": "Approve?", "draft": state["draft"]})
return {"approved": decision == "yes"}Requires the graph extra. Import stays cheap — LangGraph loads only when the helper is called.
Tracing & LangSmith
Optional observability via langstitch.tracing — install pip install "langstitch-sdk[tracing]" (pulls in LangSmith).
# application.yaml tracing: enabled: true project: my-agent-project log_format: json # text | json register_on_build: true # upsert LangSmith project on build_graph() trace_nodes: true
from langstitch import LangStitchApp, configure_tracing, register_graph configure_tracing() app = LangStitchApp.bootstrap() app.build_graph() # registers entrypoint when tracing.register_on_build is true
Environment variables (LANGSMITH_API_KEY, LANGCHAIN_TRACING_V2, LANGCHAIN_PROJECT) apply automatically when tracing is enabled. Or register from the CLI:
langstitch register # register entrypoint graph langstitch register --describe-only # metadata only, no LangGraph compile
Context & registries
Decorators register specs on a process-global registry at import time. At runtime, every LLM call and sub-agent invocation runs in an isolated child scope: only the final output merges back into the parent, so parent state stays small and predictable.
- Look up registered components by name from the registry (the same data
langstitch infoprints). - Child scopes keep intermediate reasoning out of the parent's state.
- Because registration is deterministic and import-time, the registry is reproducible across processes.
External services
Declare downstream HTTP services in application.yaml with auth and header propagation, then call them through a typed client (the http extra provides get_http_client()).
external_services:
billing:
serverUrl: https://billing.internal
basePath: /v1
timeout: 30
propagate_headers: [x-request-id]
auth:
type: bearer
token: ${BILLING_TOKEN}from langstitch import get_http_client
client = get_http_client("billing")
resp = client.get("/invoices/42")Guardrails, policies & personas
- Guardrails —
@input_guardrailvalidates inbound requests and@output_guardrailvalidates outbound responses. Useaction="block"to reject. - Business policies —
@business_policy(priority=...)encodes organizational rules, evaluated in priority order, returning an allow/deny decision. - Personas —
@persona(role=..., tone=...)defines an agent identity / system prompt reused across nodes and agents.
from langstitch import input_guardrail, business_policy, persona
@input_guardrail(description="Reject empty input.", action="block")
def non_empty(text: str) -> bool:
return bool(text and len(text) <= 8000)
@business_policy(priority=100, description="Refund limit.")
def refund_limit(context: dict) -> dict:
return {"decision": "deny" if context.get("amount", 0) > 1000 else "allow"}
@persona(role="assistant", tone="helpful, concise")
def assistant() -> str:
return "You are a helpful assistant."MCP servers
Expose tools, resources, and prompts over the Model Context Protocol so any MCP client can use your capabilities.
from langstitch import (
langstitch_mcp_server, mcp_tool, mcp_resource, mcp_prompt,
)
@langstitch_mcp_server(protocol="stdio")
class MyServer:
"""Project MCP server."""
@mcp_tool(name="search", description="Search the knowledge base.")
def search(query: str) -> list[str]:
...
@mcp_resource(name="readme", uri="file:///README.md", mime_type="text/markdown")
def readme() -> str:
...
@mcp_prompt(name="summarize", description="Summarize a document.")
def summarize(text: str) -> str:
...Build & run
During development, bootstrap the app to verify registration, run the smoke tests, then start the server.
python -m app # bootstrap + print every registered component as JSON pytest -q # run generated smoke tests langstitch info # load config + list components langstitch run # start the FastAPI server (/health, /info, /invoke)
To run the compiled graph directly in code:
from langstitch import LangStitchApp
app = LangStitchApp.bootstrap()
result = app.invoke({"messages": [{"role": "user", "content": "hi"}]})IR v2 compilers
LangTailor saves agent workflows as IR v2 documents (*.langstitch.json with irVersion, logical, presentation, and target). Choose the compiler that matches target.platform — canvas layout is ignored at compile time.
Python · langstitch compile
pip install "langstitch-sdk[compiler,server,graph]" langstitch compile my_graph.langstitch.json --out my_graph-build --force cd my_graph-build && pip install -e . && langstitch run
Spring AI · langstitch-spring-ai compile
java -jar langstitch-spring-ai-0.2.0-all.jar \ compile my_graph.langstitch.json --out my_graph-spring --force cd my_graph-spring && mvn spring-boot:run
Both compilers write application.yaml, env.yaml, graph modules, and .langstitch-build-manifest.json. IR node ids survive compilation and appear in logs and run events.
Dev run events
When debugging locally, enable the RunEvent SSE stream so LangTailor (or any dev client) can visualize graph execution. This is development-only — the endpoint is not mounted unless explicitly enabled.
export LANGSTITCH_DEV_EVENTS=1
export LANGSTITCH_API_KEY=dev
langstitch run
# GET /runs/{run_id}/events (localhost SSE; per-run seq numbers)LangTailor's Build and Run commands set these variables automatically in the integrated terminal. Production deployments should leave LANGSTITCH_DEV_EVENTS unset.
Production
- Precompile config. Run
langstitch compilewith no document argument to turnapplication.yamlintoapplication.json; when present, the JSON loads directly and takes precedence for fast, deterministic startup. - Keep RunEvents off. Do not set
LANGSTITCH_DEV_EVENTSin production — invoke paths stay lean when dev events are disabled. - Keep the core light. Install only the extras you need (
server,graph,llm,http) so images stay small. - Secrets from the environment. Never inline credentials — provide them via the environment (or your orchestrator's secret store).
- Pin versions. Pin
langstitch-sdkand your provider packages inpyproject.toml.
Deployment (Python)
A Python LangStitch app is an ordinary service. Containerize it, set the environment, and expose the server port. Spring AI projects deploy as standard Spring Boot apps (mvn spring-boot:run / containerized JAR).
FROM python:3.13-slim WORKDIR /app COPY . . RUN pip install --no-cache-dir ".[server,graph,llm,http]" \ && langstitch compile EXPOSE 8000 CMD ["langstitch", "run", "--host", "0.0.0.0", "--port", "8000"]
CLI reference
Python · langstitch
Scaffolds, inspects, compiles, and runs Python projects.
langstitch new <name> [--dir PATH] [--force] scaffold an Agentic Development project langstitch plugin new <name> [--dir PATH] [--force] scaffold a Plugin Creator pack project langstitch pack [--root PATH] [--out DIR] [--document PATH] [--platforms LIST] build a .langstitch-pack.zip (fail-closed; use --allow-partial to skip missing platforms) langstitch validate-pack [--root PATH] [--document PATH] validate pack manifests + IR before publish langstitch info [--root PATH] load config + list components langstitch run [--root PATH] [--host] [--port] start the API server langstitch register [--root PATH] [--describe-only] LangSmith graph registration langstitch compile [document.langstitch.json] [--out DIR] [--force] IR v2 -> Python project (or config precompile) langstitch get <json.path> [--root PATH] resolve a config path, print as JSON langstitch version print the SDK version
Spring AI · langstitch-spring-ai
langstitch-spring-ai compile <document.langstitch.json> --out <dir> [--force] langstitch-spring-ai capabilities langstitch-spring-ai version
See Spring AI docs for Maven Central install and generated layout.
| Command | What it does |
|---|---|
new | Scaffold a new Agentic Development project with the conventional structure. |
plugin new | Scaffold a Plugin Creator pack project (langstitch.project.json with kind: plugin-creator). |
pack | Build a multi-platform .langstitch-pack.zip from a Plugin Creator project. Fails closed on validation errors; pass --allow-partial to emit a zip when some platform artifacts are missing. |
validate-pack | Validate pack manifests, IR, and per-platform templates without writing a zip. |
info | Load configuration and list every registered component. |
run | Start the FastAPI server (requires the server extra). |
register [--describe-only] | Register the entrypoint graph with LangSmith (requires the tracing extra). --describe-only skips LangGraph compile. |
compile [document] | With a *.langstitch.json IR v2 document: emit a Python project to --out (requires compiler extra). Without a document: precompile application.yaml → application.json. |
get | Resolve a JSON-path and print the result as JSON. |
version | Print the installed SDK version. |
API reference
The public API is the decorator catalog plus runtime helpers: LangStitchApp, GraphBuilder, END, load_config / get_config, get_llm_provider, get_http_client, run_agent, handoff, human_interrupt, configure_tracing / register_graph, and A2A clients. Exhaustive signatures ship with the package on PyPI.
pip install langstitch-sdk
python -c "help('langstitch')"See the full distribution on PyPI, or browse the source on GitHub.
Troubleshooting
| Symptom | Fix |
|---|---|
A component is missing from langstitch info | Its module wasn't imported. Make sure it's reachable from app/__init__.py. |
ImportError mentioning an extra | Install the extra it names, e.g. pip install "langstitch-sdk[graph]". |
langstitch run not found / fails | Install the server extra: pip install "langstitch-sdk[server]". |
Secrets resolve to None | Set them in the environment (or env.yaml); never inline them in code. |
| RunEvents not available in production | Expected — set LANGSTITCH_DEV_EVENTS=1 only for local debugging. |
| Slow startup in production | Run langstitch compile (no document) and ship application.json. |
Still stuck? Email connect@langstitch.com for support, or ask about training. You can also open an issue on GitHub.