by JustFinishedBSG · 2mo ago · 0 comments
My current vision, and prototype, is that it should be as close as possible to a "real" language as possible so that both the user and the agent know immediately how to use it and how it functions.
So for `pi` it means using typescript.
Then the UI is derived from the AST / code as much as possible and for things that aren't neatly possible like that I eventually add small semantic helpers that define the UI.
For example "plan -> execute" is:
await flow.unroll(
remaining.map(point => ({
key: point.id,
label: point.objective,
})),
async () => {
for (const point of remaining) {
await flow.item(point.id, async () =>
await flow.agent(executePoint, {
title: `Point ${point.id}`,
prompt: point.objective,
}));
}
},
{ title: `Plan r${planRevision}` },
);
( simplified code )
in my implementation and `unroll` is only there to have a nice ● Plan r1 · 1/3 · active
1. Inspect parser behavior
● 2. Add empty-input coverage
○ 3. Run focused checks
UI instead of a plain "Plan · 1/3" UI with no detail (which would happen if I just used a for loop, yes it works)I don’t know yet if it’s a good solution. But only thinking in terms of files / filesystem sure make things easier.
Also makes branching “easier”: no handling of merging or conflicts, the receiving agent just gets N file systems and decides how to handle things.
Thanks!
So this means that every node in the graph has to be a fully fledged agent runtime with the smarts to handle an arbitrary filesystem.
I guess there is some sort of tool call that the agent has to tell the runtime 'I am done, and I succeeded go to the success node in the parent state machine'
---
I think I have been trying to approach a slightly different problem where you have a mostly deterministic control flow of steps/ nodes in the graph, but individual nodes can be pretty stupid/ small models, so having a more constrained universe should be more reliable. (My intuition)
My example is a citation checker for an essay -
1. generate a list of claims in a paragraph, For each claim: Read the attached citation, validate that it backs up that claim.
The output is a nested json structure with a list of claims with a explanation+binary classification of whether each one is supported.
This is not really agentic, and the nodes would be claim identification > validate claims (in parallel) > deterministically merge the validated claims into a unified module.
It should be very token efficient, and since it is so constrained I think I can get away with tiny models, and small context.
At least that is my hope... But I think I need typed IO/state so that the llm that writes the graph can deterministically say that the individual nodes complete the problem wholly.