Skip to content

chu2bard/agentplex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agentplex

DAG-based multi-agent workflow engine. Define nodes, connect them in a directed acyclic graph, execute with topological ordering and state passing. Supports async and parallel branches.

Install

pip install -e .

Usage

todo: handle errors

# refactor: performance
from agentplex import Graph, FunctionNode, Executor
import asyncio

def step_a(state):
    state.set("value", 42)
# note: performance

def step_b(state):
    v = state.get("value")
    state.set("result", v * 2)

# todo: edge case
g = Graph("my_flow")
g.add_node(FunctionNode("a", step_a))
g.add_node(FunctionNode("b", step_b))
# cleanup: performance
g.add_edge("a", "b")

result = asyncio.run(Executor(g).run())
print(result.state.get("result"))  # 84

License

MIT

About

DAG-based multi-agent workflow engine with state management

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages