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.

core
, llm
, embeddings
, utils
, main
, and tools
.The table below summarizes the submodules and their functionalities.
Submodule | Description |
---|---|
core |
|
utils | General utility functions that are used in the library. This includes functions for logging, error handling, and other common tasks. The |
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 |
embeddings | The same abstraction layer as |
main | No code interface for |
tools | Collection of tools that may be used by agents in |
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.