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
Upgrading Scenarios #813
Comments
"Agents can no longer be in multiple Scenarios at the same time." Hear, hear. If one doesn't keep a close eye on which scenario an agent needs to go in (I've adopted the convention of putting " - " in front of each agent's name) it's easy for them to wind up someplace unexpected, which makes debugging suck. "Options" This would be useful, sort of like a subset of the Credentials export functionality. Having an option to check or un-check to clear the options on a scenario as its exported would be nice, to minimize the risk of accidentally outing one's API keys or credentials. "Event flow" If I'm reading this right you mean tinkertoying scenarios - GenericRSSInputNetwork, GenericXMPPOutputNetwork, stuff like that. "A Scenario can subscribe to Events from an Agent, and all Agents in the Scenario marked as “input” Agents will receive those Events." I'm not entirely sure how useful this bit would be but I'd like to hear from everybody else before forming an opinion. "Scenarios are displayed in the primary Agent diagram as a single node, or perhaps as a set of nodes with a box around them." I'm inclined to ++ the latter, if only to make it easier to look at the name of the input variable the agent network requries. The former would be helpful if there was a way to click on or hover over it to glimpse at the nodes in that particular network, I think. "Reuse - Option 2" This would be my preferred means of implementation because specifics could be tweaked as necessary. For example, setting the "clean" option in instances of the WebsiteAgent because some websites and RSS feeds are only parsable when it's turned on, and some are only parsable when it's turned off. Needing two prototype scenarios set both ways would be clunky to say the least. Being able to clone a scenario would be great under this option. I like the idea of scenario memory for just the sample you gave. It would be a huge timesaver for crossposting. As for adding behavior trees, I'd be more inclined to implement those outside of Huginn as separate software systems (virtadpt/exocortex-halo) and expose REST APIs to instances of WebsiteAgent to make better use of system resources and not tax Huginn's scheduler overmuch. These seem specialized enough that they're probably not a good fit for Huginn. |
Overall sounds like good ideas to me. I like the idea of the scenario as a whole being a 'black box' with defined inputs/outputs. I think there would be a lot more value in subscribing it to inputs if they had a 'type' though (eg. EventDomain/EventType I talked about a while back) Displaying on the graph as a single node, but with the ability to 'inspect' it and see it's inner agents is a good idea I think. If we can black box a scenario, and it's agents are self contained, for composability we should allow scenarios to use other scenarios within them. Which brings up the question of versioning. Shared memory for scenarios for sure. This is similar to how the rulesets for a pico can all read/write from the pico PDS (personal data store), or from their own local store (for private memory) in CloudOS and/or https://github.com/welcomer/framework Don't know enough about behaviour trees to comment, but as far as async language/etc, that's why we chose to use scala and akka for the welcomer framework. Not sure of the parallels in rails-land (though I still have it on my backlog to look into running huginn on jruby / jRoR) |
One thing: It would be handy for scenarios to some space set aside in the JSON document for internal documentation or arbitrary text, explaining what it was used for, maybe with some versioning or licensing information. |
This sounds like a great idea.
Shouldn't that something the user decides? I find it handy to have a source agent in multiple scenarios which contain the agents that are 'processing' the events the source emits.
In my example that would mean you would end up with duplicated source agents what are both doing the same check to an external service. That brings back #543 which we could use to advice the user to restructure their scenarios to avoid having duplicate source agents.
You would use the scenario options to simplify the agent configuration? For simple (form configurable) agents it could be enough to expose the
Maybe the |
I think I like this idea of scenarios being more like a blackbox too... A few things/questions that come to my mind (I couldn't read the whole thread yet, so forgive me if anything here has been mentioned already):
|
Just a tiny suggestion: I would like to see the nodes coloured in the diagram view in the same way how scenario labels are shown in the agent view. |
Nice idea @elvetemedve, would you mind submitting a separate issue for this? |
I love the scenario blackbox idea. In my use case, I've had to duplicate a lot of my scenarios by hand since I'm doing the same thing a lot for slightly different variables (i.e. crawling different pages of a site, just the url is different). Being able to reuse scenarios with different variables would be interesting and powerful. |
Has anyone here been an active user of Yahoo Pipes? I was a heavy user of Pipes and discovered Hugin when I was orphaned by the death of the project. Hugin's proposal is different from Pipes but I was able to adapt. But sometimes I find myself thinking "if Hugin did such a thing as Pipes would be great." One of the features that I miss the most is the one that is being discussed here. Let me give you an example. In Pipes I would create some operators and reuse them for each stream. In Hugin I have to duplicate the entire structure. If there is any modification in the operator I have to make the same modification 30 times (okay, I know there are many ways to solve this, but it's just a didactic example). Now with this idea I can create the scenarios as operators and reuse them in each of the 30 feeds, just as it could be done in Pipes. Perhaps this discussion concludes that the concept of scenario is nothing more than a simple labeler for agents and continue as is and a new concept should be created: an Operator Reusable and Shareable, which receives an input, processes and returns an exit. So, I'm eagerly tracking the progress on this issue. |
In some of my scenarios, I do pretty much what you describe. The way I handle that use case is like this:
It takes some planning but it's pretty easy once you have the pattern down. |
Currently, Huginn Scenarios contain a set of Agents. They are much like tags, in that an Agent can be “in” many Scenarios at once, and the Scenario serves mostly as a label and as a means of import and export. There are a couple of things that currently make Scenario reuse challenging.
First, it’s challenging to share and reuse Scenarios because they are not variablized, meaning that if I make a RainWarningScenario and give it to you, you have to manually edit the contained WeatherAgent and change the location that it watches, instead of just setting a
location
variable on the Scenario itself. This gets more difficult with complex Scenarios where necessary configuration may be scattered across a bunch of Agents.Second, it’s not currently possible to make Scenarios that themselves act like Agents, meaning that you can’t currently create a blackbox “Should Send Alert Scenario”, containing some number of Agents, where some Agent(s) in the Scenario subscribe to outside Events, other contained Agents process them, and finally some Agent(s) emit them again back to the outside world. If this were possible, you could create complex Scenarios and treat them as single abstract Agents in a larger system.
Solving these two problems would make Huginn Scenarios much more powerful and reusable.
Proposed changes:
options
that can be edited. All contained Agents have access to these options via a Liquid tag. (Something likescenerio_option ‘foo’
)default_options
.default_options
are included, but theoptions
are not. This way you can share a Scenario without sharing your configuration of it. (Or perhaps inclusion ofoptions
is optional?)scenario_id
to EventRealistically, I don’t think I have time to build all of this myself, but I do have time to help manage it if I can find some volunteers to collaborate on the effort. I’d also be glad to mentor an intern over the summer on this effort, if anyone here is interested, or knows someone who would be.
Questions and thoughts:
options
work with FormConfigurable? @dsanderoptions
, do we need a concept of Scenario memory? Should Agents be able to write to shared memory that others can access without using Events? This would facilitate coupled systems for synchronization (“When I post to Twitter, send it to Facebook. When I post to Facebook, send it to Twitter. Please avoid infinite loops!”) and other more complex problem solving. Making Huginn better at bi-directional sync #708 and @adambedfordFeedback and discussion greatly appreciated! @knu, @chriseidhof, @alias1, @andrewcurioso, @virtadpt, @bennlich, @akilism, @albertsun, @CloCkWeRX, @icblenke, @dsander, @gtramontina and everyone else.
The text was updated successfully, but these errors were encountered: