There are two new branches called ‘llm-client’, in moqui-framework and moqui-runtime:
These contain a proposed architecture and implementation of an LlmClient class in the framework that handles talking to an external LLM, and it handles tool calling, agent loop, logging, etc. The initial tools include artifact info browsing, skill lookup, skill leaning in a simulation overlay, and calling screen transitions, services, etc using the current user’s authz.
The tooling architecture and skill learning are designed in a particular way to help mitigate issues with AI automation in business systems. The primary mode is “skill-first” where the agent looks for a relevant skill, and if it does not find one it spawns a sub-agent in a simulated environment to experiment and find a solution, then document it in a skill.
The simulation environment uses a number of existing context and production isolation mechanisms in the framework, and adds a new one that I’ve been thinking of doing for a long time: TransactionCacheDb. This uses H2 as an in-memory database to overlay the external database and act as a multi-transaction read-through cache where writes stay in the cache DB until flushed to the external DB, or as in the case of the sim application, thrown away.
Built on top of these is the Assist screen. This is a new screen in the tools component available to all users. It has a LLM chat on the left, and a screen canvas on the right. It supports two render modes for the LLM: a simple JSON form spec output, and a Vue Single-File Component output. The overall workflow is ask the LLM to do something, it figures out how to and creates a form for it, even if the form is just descriptive text and a submit button. The user always maintains control, changes only made when buttons are clicked.
With this in place, and once it is all cleaned up and production-worthy, the game changes for what is most important to build and maintain. Creating screens is more about the structure and data+logic encapsulation that they offer than the output they produce. The XML REST API becomes a far more viable approach for internal as well as external data access and logic. Ideally, only very few screens are ever made again, focusing on those with more complex interactions and requirements, and that will be used frequently or for a very particular important purpose.
For general notes see the ReleaseNotes.md file (in the branch):
For an overview of the skill learning and TransactionCacheDb stuff, see the new LlmSkillLearning.md plan: