Langsmith Studio not showing state schema

Hi, I am returning a compiled state graph from this script as graph and it launches the server and shows the nodes and edges correctly and runs but in the input state it’s not able to recognize and render the state schema, which makes it harder to interact with. Am I missing something or is it a bug?

Currently the server is being run locally

The graph variable is an async method being called when file is loaded like. The graph state isn’t being loaded into this file directly instead a function is being loaded which creates compiled graph

export const graph = (async () => {
  await new Promise((resolve) => setTimeout(resolve, 3000));

  const compiledStateGraph = createGraph(props);

  return compiledStateGraph;
})();

Thank you

langgraph.json:

{
  "node_version": "22",
  "graphs": {
    "agent": "./scripts/studio/index.ts:graph"
  },
  "env": ".env",
  "dependencies": ["."],
  "image_distro": "wolfi"
}

Hi - thanks for reaching out! Can you share more on how you’re defining the state in createGraph? Are you using a state annotation, zod or something else? Use the graph API - Docs by LangChain

I’m using state annotation. example:

export const GraphState = Annotation.Root({
  question: Annotation<string>,
  generation: Annotation<string>,
  answer: Annotation<string>,
});
import { GraphState } from './state';

export const createGraph = () => {

  return new StateGraph(GraphState)
    .addNode
    ...
    .compile({ checkpointer });
}