# GET STARTED

## **Overview:**

**Alchemist AI** is a no-code development platform (**NCDP**) that enables users to create software applications with just a simple description. By eliminating the need for coding expertise, our AI enables anyone from beginners to professionals to generate bespoke applications on the fly - ranging from simple utilities to games.

Our system involves **Natural Language Processing (NLP)**, **Code Generation**, **Web Framework Integration**, and access to a **Limited OS API**. The **Large Language Model** (**LLM)** plays a pivotal role throughout the process, handling everything from parsing user input to generating executable code.

## **Key Technical Components:**

1. [**User Input Processing (Natural Language Understanding)**](#id-1.-user-input-processing-natural-language-understanding)
2. [**Application Logic Generation**](#id-2.-application-logic-generation)
3. [**Code Generation and Deployment**](#id-3.-code-generation-and-deployment)
4. [**Execution Environment (Web Rendering and Sandbox)**](#id-4.-execution-environment-web-rendering-and-sandbox)
5. [**OS API Integration**](#id-5.-os-api-integration-limited-access)

***

#### **1. User Input Processing: Natural Language Understanding**

The first step is receiving a **natural language description** of the desired application. The input can range from simple commands like, "Build me a timer," to more complex instructions, such as "Create a game where I catch falling stars and gain points for each one caught."

**How It Works:**

* **Natural Language Processing (NLP)**: The system uses an LLM to **parse and understand** the user's input.
* The model is trained to **extract intent** (what the app is supposed to do), **attributes** (specific features, such as time tracking, game mechanics, etc.), and **constraints** (design preferences, platform considerations).

  **Example:**

  * User Input: "Create a game where I catch falling stars and gain points for each one caught."
  * **LLM’s interpretation**:
    * **Intent**: Game
    * **Features**: Falling objects, scoring points.
    * **Actions**: Catch, increase score.
    * **UI/UX**: Simple interface with moving objects and score display.
* **Entity Recognition**: The LLM also identifies key terms, like "falling objects," "score," and "game," and interprets them into actionable design components.

***

#### **2. Application Logic Generation**

Once the input is parsed, Alchemist AI proceeds to **generate the application logic**. This is where the **LLM** takes over to build the back-end logic for the app. The model constructs relevant algorithms, event handling, and UI behavior based on the recognized intent.

**How It Works:**

* The system determines the **type of application** (game, utility, tool, etc.) based on the input.
* It selects or generates a **template** based on the app type (for example, a template for a falling objects game, or a timer app).
* For games, the system may generate code for:
  * **Object Movement**: Physics-based calculations (e.g., gravity, speed) to simulate falling objects.
  * **User Interaction**: Detecting key presses or mouse movements for dodging actions.
  * **Scoring Logic**: Incrementing the score when the player avoids objects.
* For utilities like a timer, the **LLM** might:
  * **Define Timers**: Use `setInterval` or other mechanisms to update the time.
  * **Create Event Handlers**: Buttons for starting, pausing, or resetting the timer.
  * **Styling**: Generate CSS for a minimalist, clock-like design.
* The **LLM will also incorporate logic for handling user input dynamically**, like reacting to mouse clicks, keyboard presses, or form submissions.

***

#### **3. Code Generation and Deployment**

The heart of Alchemist AI lies in its ability to convert natural language instructions into **executable code**. This process involves generating HTML, CSS, and JavaScript, which are the core components of modern web-based applications.

**How It Works:**

* **HTML Generation**: Alchemist AI generates the static structure of the app using HTML. This includes:
  * **Layout**: Setting up containers for UI elements (buttons, scoreboards, etc.).
  * **Interactive Elements**: Generating HTML tags like buttons (`<button>`), input fields (`<input>`), and score displays (`<div>` or `<span>`).
* **CSS Generation**: The system generates the necessary styling for the app based on the input. For example:
  * **Themes**: Alchemist AI would generate appropriate CSS from user's input.
* **JavaScript Logic**: The **LLM** generates the necessary JavaScript to make the app interactive. This could include:
  * **Game Mechanics**: For example, randomizing the fall speed of objects or detecting collisions with the player’s character.
  * **Timers/Countdowns**: For applications like countdown timers or stopwatches.
  * **State Management**: Handling the app’s state (e.g., score, timer values, user input).

**Example Code Snippet for Falling Objects Game:**

```html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Falling Objects Game</title>
  <style>
    body { background-color: #222; color: white; font-family: Arial, sans-serif; }
    .falling-object { position: absolute; background: red; width: 30px; height: 30px; }
    #score { position: fixed; top: 10px; left: 10px; font-size: 20px; }
  </style>
</head>
<body>
  <div id="score">Score: 0</div>
  <script>
    let score = 0;
    const fallingObjects = [];
    function createFallingObject() {
      const obj = document.createElement('div');
      obj.className = 'falling-object';
      obj.style.left = `${Math.random() * window.innerWidth}px`;
      document.body.appendChild(obj);
      fallingObjects.push(obj);
    }
    function updateGame() {
      fallingObjects.forEach(obj => {
        let top = parseInt(obj.style.top || 0);
        if (top < window.innerHeight) {
          obj.style.top = top + 5 + 'px';
        } else {
          obj.remove();
          score++;
          document.getElementById('score').innerText = 'Score: ' + score;
        }
      });
    }
    setInterval(createFallingObject, 1000);
    setInterval(updateGame, 50);
  </script>
</body>
</html>
```

***

#### **4. Execution Environment (Web Rendering and Sandbox)**

Once the application is generated, it is rendered in an **iframe** or a similar web-based environment where the user can interact with the app. This ensures that the generated app can be viewed and tested directly in a browser.

**How It Works:**

* **Secure Sandboxing**: The generated code runs in a sandboxed environment to prevent security risks, such as unauthorized file system access or malicious behavior.
  * Alchemist AI ensures that any app’s code can only interact with the environment that is explicitly allowed by the platform’s **Limited OS API**.
  * The sandboxed environment provides a safe, isolated execution space, ensuring that even if the app has bugs or malicious code, it does not affect the user’s device.
* **Real-Time Feedback Loop**: Users can interact with the generated app (e.g., play the game, use the timer) and give feedback. This allows the AI to quickly adapt and re-generate the application with adjustments or fixes based on that feedback.

***

#### **5. OS API Integration (Limited Access)**

For applications that require interaction with the local environment (e.g., saving files, accessing system settings, or working with device hardware), the platform can integrate with a **Limited OS API**. This API would provide access to the file system, registry, and other OS-specific features in a secure and controlled manner.

**How It Works:**

* **File System Access**: Users can save files or load configuration settings within predefined directories, with the system ensuring that apps cannot access arbitrary locations on the user’s machine.
* **Registry Access (for Windows)**: The AI might be able to modify certain registry settings (e.g., saving application preferences) if the user requests such functionality.

***

### [Learn how to FORGE!](https://docs.alchemistai.app/docs/get-started/ai-laboratory)
