You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have provided a user interface with the following
Add Agent button & Build Graph button
There is a d3 graph which is rendered. When user adds an agent on the top, a node is added to the graph using d3
When user selects the node on the graph, a sidebar appears that allows the user to provide name of agent, prompt, selecting tools from drop down, selecting LLM etc. (In my case, the tools are ready-made and pre-exist in backend)
The user can save this as config (as json in the DB)
The exact same json is used to construct the request and send it to the python service and build the graph as shown in my examples
Once the graph compiles properly, I will allow the user to call the graph.run method via the UI
The user should be able to see the streamed outputs of each agent on the UI
List of Agents [{"llm": "", "name": "start", "color": "#B2AFEB", "tools": [], "prompt": ""}, {"llm": "claude-sonnet-3.5", "name": "Researcher", "color": "#67D995", "tools": [], "prompt": "You are a research assistant. Your task is to search for information and summarize it concisely. Once research is done, give the text to the translator agent"}, {"llm": "claude-sonnet-3.5", "name": "Reviewer", "color": "#f094d3", "tools": [], "prompt": "You will review the outputs of other agents"}, {"llm": "claude-sonnet-3.5", "name": "Translator", "color": "#ffac4d", "tools": [], "prompt": "You are an expert translator"}, {"llm": "", "name": "end", "color": "#99DBEA", "tools": [], "prompt": ""}]
List of edges
[{"source": "Reviewer", "target": "end"}, {"source": "Researcher", "target": "Reviewer"}, {"source": "start", "target": "Researcher"}, {"source": "Translator", "target": "Reviewer"}]
This can be used as a reference to implement a proper utility class
body = GraphConfig(
graph_id=3,
name="Graph",
description="Graph",
session_id=None,
agents=[
AgentConfig(
name="Researcher",
prompt="You are a research assistant",
llm="claude-sonnet-3.5",
tools=[],
color="#FF871F"
),
AgentConfig(
name="Writer",
prompt="You are a great writer",
llm="claude-sonnet-3.5",
tools=[],
color="#FF871F"
),
],
edges=[
GraphEdge(source="start", target="Researcher"),
GraphEdge(source="Researcher", target="Writer"),
GraphEdge(source="Writer", target="end")
]
)
graph = GraphBuilder(graph_config=body)
graph.build()
response = GraphResponse(
config = graph.get_compiled_config(),
base64 = graph.get_image(xray=True, mermaid=True)
)
response
In my org, I implemented a utility class to dynamically build LangGraph graphs
and abstracted away some of the common details
It is no means perfect, and is probably incomplete,
but is there a way for you guys to implement this in langchain-core or langgraph??
I have this raw implementation here - https://gist.github.com/rvndbalaji/2f50bf3d2fc635bf2f36f71c724e3347
I have provided a user interface with the following
Add Agent button & Build Graph button
List of Agents
[{"llm": "", "name": "start", "color": "#B2AFEB", "tools": [], "prompt": ""}, {"llm": "claude-sonnet-3.5", "name": "Researcher", "color": "#67D995", "tools": [], "prompt": "You are a research assistant. Your task is to search for information and summarize it concisely. Once research is done, give the text to the translator agent"}, {"llm": "claude-sonnet-3.5", "name": "Reviewer", "color": "#f094d3", "tools": [], "prompt": "You will review the outputs of other agents"}, {"llm": "claude-sonnet-3.5", "name": "Translator", "color": "#ffac4d", "tools": [], "prompt": "You are an expert translator"}, {"llm": "", "name": "end", "color": "#99DBEA", "tools": [], "prompt": ""}]
List of edges
[{"source": "Reviewer", "target": "end"}, {"source": "Researcher", "target": "Reviewer"}, {"source": "start", "target": "Researcher"}, {"source": "Translator", "target": "Reviewer"}]
This can be used as a reference to implement a proper utility class
FYI @hwchase17 @dqbd
The text was updated successfully, but these errors were encountered: