Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

make tag names consistent

Jonathan Summers-Muirb8f25916679d
diff --git a/apps/www/_blog/2021-02-09-case-study-roboflow.mdx b/apps/www/_blog/2021-02-09-case-study-roboflow.mdx
index 97888890d83..6d4baeb302b 100644
--- a/apps/www/_blog/2021-02-09-case-study-roboflow.mdx
+++ b/apps/www/_blog/2021-02-09-case-study-roboflow.mdx
@@ -9,8 +9,7 @@ authorURL: https://github.com/roryw10
image: roboflow-og.png
thumb: roboflow-website.png
tags:
- - case-study
- - AI
+ - case-studyai
date: '02-09-2021'
---
diff --git a/apps/www/_blog/2023-02-03-openai-embeddings-postgres-vector.mdx b/apps/www/_blog/2023-02-03-openai-embeddings-postgres-vector.mdx
index c04183c99b0..a866367a9ef 100644
--- a/apps/www/_blog/2023-02-03-openai-embeddings-postgres-vector.mdx
+++ b/apps/www/_blog/2023-02-03-openai-embeddings-postgres-vector.mdx
@@ -6,14 +6,14 @@ image: embeddings/og_pgvector.png
thumb: embeddings/og_pgvector.png
tags:
- postgres
- - ai
+ - AI
date: '2023-02-06'
toc_depth: 3
---
A new PostgreSQL extension is now available in Supabase: [`pgvector`](https://github.com/pgvector/pgvector), an open-source vector similarity search.
-The exponential progress of AI functionality over the past year has inspired many new real world applications. One specific challenge has been the ability to store and query _embeddings_ at scale.
+The exponential progress of AI functionality over the past year has inspired many new real world applications. One specific challenge has been the ability to store and query _embeddings_ at scale.
In this post we'll explain what embeddings are, why we might want to use them, and how we can store and query them in PostgreSQL using `pgvector`.
## What are embeddings?
@@ -88,11 +88,12 @@ create extension vector;
Next let's create a table to store our documents and their embeddings:
```sql
-create table documents (
- id bigserial primary key,
- content text,
- embedding vector (1536)
-);
+create table
+ documents (
+ id bigserial primary key,
+ content text,
+ embedding vector (1536)
+ );
```
`pgvector` introduces a new data type called `vector`. In the code above, we create a column named `embedding` with the `vector` data type. The size of the vector defines how many dimensions the vector holds. OpenAI's `text-embedding-ada-002` model outputs 1536 dimensions, so we will use that for our vector size.
@@ -147,9 +148,9 @@ Once your table starts to grow with embeddings, you will likely want to add an i
Each distance operator requires a different type of index. We expect to order by cosine distance, so we need `vector_cosine_ops` index. A good starting number of lists is 4 \* sqrt(table_rows):
```sql
-create index on documents
-using ivfflat (embedding vector_cosine_ops)
-with (lists = 100);
+create index on documents using ivfflat (embedding vector_cosine_ops)
+with
+ (lists = 100);
```
You can read more about indexing on `pgvector`'s GitHub page [here](https://github.com/pgvector/pgvector#indexing).
diff --git a/apps/www/_blog/2023-02-07-chatgpt-supabase-docs.mdx b/apps/www/_blog/2023-02-07-chatgpt-supabase-docs.mdx
index 6c1b29a9e70..0773f7c9713 100644
--- a/apps/www/_blog/2023-02-07-chatgpt-supabase-docs.mdx
+++ b/apps/www/_blog/2023-02-07-chatgpt-supabase-docs.mdx
@@ -5,7 +5,7 @@ author: paul_copplestone
image: docsgpt/og_supabase_clippy.png
thumb: docsgpt/og_supabase_clippy.png
tags:
- - ai
+ - AI
- docs
date: '2023-02-07'
toc_depth: 3
@@ -55,13 +55,13 @@ It's built with Supabase/Postgres, and consists of several key parts:
All the changes we made are in [this](https://github.com/supabase/supabase/pull/12056) Pull Request. Greg is here to explain every step in full detail:
<div class="video-container">
-<iframe
- title="ClippyGPT"
- src="https://www.youtube-nocookie.com/embed/Yhtjd7yGGGA"
- frameborder="1"
- allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
- allowfullscreen
-></iframe>
+ <iframe
+ title="ClippyGPT"
+ src="https://www.youtube-nocookie.com/embed/Yhtjd7yGGGA"
+ frameborder="1"
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
+ allowfullscreen
+ ></iframe>
</div>
You can find a full write up in our previous blog post: [Storing OpenAI embeddings in Postgres with pgvector](https://supabase.com/blog/openai-embeddings-postgres-vector).
@@ -90,13 +90,13 @@ A few weeks ago I received an email, drawing our attention to a [Pull Request](h
After we merged the PR, I reached out to see if Greg was interested in helping with some documentation or a blog post to help the community to use pgvector. On the call, Greg surprised me with an initial prototype where he had ingested the Supabase docs for a ChatGPT-like experience. I was suitably impressed and suggested that we could explore ways to work together to build it into the Supabase docs. He wasted no time:
<div class="video-container">
-<iframe
- title="ClippyGPT"
- src="https://www.youtube-nocookie.com/embed/yAsR7oe5vng"
- frameborder="0"
- allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
- allowfullscreen
-></iframe>
+ <iframe
+ title="ClippyGPT"
+ src="https://www.youtube-nocookie.com/embed/yAsR7oe5vng"
+ frameborder="0"
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
+ allowfullscreen
+ ></iframe>
</div>
### A friendly collaboration