Live data from Hacker News

Show HN: Mastra – Open-source JS agent framework, by the developers of Gatsby

github.com

131–140 of 159 posts

Re: Show HN: Mastra – Open-source JS agent framework, by the developers of Gatsby

#132
post #119

The example from the landing page does not exactly spark joy: testWorkflow .step(llm) .then(decider) .then(agentOne) .then(workflow) .after(decider) .then(agentTwo) .then(workflow) .commit(); On a first glance, this looks like a very awkward way to represent the graph from the picture. And this is just a simple "workflow" (the structure of the graph does not depend on the results of the execution), not an agent.

Thanks! The conditional `when` clauses live on the steps, rather than being represented in the workflow, and in fact when we built this for an example, the last step being called depended on the results of the previous two steps. How would you simplify this?

I think the problem is that a 'fluent' chain of calls already expresses a sequence, so the way that 'after' resets the context to start a new branch feels very awkward ... like a GOTO or something

It's telling that the example relies on arbitrary indentation (which a linter will get rid of) to have some hope of comprehending it

Possibly this was all motivated by a desire to avoid nested structures above all?

But for a branching graph a nested structure is more natural. It'd also probably be nicer if the methods were on the task nodes instead of on the workflow, then you could avoid the 'step'/'then' distinction and have something like:

e.g.

    testWorkflow(
        llm
        .then(decider)
        .then(
            agentOne.then(workflow),
            agentTwo.then(workflow),
        )
    )

Re: Show HN: Mastra – Open-source JS agent framework, by the developers of Gatsby

#133

Earlier quoted context omitted.

> good concurrency story like Elixir make much more sense Agree, that's why I've been building this: https://github.com/agentjido/jido

Call me an elixir virgin until 5 minutes ago. This language from a quick glance seems perfect for agent orchestration. Project looks great, will follow & learn.

It's less about the language syntax and more about the capabilities of the underlying Erlang runtime. There's also Gleam on top of Erlang if you like stronger typing (gleam.run).

Re: Show HN: Mastra – Open-source JS agent framework, by the developers of Gatsby

#134
post #119

The example from the landing page does not exactly spark joy: testWorkflow .step(llm) .then(decider) .then(agentOne) .then(workflow) .after(decider) .then(agentTwo) .then(workflow) .commit(); On a first glance, this looks like a very awkward way to represent the graph from the picture. And this is just a simple "workflow" (the structure of the graph does not depend on the results of the execution), not an agent.

[deleted]

Re: Show HN: Mastra – Open-source JS agent framework, by the developers of Gatsby

#135
post #119

The example from the landing page does not exactly spark joy: testWorkflow .step(llm) .then(decider) .then(agentOne) .then(workflow) .after(decider) .then(agentTwo) .then(workflow) .commit(); On a first glance, this looks like a very awkward way to represent the graph from the picture. And this is just a simple "workflow" (the structure of the graph does not depend on the results of the execution), not an agent.

Yeah, I also found this a bit unintuitive at first. I’m building a workflow engine myself (https://pgflow.dev/pgflow, not released yet), and I’ve been thinking a lot about how to model the DSL for the graph and decided to make dependencies explicit and use method chaining for expansion with other step types.

Here’s how it would look like in my system:

  new Flow()  
    .step("llm", llmStepHandler)  
    .step("decider", ["llm"], deciderStepHandler)  
    .step("agentOne", ["decider"], agentOneStepHandler)  
    .step("agentTwo", ["decider"], agentTwoStepHandler)  
    .step("workflow", ["agentOne", "agentTwo"], workflowStepHandler);  
Mine is a DAG, so more constrained than the cyclic graph Mastra supports (if I understand correctly).

Re: Show HN: Mastra – Open-source JS agent framework, by the developers of Gatsby

#136
post #119

The example from the landing page does not exactly spark joy: testWorkflow .step(llm) .then(decider) .then(agentOne) .then(workflow) .after(decider) .then(agentTwo) .then(workflow) .commit(); On a first glance, this looks like a very awkward way to represent the graph from the picture. And this is just a simple "workflow" (the structure of the graph does not depend on the results of the execution), not an agent.

Thanks! The conditional `when` clauses live on the steps, rather than being represented in the workflow, and in fact when we built this for an example, the last step being called depended on the results of the previous two steps. How would you simplify this?

I think it is just easier to comprehend if the edges/dependencies are explicit (as an array for example).

Re: Show HN: Mastra – Open-source JS agent framework, by the developers of Gatsby

#137

A TypeScript first AI framework is something that has been missing. How do you work with AI SDK?

https://typedai.dev is another full-featured one I've built, with a web UI, multi-user support, code editing agents, CodeAct autonomous agent

Re: Show HN: Mastra – Open-source JS agent framework, by the developers of Gatsby

#138
post #119

The example from the landing page does not exactly spark joy: testWorkflow .step(llm) .then(decider) .then(agentOne) .then(workflow) .after(decider) .then(agentTwo) .then(workflow) .commit(); On a first glance, this looks like a very awkward way to represent the graph from the picture. And this is just a simple "workflow" (the structure of the graph does not depend on the results of the execution), not an agent.

I get the same feeing when I first looked at the LangChain documentation when I wanted to first start tinkering with LLM apps.

I built my own TypeScript AI platform https://typedai.dev with an extensive feature list where I've kept iterating on what I find the most ergonomic way to develop, using standard constructs as much as possible. I've coded enough Java streams, RxJS chains, and JavaScript callbacks and Promise chains to know what kind of code I like to read and debug.

I was having a peek at xstate but after I came across https://docs.dbos.dev/ here recently I'm pretty sure that's that path I'll go down for durable execution to keep building everything with a simple programming model.

Re: Show HN: Mastra – Open-source JS agent framework, by the developers of Gatsby

#139

By the developers of Gatsby is a minus, not a plus makes me think this is going to be the next abandonware.

The character Gatsby didn't function very well either (as far as being a successful person goes, I quite liked the book and he functioned well as a character) :) However, the Gatsby CMS had a couple of things that were really interesting about it - especially runtime type safety through GraphQL and doing headless WordPress.

Interesting, because GQL was the most divisive thing of Gatsby.
Post reply on HN