# Introduction

#### What is GaiaHub?

GaiaHub is a low-code tool designed for developers to create customized LLM orchestration flows and AI agents.

Developing LLM applications typically requires numerous iterations. GaiaHub's low-code, drag-and-drop UI allows for rapid iterations, enabling a faster transition from testing to production.


# Quickstart

Looking for the platform? Head to <https://platform.gaiahub.ai>

### Getting started with GaiaHub AI

The GaiaHub platform offers a seamless way for developers to integrate state-of-the-art LLM models into their applications and production workflows with just a few bocks using the builder. Our builder is available through our platform. To enable your applications, you need to activate payments on your account. Within moments, you'll be able to use our builder:

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2F8X8newhPGyFq3XRkHp5Q%2Fimage.png?alt=media&amp;token=a9964597-d7bb-48cf-a626-58445d21b007" alt=""><figcaption><p>The Builder</p></figcaption></figure>

An application is composed by blocks that represent the components of your application. After [setting up your OpenAI's credentials](/getting-started/adding-credentials), you can connect for example a ChatGPT block to a Conversation Chain and create your first app:

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2FmzsD5KyHSUogjmwqsnX8%2FAnatomy%20of%20a%20simple%20chatflow.png?alt=media&amp;token=563b49fa-a1c5-49ef-a446-fa85c4545f1e" alt=""><figcaption></figcaption></figure>


# Adding credentials

In order to connect to external services you need to add the credentials of those services to your GaiaHub's credentials list. So you'll be able to use it later in the service's blocks of your applications on the platform.

To do that, you just need to go to "Main menu >> Credentials >> Create New Credential"

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2F7AwFYkyMmHPq9BnnwZfT%2Fimage.png?alt=media&amp;token=ec07db63-dc7e-4424-b032-5409dffd188e" alt=""><figcaption><p>Create a new credential</p></figcaption></figure>

Then, you select the credential type. It can be a LLM service like ChatGPT, database, etc

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2FupUD5Spyd1fKb1ZRDKRd%2Fimage.png?alt=media&amp;token=0ebfbbde-32d2-49bd-a999-5770740aedce" alt=""><figcaption></figcaption></figure>

By last but not least, you will need to set a name and the credential key:

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2FULTPTvk8Y2XheN4FfsJ4%2Fimage.png?alt=media&amp;token=05444fe0-5084-4e76-94df-a3d37a4d2e2a" alt=""><figcaption><p>Add the key</p></figcaption></figure>

Now, hit enter and it's done! You've added your first credential!

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2FvQBtrQRDDImrDN7K8qnv%2Fimage.png?alt=media&amp;token=fe28078b-39bc-4e12-89f2-f713ad53e903" alt=""><figcaption></figcaption></figure>


# Variables

GaiaHub offers variables as a way to share information across your applications. For example, you could have a application summarising the important notes from a website in real time, and putting the results in a global variable that would later be read and used by another application.

To create your variables it's easy. You need to go on the left menu "Variables" > "Create New Variable":

Then, you'll set the variable's name and its type:

* **Static:** the value will be retrieved as it is
* **Runtime:** the value will be retrieved from the .env file

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2FdrmjC7iSu4rbBudvdTjD%2Fimage.png?alt=media&amp;token=75ad9ff9-0388-4546-bd42-3859691f1626" alt=""><figcaption></figcaption></figure>


# Add GaiaHub on your website

After creating your Chatbot, you might want to share it on your website, and here is how you do that:

In the app editor area, you'll find a sharing icon like in the picture:

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2F2vZPDC8WgmsHKnhR0q6a%2FScreenshot%202024-07-28%20at%2017.26.04.png?alt=media&amp;token=485dc0d6-694a-47e6-b8fe-4d7e76da8d36" alt=""><figcaption><p>Share your app</p></figcaption></figure>

In there you'll find several options to integrate your app with other things, like a website for example:

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2FODV889tYJWDY3kx1AaIH%2Fimage.png?alt=media&amp;token=b1c9af79-2d74-44f4-840d-8dd9f154ea9d" alt=""><figcaption><p>Share your app via javascript</p></figcaption></figure>

Then, click on the "copy" button:

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2F4XRDQvtrFnwLdpdVhVKD%2FScreenshot%202024-07-28%20at%2017.35.00.png?alt=media&amp;token=3d4b4725-58ed-49dc-94d0-cdb9fdbee785" alt=""><figcaption></figcaption></figure>

And finaly, inject that block of code in your website. Here, as an example, we'll add it to our "Hello world!" page:

````
```html
<!DOCTYPE html>
<html>
<head>
    <title>Hello World Website</title>
</head>


<script type="module">
    import Chatbot from "https://gaiahub.github.io/web-packages/gaia-embed/dist/web.js"
    Chatbot.init({
        chatflowid: "a9ad179d-6ebd-4431-9042-ca05c78edc09",
        apiHost: "https://api.gaiahub.ai",
    })
</script>


<body>
    <h1>Hello World</h1>
</body>
</html>
```
````

And you will see a little floating chat button on the bottom of your website:

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2Fr4C6EMHD3gmQJ7zfclcO%2Fimage.png?alt=media&amp;token=355347ef-e8f8-4a25-90b0-54149fe403d6" alt=""><figcaption></figcaption></figure>

\
\
But you also have other options:

* ReactJS
* Python
* cURL

You can pick up the option that best works for your use case.

Let us know if you need any help. Our team will be happy to help!

Happy hacking!


# Creating a simple LLM app

To create your first LLM app, you'll need 3 things:  credential, one LLM Node and one LLM Chain node.

For the sake of this example, we'll make an app that uses ChatGPT.&#x20;

### 1. Create New Chatbot

Open the main menu and click on "Chatbots" -> "Create new chatbot"

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2FpejsLbXGyrazHnllZZQ8%2FScreenshot%202024-07-20%20at%2012.35.33.png?alt=media&amp;token=8022dace-e08d-4497-8808-779d4f0426ad" alt=""><figcaption><p>Create new chatbot</p></figcaption></figure>

### 2. Give it a name

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2Fn92hfDOomw0GBVlalyfl%2Fimage.png?alt=media&amp;token=d35133a4-fdab-4556-b5e9-60bff6a69897" alt=""><figcaption><p>Give a name</p></figcaption></figure>

### 3. Add a new node "ChatOpenAI"

Click on the green floating button to add a new node, and search for "ChatOpenAI". Then, drag and drop it on the editor pane:

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2F2km3C09ooNW6VXFFkDsq%2Fimage.png?alt=media&amp;token=76aa3ae3-d0dd-4e4f-850e-93340004970f" alt=""><figcaption><p>Add ChatOpenAI Node</p></figcaption></figure>

### 4. Set the credentials

Click on "Change Parameters" button. It'll open the node's details where you will search for the [credentials you've created](/getting-started/adding-credentials) earlier. Then **Save Node Parameters**

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2Fd42C1MKoRDOVsZqA4Hbj%2Fimage.png?alt=media&amp;token=d48e30c8-5b1c-4225-b537-a32e05e15cd4" alt=""><figcaption><p>Here you can also configure other parameters if you want</p></figcaption></figure>

### 5. Add a "LLM Chain" node

Click on the green floating button to add a new node, and search for "LLM Chain". Then, drag and drop it on the editor pane:

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2FQW1WNvNBWR3UmMytmYfO%2Fimage.png?alt=media&amp;token=91dacdcd-f3b9-49f2-ac08-51a02a6623b0" alt=""><figcaption><p>Add LLM Chain node</p></figcaption></figure>

### 6. Connect the dots

<figure><img src="https://4201130305-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw5WCzT6qKpsr5PibWgDP%2Fuploads%2FWRGrCCk2FCNURxR1jH5f%2FScreenRecording2024-07-20at12.45.44-ezgif.com-video-to-gif-converter.gif?alt=media&amp;token=09aad415-740c-4bae-a557-999435b72b6b" alt=""><figcaption></figcaption></figure>


