Skip to content

IR v2 compiler

LangTailor saves agent workflows as IR v2 documents (*.langstitch.json with irVersion, logical, presentation, and target). The Python SDK compiles the logical graph into a runnable project — canvas layout in presentation is ignored at compile time.

Compile a LangTailor document

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 .
python -m app
langstitch run

The compiler writes:

  • application.yaml and env.yaml — same config shape as hand-authored SDK projects
  • Graph and node modules under app/
  • .langstitch-build-manifest.json — compiler version, IR node ids, emitted files

IR node ids survive compilation and appear in structured logs and dev run events.

Supported node kinds (python-langstitch)

start, end, llm, tool, router, function, response_transformer, custom (with a platform template).

Unsupported kinds (agent, rag, subgraph, and others) fail at compile time with a clear error — the compiler never silently drops graph elements.

Spec and conformance

The IR schema, RunEvent protocol, and conformance fixtures live in the langstitch-spec repository. LangTailor migrates v1 documents on load; saves always write v2.

The coordinated release uses shared spec 2.2.0, Python SDK 0.3.2, Spring AI compiler 0.2.2 and LangTailor 0.4.0. Java compilation is provided by the separate Spring AI compiler; native Go projects are exported by LangTailor. Go export does not require a separate Go SDK package.

Share graph topology and state field names while providing explicit native code in bodiesByPlatform. See the portable graph examples and release notes before selecting a target. Supported node kinds differ, and arbitrary Python source is not translated automatically to Java or Go.