Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LangGraph State Machines #452

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

LangGraph State Machines #452

wants to merge 19 commits into from

Conversation

kreneskyp
Copy link
Owner

@kreneskyp kreneskyp commented Feb 17, 2024

Description

This PR adds State Machine component that compiles into a LangGraph state machine. State machines may be used to create custom agent components and to create collaborative flows. LCEL provide parallel and linear flows, and LangGraph provides looping, state, and branching.

State machines are composed of:

  • Schema: JSON Schema that defines state object
  • Action: optional runnable that executes on each iterations
  • Conditional: runnable that receives result of the action and decides the next step

TODO: DIAGRAM

State Machine integrates into standard LCEL based flows seamlessly. The branches may contain most combinations of graphs. Chains will compile into a combination of LangGraph and LCEL automatically.

example: State machine that coordinates with two worker agents.

image

Changes

[List out the changes you've made in this pull request. Be as specific as possible.]

How Tested

[Explain how you tested this pull request. Include any relevant steps or scripts.]

TODOs

  • a few more unit test scenarios to write.
  • graph parser isn't detecting an ImplicitJoin that spans state machine branches.
  • add END component + parsing updates.
  • add descriptions to each skill / chain.
  • consider how to improve the select box to choose chains, agents, and skills in a single select.
  • BranchNode loop mapping: auto-map loop logic for when not all BranchNode branches end in a loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant