# General overview

The SAGA framework will enable various computational processes, combining runtime implementations of open-source or proprietary code, to be posted and executed on any device connected to the framework and offering its computational capacities. It will also allow these computational processes to access various data sources advertised within the framework. The internal tokenomics of SAGA will integrate the technical architecture into an economic framework, providing appropriately governed market incentives available for each participant in the network and beneficial for the self-organizational dynamics of the framework.

First and foremost, at its core, the architecture of SAGA will provide an open-ended collection of pluggable APIs, allowing independent and economically/socially incentivized participants (consumers, producers, and network operations agents) to inject and/or consume information into/from the decentralized data, management, and control plane of the framework.

Secondly, SAGA will provide a decentralized control plane for network participants to autonomously construct and execute ad-hoc computational workflows, combining independent computational and economic actors.

Thirdly, SAGA will provide tooling and development environments and tokenomic incentives for third parties to enhance and/or completely redesign any network component or API.

The first and second aspects are crucial to the operation of the SAGA framework and will be initially developed by SAGA core developers. However, to achieve the long-term vision and ambition of SAGA, all three aspects will have to be continuously developed and support each other.

The third aspect is crucial for attracting community and business partners.

The collection of pluggable open APIs and the decentralized control plane will enable SAGA to operate as a decentralized service mesh - or rather as an ecosystem of ad-hoc service mesh implementations of each computational workflow. It is decentralized in the sense that it does not have a single controller or orchestrator, and each ad-hoc mesh network implementing a computational workflow and its runtime environment will be completely autonomous from each other.

Furthermore, each ad-hoc mesh network is decentralized in the sense that it is constituted from economically independent and computationally isolated components/participants. Network operation agents are those components of the infrastructure that will provide independent construction, orchestration, execution, clearing, and settlement of all computational and tokenomic transactions involved in ad-hoc service meshes. However, network operation agents will be economic actors in their own right and will, therefore, be able to offer their underlying computational workflows within the same SAGA framework and infrastructure of open APIs. Therefore, SAGA will lay the groundwork for a dynamic, infinitely extendable, and evolving ecosystem of ad-hoc service meshes - a decentralized computational universe and a global economy of decentralized computing.

All computing processes, no matter how powerful or simple, are based on three fundamental aspects: memory, communication, and functional transformations of data. Computational infrastructures at every scale are built by providing increasingly complex architectures for combinations of the components that realize these three aspects. None of them are free of charge: the implementation of memory and communication requires both physical resources and energy, and the design of functional transformations requires intelligence and time. Additionally, all of these computing processes are certainly associated with specific types of legal ownership and economic value.

The architecture of SAGA is based on the principle that physically and logically decentralized networks should also be managed in a decentralized way, which, contrary to established approaches, allows one to increase the security and privacy of network constituents, along with providing next-level capabilities for optimized data and workflows. We are convinced that decentralization, openness, and freedom of data and resource sharing do not need to be traded for individual security and privacy; rather, they can complement and reinforce each other if done right using available technologies. Therefore, the design philosophy is based on the core principle of decentralized systems and distributed trust, where the network is considered insecure and the trustworthiness of messages and identities of workflow components questionable until this is proven at the level of each individual agent of the network. SAGA adapts and expands this principle for decentralized workflow organization, where each node of the network has the power to decide, negotiate economic or social benefits, and commit resources and data to the computational workflow organized in a decentralized manner by other nodes in the network.

Technically, these principles will be realized through the following architectural components:

* An open and organically evolving API of APIs for enabling interactions between components of the platform as provided by stakeholders:
  * Hardware (sourced from compute providers);
  * Data (sourced by data providers);
  * Tasks and results (consumers);
  * And AI services (sourced from AI service providers and network operators).
* Lightweight SAGA adapters running as portably as possible across the participating decentralized computing networks and infrastructures. SAGA agents will provide a low-level API to be utilized by computational agents, enabling four main functionalities: computational reflection, context awareness, mobility, and value exchange. SAGA adapters will be installed on every component upon registration on the platform but will expose different APIs depending on the type of component (e.g., resource description API and service ingestion API on compute providers and AI service provider nodes, task description and validation APIs on consumer nodes, and various APIs on network operator nodes, etc.);
* Network operating agents, which will provide capabilities and AI services for managing the SAGA network itself, including matching demands of consumers with offers of computational capabilities and available data by producers; constructing, calculating costs, time, and orchestrating proper execution of computational workflows as ad-hoc service meshes composed of independent components. Technically, network operating agents will be special-purpose AI algorithms and programs, executed on the SAGA infrastructure like other components and exposed to API of APIs via SAGA adapters. Network operating agents, however, will have a special status in that they will be responsible for the execution of each computational workflow, negotiate smart contracts, and settle transactions.
* SAGA tokenomics, providing, on the one hand, the basis for value interchange between independent components of the network, single basis for cost calculations, transactions, and, on the other hand, the economic dynamics driving sustainable network development.
