The Domain in more detail

The Domain is the core component of Rakis, responsible for managing the entire inference and consensus process. It acts as the orchestrator, coordinating the various components and ensuring smooth operation of the system.

The Domain is represented by the TheDomain class, which serves as the entry point for initializing and interacting with Rakis. It orchestrates the workflow by connecting all the essential components, such as the Inference DB, Packet DB, Peer DB, Embedding Engine, and LLM Engine.

Initialization and Bootup

The TheDomain class is a singleton, ensuring that only one instance exists at any given time. The bootup method is used to initialize the system, and it accepts options for configuring the initial state, such as the identity password and the desired number of embedding and LLM workers.

Step 1

Initialize the client information (synthient ID and private key) using the provided identity password.

Step 2

Create instances of the P2P network connections based on the enabled networks specified in the settings.

Step 3

Initialize and await the P2P network instances to ensure they are ready for communication.

Step 4

Instantiate the TheDomain class, passing in the client information, P2P network instances, and initial worker configurations.

Step 5

Set up connections and event listeners between the various components, enabling seamless communication and data flow.

Step 6

Scale the embedding and LLM workers to the desired initial counts, ensuring sufficient computational resources are available.

After the initialization process, the TheDomain instance is ready to handle incoming inference requests, manage the consensus process, and facilitate communication across the network.

Core Responsibilities

The TheDomain class serves as the central hub, coordinating the following key responsibilities:

  1. Inference Request Processing: Handling incoming inference requests, prioritizing and queueing them for processing, and managing the inference lifecycle.
  2. Consensus Management: Orchestrating the consensus process for inference results, including quorum management, embedding verification, and consensus packet propagation.
  3. Component Coordination: Facilitating communication and data flow between the various components, ensuring seamless integration and efficient operation.
  4. P2P Network Management: Interacting with the P2P networks for broadcasting and receiving packets, establishing connections, and handling network events.

The TheDomain class achieves these responsibilities by leveraging the capabilities of its constituent components and managing their interactions through event-driven mechanisms.

💡

The TheDomain class is the heartbeat of Rakis, ensuring smooth operation and coordination of the entire system. It serves as the glue that binds the various components together, enabling efficient and decentralized inference processing and consensus achievement.

To learn more about the specific workflows and interactions within the Domain, refer to the following subsections:

These subsections provides a detailed look into the inner workings of the Domain, where the orchestration that enables Rakis to function as a permissionless, decentralized AI inference network, takes place.