> For the complete documentation index, see [llms.txt](https://docs.glbnxt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.glbnxt.com/tutorials/guides/supabase/supabase-create-db-vdb.md).

# Creating Databases and Vector Databases in Supabase

This guide walks you through creating your first database table in **Supabase**, and then a special kind called a **vector database** — used to power AI features like chatbots that search your own documents. No coding experience required; everything below can be done by clicking through the Supabase dashboard, with a small amount of copy-paste where noted.

***

### What's the difference?

A **normal database table** stores information the way a spreadsheet does — rows and columns, like a list of customers, orders, or products.

A **vector database** stores that same kind of information, but adds one special column that captures the *meaning* of a piece of text (a paragraph, a support article, a PDF chunk) as a list of numbers. This is what allows an AI assistant to find "the most relevant answer" to a question, rather than just matching exact keywords.

***

### Prerequisites

* Access to your project in the **Supabase dashboard** (provided as part of your GLBNXT platform).

***

### Steps

#### Step 1: Create a normal database table

1. Open your Supabase dashboard and select your project.
2. In the left sidebar, click **Table Editor**.
3. Click **New Table**.
4. Give your table a name, for example `customers`.
5. Add the columns you need — think of each column as a category of information, like `name`, `email`, or `signup_date`. Click **Add Column** for each one, and choose the matching type (text, number, date, etc.).
6. Click **Save**.

Your table now exists, and Supabase automatically makes it available to any connected tool or app, with no extra setup needed.

> 💡 **Tip:** You don't need to plan every column perfectly upfront. You can always come back and add or remove columns later.

***

#### Step 2: Turn on vector support

Before you can create a vector database, your project needs one setting turned on.

1. In the left sidebar, click **Database**.
2. Click **Extensions**.
3. Search for **vector**.
4. Toggle it **on**.

This only needs to be done once per project.

***

#### Step 3: Create your vector table

Vector tables need one small piece of setup that isn't yet available as a simple button in the dashboard, so this step uses the **SQL Editor**.

1. In the left sidebar, click **SQL Editor**.
2. Click **New Query**.
3. Paste the following:

```sql
create table documents (
  id bigserial primary key,
  content text,
  metadata jsonb,
  embedding vector(1536)
);
```

4. Click **Run**.

In plain terms, this creates a table called `documents` with:

* `content` — the actual text (e.g. a paragraph from a manual).
* `metadata` — extra details about where it came from (e.g. the file name).
* `embedding` — the "meaning fingerprint" of that text, generated automatically by an AI model elsewhere in your workflow (for example in n8n or Langflow).

> 💡 **Tip:** The number `1536` matches the AI model most commonly used to generate these "fingerprints". If your GLBNXT setup uses a different model, we can help you confirm the right number to use here.

***

#### Step 4: Let your table connect to sources (optional, but recommended)

If your documents come from different places — different files, folders, or knowledge bases — it's useful to also keep a simple normal table listing those sources, and link your vector table to it. This way, every AI search result can also tell you exactly which file or document it came from.

```sql
create table sources (
  id bigserial primary key,
  name text
);

alter table documents add column source_id bigint references sources(id);
```

Now every row in your vector table can point back to a row in your normal table — so results always come with clear context, not just raw text.

***

### What happens next?

Once these tables exist, the rest of the work — actually generating the "meaning fingerprints" and searching through them — happens in the tools connected to your Supabase project, such as n8n or Langflow.

***

### Need More Information?

If anything in this guide is unclear, or you'd like help deciding how to structure your specific tables, reach out or visit the [Supabase Documentation Page](https://supabase.com/docs).

***

*Need help? Contact the GLBNXT support team or ask a GLBNXT agent to walk you through the setup.*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.glbnxt.com/tutorials/guides/supabase/supabase-create-db-vdb.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
