Live data from Hacker News

Show HN: Flow – A dynamic task engine for building AI agents

github.com

1–10 of 53 posts

Show HN: Flow – A dynamic task engine for building AI agents

#1
I think graph is a wrong abstraction for building AI agents. Just look at how incredibly hard it is to make routing using LangGraph - conditional edges are a mess.

I built Laminar Flow to solve a common frustration with traditional workflow engines - the rigid need to predefine all node connections. Instead of static DAGs, Flow uses a dynamic task queue system that lets workflows evolve at runtime.

Flow is built on 3 core principles:

* Concurrent Execution - Tasks run in parallel automatically

* Dynamic Scheduling - Tasks can schedule new tasks at runtime

* Smart Dependencies - Tasks can await results from previous operations

All tasks share a thread-safe context for state management.

This architecture makes it surprisingly simple to implement complex patterns like map-reduce, streaming results, cycles, and self-modifying workflows. Perfect for AI agents that need to make runtime decisions about their next actions.

Flow is lightweight, elegantly written and has zero dependencies for the engine.

Behind the scenes it's a ThreadPoolExecutor, which is more than enough to handle concurrent execution considering majority of AI workflows are IO bound.

To make it possible to wait for the completion of previous tasks, I just added semaphore for the state value. Once the state is set, one permit is released for the semaphore.

The project also comes with built-in OpenTelemetry instrumentation for debugging and state reconstruction.

Give it a try here -> https://github.com/lmnr-ai/flow. Just do pip install lmnr-flow. (or uv add lmnr-flow). More examples are in the readme.

Looking forward to feedback from the HN community! Especially interested in hearing about your use cases for dynamic workflows.

Couple of things on the roadmap, so contributions are welcome!

* Async function support

* TS port

* Some consensus on how to handle task ids when the same tasks is spawned multiple times

Show HN: Flow – A dynamic task engine for building AI agents
github.com

Re: Show HN: Flow – A dynamic task engine for building AI agents

#2
I agree complex conditional LangGraph setups get pretty tedious after a certain point - though you claim to not use graphs here, but isn't that essentially what returning the "next task" does? The graph isn't explicitly defined but it still exists implicitly if you trace through all the tasks and next tasks.

Would be interesting to see a complex agent implementation in both Flow and regular LangGraph to compare maintainability.

Re: Show HN: Flow – A dynamic task engine for building AI agents

#3

I agree complex conditional LangGraph setups get pretty tedious after a certain point - though you claim to not use graphs here, but isn't that essentially what returning the "next task" does? The graph isn't explicitly defined but it still exists implicitly if you trace through all the tasks and next tasks. Would be interesting to see a complex agent implementation in both Flow and regular LangGraph to compare maint…

In some sense yes, task dependencies do form a graph. However, what I meant when I was saying that graph is a wrong abstraction, is that predefined edges is a not the best of writing code when dealing with dynamic systems such as AI Agents.

As you said, the easiest conditional workflows are tedious and we have to rely on "conditional" edges to solve the simplest stuff. Then, how would you define cycles or spawning of the same task multiple times as a node-edge relation? It becomes extremely inconvenient and just gets in your way. The reason I built Flow is exactly because I previously relied on a predefined node-edge system which I also built (https://docs.lmnr.ai/pipeline/introduction).

Also it impossible to do MapReduce like operations on node-edge without inventing some special node for handling that stuff.

Idea about comparing LangGraph and Flow is really good and I will work on that asap! What kind of workflows would you love to see implemented in Flow? Btw, there're a lot of examples in the readme and in the /tests folder

Re: Show HN: Flow – A dynamic task engine for building AI agents

#5
post #4

I did see the part about "graph is wrong," but the examples in the readme seem like you may find this interesting: https://news.ycombinator.com/item?id=42274399 (Nodezator is a generalist Python node editor; 29 Nov 2024; 78 comments)

True, graph is not wrong per se, but in my experience I saw a lot of problems, the moment it starts to be a little more dynamic. Main problem is predefined edges. That's where you bump into things like conditional edges, cycles edges and so on. That's also my problem with frameworks like LangGraph. They just get in your way by pushing on things which looked like a good idea in the beginning.

Re: Show HN: Flow – A dynamic task engine for building AI agents

#8
I tend to agree the graph approach is wrong.

I have a meta question though - there seems to be a huge amount of activity in this space of LLM agent related developer tooling. Are people actually successfully and reliably delivering services which use LLMs? (Meaning services which are not just themselves exposing LLMs or chat style interfaces).

It seems like 18 months ago people were running around terrified, but now almost the opposite.

Re: Show HN: Flow – A dynamic task engine for building AI agents

#9
Congrats on launching! From your explanation comparing to traditional workflow engines it would be a step up from something like Airflow, but I was wondering about a comparison to Temporal which does let you create dynamic DAGs as well as provides some additional guarantees around reliability of workers in case of crashes.

Re: Show HN: Flow – A dynamic task engine for building AI agents

#10
post #9

Congrats on launching! From your explanation comparing to traditional workflow engines it would be a step up from something like Airflow, but I was wondering about a comparison to Temporal which does let you create dynamic DAGs as well as provides some additional guarantees around reliability of workers in case of crashes.

Prefect is also a non-DAG based workflow engine that has very similar functionality to what is outlined here; they have built a few tools in the AI space (marvin and controlflow iirc)
Post reply on HN