chore: sync langgraph docs from langchain-ai/docs#2
Conversation
749da2b to
4bbb781
Compare
There was a problem hiding this comment.
Pull request overview
Automated synchronization of LangGraph documentation content from langchain-ai/docs into this repo’s src/oss/langgraph/ docs set.
Changes:
- Sync MDX pages (UI, Studio, Quickstart, Observability, Deploy, Durable execution, and frontend graph execution docs).
- Update several embedded code/documentation snippets and callout languages.
- Remove the existing
README.mdcontent.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| ui.mdx | Updates snippet import/render for the Agent Chat UI page. |
| studio.mdx | Minor text change in Studio setup page intro. |
| quickstart.mdx | Updates referenced model version string in the quickstart narrative. |
| observability.mdx | Updates code fence language and modifies a TypeScript invocation example. |
| frontend/graph-execution.mdx | Changes callout language marker near the useStream setup section. |
| durable-execution.mdx | Alters numbering of an ordered list item in requirements. |
| deploy.mdx | Modifies the REST API curl example and adds an inline comment in the payload. |
| agentic-rag.mdx | Changes TypeScript imports and the StateGraph state identifier in an example. |
| README.md | Removes the existing single-line header content. |
Comments suppressed due to low confidence (1)
observability.mdx:161
- This TypeScript example is syntactically invalid:
config: { ... }cannot appear as a standalone argument; the second parameter toagent.invokeshould be an object literal (e.g.,{ tags: ..., metadata: ... }) or whatever the API expects. As written, the snippet will not compile/run.
await agent.invoke(
{
messages: [{role: "user", content: "Send a test email to alice@example.com"}]
},
config: {
tags: ["production", "email-assistant", "v1.0"],
metadata: {
userId: "user123",
sessionId: "session456",
environment: "production"
}
},
);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| `getMessagesMetadata` (for identifying which node produced each token). | ||
|
|
||
| :::js | ||
| :::python |
There was a problem hiding this comment.
This callout is marked :::python, but the content and surrounding text are TypeScript/JS (useStream, TypeScript interface, import type ...). Update the callout language to :::js (or :::ts if supported) so the docs render correctly.
| :::python | |
| :::ts |
There was a problem hiding this comment.
@copilot why is this typescript? What is this front-end mdx
There was a problem hiding this comment.
Good catch — this section is in frontend/graph-execution.mdx, which documents frontend usage (@langchain/react / @langchain/vue) and includes typed useStream examples, so the callout should be TypeScript. I fixed the callout language from python to ts in commit 6703eeb.
| curl -s --request POST \ | ||
| --url <DEPLOYMENT_URL>/runs/stream \ | ||
| --header 'Content-Type: application/json' \ | ||
| --header "X-Api-Key: <LANGSMITH API KEY>" \ | ||
| --header "X-Api-Key: <LANGSMITH API KEY> \ | ||
| --data "{ | ||
| \"assistant_id\": \"agent\", | ||
| \"assistant_id\": \"agent\", `# Name of agent. Defined in langgraph.json.` | ||
| \"input\": { |
There was a problem hiding this comment.
The REST curl example is broken: the X-Api-Key header line is missing its closing quote and trailing \, and the JSON payload contains an inline backtick comment that will make the request body invalid JSON. Please restore valid shell quoting and keep comments outside the JSON string.
| import { StateGraph, START, END, ConditionalEdgeRouter } from "@langchain/langgraph"; | ||
| import { ToolNode } from "@langchain/langgraph/prebuilt"; | ||
| import { AIMessage } from "@langchain/core/messages"; | ||
| import { AIMessage } from "langchain"; |
There was a problem hiding this comment.
This snippet switches AIMessage to import { AIMessage } from "langchain", but elsewhere in this doc the TypeScript examples import message classes from @langchain/core/messages. To avoid inconsistent guidance (and potential runtime import issues), keep the import source consistent with the other snippets in this page.
| import { AIMessage } from "langchain"; | |
| import { AIMessage } from "@langchain/core/messages"; |
| import agent_chat_ui from '/snippets/oss/agent-chat-ui.mdx'; | ||
|
|
||
| <AgentChatUi /> | ||
| <agent_chat_ui /> |
There was a problem hiding this comment.
In MDX/JSX, lowercase tag names are treated as HTML elements rather than React components, so <agent_chat_ui /> will not render the imported snippet component. Use a PascalCase identifier for the import and JSX usage (e.g., keep AgentChatUi and <AgentChatUi />).
| Studio connects to your locally running agent to show you each step your agent takes: the prompts sent to the model, tool calls and their results, and the final output. You can test different inputs, inspect intermediate states, and iterate on your agent's behavior without additional code or deployment. | ||
|
|
||
| This page describes how to set up Studio with your local LangChain agent. | ||
| This pages describes how to set up Studio with your local LangChain agent. |
There was a problem hiding this comment.
Grammar: "This pages describes" should be singular ("This page describes").
| This pages describes how to set up Studio with your local LangChain agent. | |
| This page describes how to set up Studio with your local LangChain agent. |
| 2. Specify a [thread identifier](/oss/langgraph/persistence#threads) when executing a workflow. This will track the execution history for a particular instance of the workflow. | ||
|
|
||
| 3. Wrap any non-deterministic operations (e.g., random number generation) or operations with side effects (e.g., file writes, API calls) inside @[tasks][task] to ensure that when a workflow is resumed, these operations are not repeated for the particular run, and instead their results are retrieved from the persistence layer. For more information, see [Determinism and Consistent Replay](#determinism-and-consistent-replay). | ||
| 1. Wrap any non-deterministic operations (e.g., random number generation) or operations with side effects (e.g., file writes, API calls) inside @[tasks][task] to ensure that when a workflow is resumed, these operations are not repeated for the particular run, and instead their results are retrieved from the persistence layer. For more information, see [Determinism and Consistent Replay](#determinism-and-consistent-replay). |
There was a problem hiding this comment.
The ordered list numbering is inconsistent (1, 2, 1). Either make the third item 3. or use consistent markdown-style numbering for all items (e.g., all 1.) to avoid confusing rendered output and future edits.
| 1. Wrap any non-deterministic operations (e.g., random number generation) or operations with side effects (e.g., file writes, API calls) inside @[tasks][task] to ensure that when a workflow is resumed, these operations are not repeated for the particular run, and instead their results are retrieved from the persistence layer. For more information, see [Determinism and Consistent Replay](#determinism-and-consistent-replay). | |
| 3. Wrap any non-deterministic operations (e.g., random number generation) or operations with side effects (e.g., file writes, API calls) inside @[tasks][task] to ensure that when a workflow is resumed, these operations are not repeated for the particular run, and instead their results are retrieved from the persistence layer. For more information, see [Determinism and Consistent Replay](#determinism-and-consistent-replay). |
|
|
||
| // Define the graph | ||
| const builder = new StateGraph(State) | ||
| const builder = new StateGraph(GraphState) |
There was a problem hiding this comment.
GraphState is not defined anywhere in this page (and the surrounding snippets use typeof State for typing), so new StateGraph(GraphState) will not compile. Use the same state schema identifier used elsewhere in the example (likely State).
| const builder = new StateGraph(GraphState) | |
| const builder = new StateGraph(State) |
| To enable tracing for your application, set the following environment variables: | ||
|
|
||
| ```bash | ||
| ```python |
There was a problem hiding this comment.
This fenced block contains shell export ... commands but is labeled as python, which will render incorrect syntax highlighting and can confuse readers. Change the fence language to bash/shell.
| ```python | |
| ```bash |
629d387 to
2c4c770
Compare
d9ec4e3 to
2a9732f
Compare
3ac5aba to
2392360
Compare
f976241 to
6e67526
Compare
e6282cf to
bf67c28
Compare
bf67c28 to
8102df6
Compare
8102df6 to
49489b5
Compare
Automated sync of
src/oss/langgraph/fromlangchain-ai/docs.
This PR was created automatically by the Sync docs workflow.