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 0.3.0 · PyPI Spring AI 0.2.0 · Maven Central Go · expanding Rust · expanding

Python

pip install "langstitch-sdk[compiler,server,graph]"
langstitch compile graph.langstitch.json --out ./build --force
Python runtime guide →

Spring AI (Java)

java -jar langstitch-spring-ai-0.2.0-all.jar \
  compile graph.langstitch.json --out ./build --force
Spring AI guide →

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.yaml describe 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.
LangStitch vs LangTailor LangStitch SDK is the multi-language runtime + IR compiler family. LangTailor is the IDE that designs graphs visually and exports Python or Spring AI projects on these contracts.

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.0

Full runtime: decorators, typed YAML, LangGraph, MCP, guardrails, A2A, and langstitch CLI + IR compiler.

pip install langstitch-sdk

Python docs → PyPI →

Spring AI (Java)

Available · Maven Central 0.2.0

IR 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

Spring AI docs → Maven Central →

Go

Expanding

Same IR + project conventions as Python/Spring AI exports. Compiler and modules on the roadmap.

Rust

Expanding

Same canvas round-trip target. Crates and IR compiler expanding on the shared layout.

Visual export path LangTailor exports Python or Spring AI (Java) today from the same IR document. Go and Rust share the export tree as those compilers land.

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

Python extras & runtime →

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 compile guide →

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)

Marketplace catalog vs compile target Connectors, MCP packs, agents, graphs, personas, prompts, and multi-platform packs sync as IR and artifacts. Python vs Spring AI is chosen at compile time (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)

AreaStatus
start, end, llm, tool, router, function, response_transformerSupported
MCP (logical.mcpServers + tool connectionType: mcp)Supported
LLM boundToolIdsSupported (wired to MCP client when present)
Marketplace connectors (custom + codegen.templates["spring-ai"])Template-required
subgraph, agent, rag, intent_classifier, hitlUnsupported (fail loudly)
Streaming / RunEventsSupported
Reverse-sync / A2A / checkpointingPlanned / 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

ExtraPulls inEnables
(core)PyYAMLdecorators, config, registries, context, CLI scaffold
serverfastapi, uvicornlangstitch run, create_app() (/health, /info, /invoke)
graphlanggraph, langchain-coreGraphBuilder.compile() → real StateGraph
llmlangchainget_llm_provider() (+ a provider, e.g. langchain-openai)
httphttpxget_http_client() / external services
tracinglangsmithconfigure_tracing(), register_graph, langstitch register
compilerIR compile depslangstitch compile IR → Python project
allall of the aboveeverything
Lazy imports by design Each helper imports its dependency lazily and raises a clear, actionable error if the extra is missing — so the core stays light and importable in CI and tooling.

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 — liveness
  • GET /info — registered components
  • POST /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)
Prefer designing visually? LangTailor builds the same graphs on a canvas and exports projects on this SDK — Python on PyPI and Spring AI on Maven Central; Go and Rust expanding.

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 tests

How 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
Keep decorated modules import-safe Don't do network or file I/O at module scope. Registration should be cheap and deterministic so import app stays fast — the actual work happens when a node runs.

The two config files

FilePurpose
application.yamlDeclarative app config (metadata, model, graph, server, custom sections). Precompile to application.json for production.
env.yamlRuntime env vars exported into os.environ at startup. Nested keys flatten to UPPER_SNAKE (openai.api_keyOPENAI_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

DecoratorPurpose
@graph_nodeRegister a node handler (state -> dict).
@graphRegister a graph builder (entrypoint=True for the root, parent=... for subgraphs).
@skillRegister a reusable capability.
@input_guardrail / @output_guardrailValidate inbound requests / outbound responses.
@business_policyRegister an organizational rule (evaluated by priority).
@personaRegister an agent identity / system prompt.
@configurationBind a section of application.yaml to a dataclass.
@langstitch_graph_serverTurn a class into a runnable graph API server.
@toolRegister a callable an LLM can invoke (roles, tags, input_schema).
@worker_agentRegister a delegatable local sub-agent (role, tools, persona).
@agentRegister a delegatable agent of any transport (local / remote / a2a), with roles for delegation RBAC.
@supervisorRegister a router over member agents (router="llm" or "custom").
@langstitch_mcp_serverMark the MCP server class + transport.
@mcp_tool / @mcp_resource / @mcp_promptExpose MCP tools, resources, and prompts.
@langstitch_a2a_serverPublish the app as an A2A agent behind auth + RBAC.
@a2a_skill / @a2a_agent / @a2a_authenticatorAdvertise 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."""
Registration is import-time A decorator runs when its module is imported, so make sure each module is reachable from 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.type

Typed 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 = 8000
Environment mapping In env.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 the graph extra) returns a LangGraph StateGraph you 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 extra

Handoffs (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 tool

handoff() 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 info prints).
  • 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_guardrail validates inbound requests and @output_guardrail validates outbound responses. Use action="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
Full Spring AI guide →

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.

Spec & conformance The IR schema, RunEvent protocol, capability matrices, and fixtures live in langstitch-spec. Unsupported node kinds fail at compile time with a clear error.

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 compile with no document argument to turn application.yaml into application.json; when present, the JSON loads directly and takes precedence for fast, deterministic startup.
  • Keep RunEvents off. Do not set LANGSTITCH_DEV_EVENTS in 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-sdk and your provider packages in pyproject.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"]
Need Docker Compose + Helm? LangTailor can export a full bundle (Dockerfile, Compose, and a Helm chart) for a graph designed on the canvas — Python and Spring AI today; Go and Rust deploy targets follow the same layout as they expand.

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.

CommandWhat it does
newScaffold a new Agentic Development project with the conventional structure.
plugin newScaffold a Plugin Creator pack project (langstitch.project.json with kind: plugin-creator).
packBuild 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-packValidate pack manifests, IR, and per-platform templates without writing a zip.
infoLoad configuration and list every registered component.
runStart 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.yamlapplication.json.
getResolve a JSON-path and print the result as JSON.
versionPrint 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

SymptomFix
A component is missing from langstitch infoIts module wasn't imported. Make sure it's reachable from app/__init__.py.
ImportError mentioning an extraInstall the extra it names, e.g. pip install "langstitch-sdk[graph]".
langstitch run not found / failsInstall the server extra: pip install "langstitch-sdk[server]".
Secrets resolve to NoneSet them in the environment (or env.yaml); never inline them in code.
RunEvents not available in productionExpected — set LANGSTITCH_DEV_EVENTS=1 only for local debugging.
Slow startup in productionRun 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.

Privacy

Analytics & cookies

How LangStitch uses first-party analytics on this site.

Overview

LangStitch runs first-party analytics on our public sites to understand how visitors use pages and features. We do not use third-party ad trackers or sell visitor data.

What we collect (with consent)

Your choices

Accept or decline analytics in the cookie banner. If you decline, we do not set tracking cookies or record browsing events. You can clear site data in your browser to reset your choice.

Data requests

Email connect@langstitch.com to ask about your data or request deletion.

Last updated: July 2026