Adds Documentation about Channels, Checkpoints, and Pregel Graphs to CONTRIBUTING.md#96
Merged
Nuno Campos (nfcampos) merged 4 commits intolangchain-ai:mainfrom Mar 23, 2024
Conversation
Comment on lines
-66
to
+74
| - __Required__: `--workspace <workspace name>`. eg: `--workspace @langchain/langgraph` (always appended as the first flag when running `yarn release`) | ||
| - __Optional__: `--bump-deps` eg `--bump-deps` Will find all packages in the repo which depend on this workspace and checkout a new branch, update the dep version, run yarn install, commit & push to new branch. | ||
| - __Optional__: `--tag <tag>` eg `--tag beta` Add a tag to the NPM release. | ||
| - **Required**: `--workspace <workspace name>`. eg: `--workspace @langchain/langgraph` (always appended as the first flag when running `yarn release`) | ||
| - **Optional**: `--bump-deps` eg `--bump-deps` Will find all packages in the repo which depend on this workspace and checkout a new branch, update the dep version, run yarn install, commit & push to new branch. | ||
| - **Optional**: `--tag <tag>` eg `--tag beta` Add a tag to the NPM release. | ||
|
|
||
| This script automatically bumps the package version, creates a new release branch with the changes, pushes the branch to GitHub, uses `release-it` to automatically release to NPM, and more depending on the flags passed. | ||
|
|
||
| Halfway through this script, you'll be prompted to enter an NPM OTP (typically from an authenticator app). This value is not stored anywhere and is only used to authenticate the NPM release. | ||
|
|
||
| Full example: `yarn release @langchain/langgraph --bump-deps --tag beta`. | ||
| Full example: `yarn release @langchain/langgraph --bump-deps --tag beta`. |
Contributor
Author
There was a problem hiding this comment.
did not change this explicitly, happened when i ran yarn format
| 4. Since `outputChannelName` is defined as the graph's output, the execution ends and returns `3`. | ||
|
|
||
| ```ts | ||
| const addOne = jest.fn((x: number): number => x + 1); |
Collaborator
There was a problem hiding this comment.
nit: remove indent
Collaborator
There was a problem hiding this comment.
Or wrap in test/it
| Some key concepts: | ||
| - Pregel graphs take an `input` and `output` as parameters which represent where the graph starts and ends | ||
| - Pregel graphs take a mapping of nodes represented as `{nodeName: node}` | ||
| - Each node subscribes to (one or more) channels. This defines when a node executes. Specifically, for a given `node N` that subscribes to `channel M`, whenever the _value_ of `channel M` changes, `node N` must be executed. Intuitively, it represents what the current node is _dependent_ on. |
Collaborator
There was a problem hiding this comment.
What is the difference between a channel and an edge? That is the terminology most people think of when they hear "graph".
Would be worth clarifying here
| Invocation 1: | ||
| 1. When the graph is invoked with `2`, `input` channels value becomes `2` | ||
| 2. Node `one` runs because it is subscribed to `input`. The node tranforms `2` to `2` by running `inputPlusTotal`. | ||
| 3. The value of channels `output` and `total` get set to `2` because node `one` writes to both channels |
Collaborator
There was a problem hiding this comment.
There is no total referenced above?
Contributor
Author
There was a problem hiding this comment.
oh the description is above the example
i can change that if that's confusing
| 1. When the graph is invoked with `2`, `input` channels value becomes `2` | ||
| 2. Node `one` runs because it is subscribed to `input`. The node tranforms `2` to `2` by running `inputPlusTotal`. | ||
| 3. The value of channels `output` and `total` get set to `2` because node `one` writes to both channels | ||
| 4. Because `memory` is passed into the graph, `total` at threadId of `1` is saved as a value of `2` |
Collaborator
There was a problem hiding this comment.
Also no memory passed above
Contributor
Author
There was a problem hiding this comment.
same as above^
Nuno Campos (nfcampos)
approved these changes
Mar 23, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on conversations with Nuno Campos (@nfcampos) yesterday, learned a lot about the underlying behavior of LangGraph
This information is pretty crucial to be able to contribute meaningfully in this code base, so added this information to the CONTRIBUTING.md
While I was here, made some flyby changes to help clarify things that I thought were confusing