Building Dynamic Agentic Workflows at Runtime #2219
McCReuben
started this conversation in
Show and tell
Replies: 1 comment
-
@McCReuben That's quite an interesting use case. We are building something similar for our use case but with dynamic Human-in-the-loop capabilities for sub-graph/tool nodes, to correct the path taken and have human approval for sensitive tools. Please share your implementation for human in the loop if you are able to figure it out. Thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello LangGraph community!
I've been exploring the capabilities of LangGraph and wanted to share an interesting implementation I've been working on. This project is a part of an LLM e-book reading assistant called Pyri that me and a partner have been working on for months. It focuses on by designing, building, and compiling graphs at runtime based on a user query.
Overview
The implementation is inspired by the LLM Compiler implementation from a few months back, but executes DAG plans via Langgraph nodes instead of tools, while maintaining both sequential and parallel execution capabilities. It consists of two main stages:
Notable Features
Code Breakdown
Planning Agent
The planning agent uses a language model (e.g., GPT-4) to generate a structured plan. It considers the user's context, available agents, and conversation history to create a detailed plan in JSON format.
Execution of the Plan as a Graph
The generated plan is transformed into a
StateGraph
object. Each step in the plan becomes a node in the graph, and dependencies define the edges between nodes.State and types:
Helper functions:
Translating a Plan to a graph:
I am currently working on implementing Asyncronous execution and dynamic Human-in-the-loop capabilities. I would be happy to share a more complete version of the code with prompts and sub agents if there is interest. I'm loving the capabilities that LangGraph and LangSmith provide!
Happy coding!
Beta Was this translation helpful? Give feedback.
All reactions