## Architecture An overview of the key components and their interactions. ![SIA Component Model](./diagrams/SIA_Component_Model.svg) ### Core Actions Core actions are implemented each in a separate class. Each action in the context is an instance of the corresponding class. The `delete` and `stop` actions are exceptions to this. They are implemented as functions in the `AgentCore`. Actions have a `template(id)` method that returns an XML Element. If they require updating in each iteration, they do so at the start of the `template` method. ### Agent Core The `AgentCore` manages the state of the agent. It can also run a basic main loop consisting of: - Running template on all actions - Collecting system information - Building the context - Running the LLM - Splitting the LLM output in reasoning and actions - Instantiating the new actions and listing id's to delete - Deleting the old actions ### Web System The `WebSystem` uses an `AgentCore` but doesn't run the main loop. It runs a modified main loop and interacts with the WebSystem. It also instantiates alternative actions for stdio to interact with the WebSystem. ### LLM Engine The `LLMEngine` does the LLM inference. It takes a context as string and returns an iterator of tokens. ### Inference Result An `InferenceResult` object contains the resoning and parsed actions. Parsing is part of the Inference Result constructor.