clara

2021-08-27T00:48:25.004100Z

I've used Clara rules a bit but am planning on doing something more complicated with it and had a question. It seems like when you start working on defining your rules you have to decide on a sort of scope for your session. I was curious if sessions have any way of composing? Let's say I decide I want to handle some subset of rules in its own session and then apply that to many of some type in a parent session. Is that possible?

ethanc 2021-08-27T00:55:09.009Z

I don't think that Clara has anything like that. I would assume that one could fire the sub session, then extract data via queries to populate facts within the parent session. Though I would think that simply having a single session would be less complex

2021-08-27T00:57:50.012400Z

Is there any general wisdom about what a session should operate on? Like let's say I had some domain for accounts, should my session be for a single account vs all accounts, which I imagine could get confusing because you're dealing with many things vs one?

ethanc 2021-08-27T01:05:36.016300Z

In general, It would come down to the scope of what you are reasoning about. If all of the questions you are trying to answer, if all of them are bounded by a single account, then it would probably make sense to operate on a single rather than multi.

ethanc 2021-08-27T01:07:30.018200Z

It would likely reduce the complexity of the rules, as they could implicitly assume that the facts pertain to a single accout

ethanc 2021-08-27T01:07:38.018500Z

*account

2021-08-27T01:08:49.020400Z

I think in my case it's most likely the scope will be both the single and the many, at least for some parts. Which is why I was worried starting at one level would require lots of rework later to adjust the scope.

ethanc 2021-08-27T01:13:13.023800Z

Going from multi to single, in theory, should be passive. Though single to multi would require rework as the implicit assumptions based on a single account would be broken

2021-08-27T01:16:21.024700Z

Right, without the ability to compose sessions, starting at many is probably the way to go to avoid rework.

👍 1
2021-08-27T01:17:09.025900Z

Thanks for discussing!

ethanc 2021-08-27T01:18:06.027100Z

Glad to lend an ear, and hear about people using Clara

2021-08-27T16:13:04.027300Z

Yeah, I agree with Ethan overall

2021-08-27T16:13:23.027900Z

If your cases now were single account - you could go about it that way and expose queries to data from that session later that you could use for “multi account reasoning”

2021-08-27T16:13:39.028400Z

but it really depends on the case which would be more efficient or make more sense.

2021-08-27T18:37:13.030Z

@mikerod I’ll give that a shot too. I think the way I’ll be analyzing the data it could work, IE multiple passes through different sessions.