Elemental | Documentation
Structure and organization

Organization of Elemental

The Elemental library is designed to be modular and extensible, allowing developers to easily integrate new components and functionalities. The library is organized into several submodules, each serving a specific purpose.

Library structure

The Elemental library is structured to provide a clear separation of concerns, making it easier to navigate and understand.

Elemental includes few submodules, with major functionalities being separated. Main component of the library is the core submodule, which contains the core functionalities required to build agent and agent teams. Other submodules include llm, embeddings, utils, main, and tools. The structure is displayed in the figure below.

Structure of the Elemental library
Structure of the Elemental library. Submodules are separated by their functionality and drawn in purple. These include core, llm, embeddings, utils, main, and tools.

The table below summarizes the submodules and their functionalities.

Submodule Description
core

core module is the main module including all functionalities required to build agents and agent teams. This submodule includes the core components of the library, such as agent, executor, prompt_strategy, templates, memory, toolbox, instruction, unit, unit_executor, selector, orchestration, driver, and taskqueue. The core module also includes the orchestration methods and the driver for the agent.

utils

General utility functions that are used in the library. This includes functions for logging, error handling, and other common tasks. The utils module is designed to be reusable and can be used in other projects as well. This module also includes components for general observability, simple vector database interface DB, and methods like RAG.

llm

Internal abstraction layer to support different LLM providers. The abstraction provides consistent interface for several LLM serving frameworks and allows to easily choose provider and the model in a simple string provider_name|model_name. Currently supported frameworks include OlLama, LLama.cpp, OpenAI, Anthropic, and any OpenAI compatible service. The llm module supports streaming and retries.

embeddings

The same abstraction layer as llm, but for embeddings. The creation of embedding vectors is supported for Ollama, OpenAI and Llama.cpp. Provider and model are specified in the same way as for LLM using provider_name|model_name.

main

No code interface for Elemental. This module includes a command line interface using the default orchestration method. Agent configuration is done using a simple YAML file.

tools

Collection of tools that may be used by agents in Elemental. The tools are implemented as Tool classes and are used by agents to perform specific tasks.

Core components

The core components are the building blocks of the library and are used to build agents and agent teams. The building blocks and their relations are defined in Agent Building Blocks page and the detailed description of core components is done in Core Components page.

LLM and Embeddings abstraction

The Elemental library provides an internal abstraction layer for LLM and embeddings with llm and embeddings modules. The abstraction layer allows to easily switch between different LLM providers and models. The LLMs and embeddings are specified using a simple string format provider_name|model_name. The supported providers include Ollama, Llama.cpp, OpenAI, Anthropic, and any OpenAI compatible service. The library also supports streaming and retries for model calls.

Detailed discussion of the model abstraction is available in the LLM and Embeddings page.

Observability

Elemental includes an observability module that can be used to track the performance of the agents. The observability module is designed to be flexible with respect to the destination of the reporting and is integrated into the agent flow. The observability module includes methods for reporting to screen, file, database and webhook for easy integration with external systems.