Skip to content

Quickstart

Scaffold, install, and run a 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 ".[server,graph,llm,http]"      # install with extras
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 component

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 is the desktop IDE that builds the same graphs on a canvas and exports a Python project built on this SDK.