-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: rewrite underlying architecture of the framework to recursive object #105
Conversation
Nice!!! I will review and test it later Today but frankly speaking - I love it! Great job @grabbou! |
Thanks! I am adding server-side support now, then, I will get some rest, collect feedback. We should run all the examples to make sure they do work, or perform tweaks! |
@grabbou Hi! Refactor of orchestration was my first thought. However, I wondered about breaking down the architecture into primitives: agent, task, prompt to give more flexibility for replacing dependencies. IMHO:
are you open to PRs at this point? |
Hey @tomaszfelczyk, thanks for feedback! Definitely open to suggestions - ideally, please leave some comments inline in the PR (if you can), that way it's easier to discuss this. As far as your questions, let me answer inline:
Right now, each agent is an object and MUST define "run". This is runner that executes its operations. The default "agent()" primitive in the library uses predefined "run" that requires "description" to operate. There are other agents, such as supervisor, that have custom runner, and they don't define description, as it would be redundant. If you decide to build your own primitive, you can store system prompt, or "role/experience" or anything else! Hope that answers your question!
I would ask you to elaborate a bit more on this one! 🙏 |
We separate knowledge from workflow description to avoid tasks/descriptions interfering with agent. This could possibly be something else in the future, like a method that gets it from the database/something. This is just demonstration, as alternative to #105. I am still not sure about this.
We separate knowledge from workflow description to avoid tasks/descriptions interfering with agent. This could possibly be something else in the future, like a method that gets it from the database/something. This is just demonstration, as alternative to #105. I am still not sure about this.
We separate knowledge from workflow description to avoid tasks/descriptions interfering with agent. This could possibly be something else in the future, like a method that gets it from the database/something. This is just demonstration, as alternative to #105. I am still not sure about this.
Before, we downloaded the `main` snapshot. It was fine. However, it didn't work well when the current `main` source code was incompatible with the released `npm` modules. This situation happened with the recent #105. Now, we're getting the latest official release and taking the examples out of it. Because the tarball starts with a directory of an unknown name (in fact, it's the `org-repo-lastcommitid` kind of) - we're about to extract the full release and not only the example folder (as it was before) because the leading directory name is unknown. --------- Co-authored-by: Mike Grabowski <[email protected]>
After better read in, You are right, agree! I was trying to point out something else, namely the question of whether the runner should take something more than just For testing/researching purposes it would be nice to test single agent behaviour based on single
Since the workflow is now hardcoded (one of many other possible, more or less complex), the agent is dependent on one type of workflow. It would be nice if workflows cloud be more flexible, also could result schema instead of string.
|
Fixes #68
Related #102
There are a lot of changes in this PR, I will break them down here, together with motivation.
The prime motivation for the change was to simplify the structure of "state" by getting rid of agent specific properties (such as agentName, agentRequest) and moving to a simple state object that can have "child" states (either single element, or an array).
That way, we could get rid of special handling for supervisor, resource planner (two built-in agents) and further simplify the logic.
Thanks to that, we have "out-of-the-box" support for parallelism, cancellations, hand-offs. If agent wants to delegate, simply create new
workflowState
and add it as a child, then return state (see how "supervisor" is implemented). If agent wants to hand-off the task, they can simply replace their entire state (see how "resourcePlanner" gets its job done).Other changes worth mentioning:
Here is screenshot of what the output looks like at the moment: