The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
adds an enterprise doc
Copple87b65d40c532
diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.tsindex 929454252e5..68761ad2543 100644--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts@@ -862,6 +862,7 @@ export const ai: NavMenuConstant = {items: [{ name: 'Overview', url: '/guides/ai' },{ name: 'Concepts', url: '/guides/ai/concepts' },+ { name: 'Structured & Unstructured', url: '/guides/ai/structured-unstructured-embeddings' },{name: 'Quickstarts',url: undefined,@@ -873,6 +874,7 @@ export const ai: NavMenuConstant = {items: [{ name: 'Creating collections', url: '/guides/ai/creating-collections' },{ name: 'Managing indexes', url: '/guides/ai/managing-indexes' },+ { name: 'Engineering for scale', url: '/guides/ai/engineering-for-scale' },],},{diff --git a/apps/docs/pages/guides/ai.mdx b/apps/docs/pages/guides/ai.mdxindex 6a27969492f..d4d0a002561 100644--- a/apps/docs/pages/guides/ai.mdx+++ b/apps/docs/pages/guides/ai.mdx@@ -11,7 +11,7 @@ export const meta = {Supabase provides a number of tools to get started with Vectors and Embeddings. These tools include:- An embedding store using the popular [pgvector](https://github.com/pgvector/pgvector/)-- A Python Library for managing collections called [Vecs](https://supabase.github.io/vecs/api)+- A Python Library for managing unstructured collections called [Vecs](https://supabase.github.io/vecs/api)## Examplesdiff --git a/apps/docs/pages/guides/ai/engineering-for-scale.mdx b/apps/docs/pages/guides/ai/engineering-for-scale.mdxnew file mode 100644index 00000000000..797fbd18af4--- /dev/null+++ b/apps/docs/pages/guides/ai/engineering-for-scale.mdx@@ -0,0 +1,96 @@+import Layout from '~/layouts/DefaultGuideLayout'++export const meta = {+ id: 'ai-engineering-for-scale',+ title: 'Engineering for Scale',+ description: 'Building an enterprise-grade vector architecture',+ subtitle: 'Building an enterprise-grade vector architecture.',+ sidebar_label: 'Engineering for Scale',+}++Because content sources for vectors can be extremely large, as you grow you should run your Vector workloads across several independent databases (sometimes called "pods"). This allows each collection to scale independently.++- [ ] TODO: PMC - add diagram++## Small workloads++For small workloads it's typical to store your data in a single database. You can expose collections to your application with [views](/docs/guides/database/tables#views):++- Main Project+ - `vecs` (schema)+ - `collection_one`+ - `collection_two`+ - `collection_three`+ - `public` (schema)+ - `collection_one` (view)+ - `collection_two` (view)+ - `collection_three` (view)++## Enterprise workloads++At this stage you should move the collections into their own projects, and start querying them directly wherever possible. You can still access them through foreign data wrappers.++- Project1+ - `vecs`+ - `collection_one`+- Project2+ - `vecs`+ - `collection_two`+- Project3+ - `vecs`+ - `collection_three`+- Main project+ - `public`+ - `collection_one` (foreign table)+ - `collection_two` (foreign table)+ - `collection_three` (foreign table)++## Choosing a database size++We can estimate the size you require either by the dimensionality of embeddings you require, or by the number of queries you expect to run. This is guidance only, and so you should monitor your database closely to manage any growth that you expect.++### By dimensionality++| `Compute Add-on` | `Dimensions` | `Estimated max vectors` |+| ---------------- | ------------ | ----------------------- |+| None | 512 | TBD |+| | 768 | TBD |+| | 1024 | TBD |+| Small | 512 | TBD |+| | 768 | TBD |+| | 1024 | TBD |+| Medium | 512 | TBD |+| | 768 | TBD |+| | 1024 | TBD |+| Large | 512 | TBD |+| | 768 | TBD |+| | 1024 | TBD |+| XL | 512 | TBD |+| | 768 | TBD |+| | 1024 | TBD |+| 2XL | 512 | TBD |+| | 768 | TBD |+| | 1024 | TBD |+| 4XL | 512 | TBD |+| | 768 | TBD |+| | 1024 | TBD |+| 8XL | 512 | TBD |+| | 768 | TBD |+| | 1024 | TBD |+| 8XL | 512 | TBD |+| | 768 | TBD |+| | 1024 | TBD |+| 12XL | 512 | TBD |+| | 768 | TBD |+| | 1024 | TBD |+| 16XL | 512 | TBD |+| | 768 | TBD |+| | 1024 | TBD |++### By queries per second++- [ ] TODO++export const Page = ({ children }) => <Layout meta={meta} children={children} />++export default Pagediff --git a/apps/docs/pages/guides/ai/structured-unstructured-embeddings.mdx b/apps/docs/pages/guides/ai/structured-unstructured-embeddings.mdxnew file mode 100644index 00000000000..144b584c4f4--- /dev/null+++ b/apps/docs/pages/guides/ai/structured-unstructured-embeddings.mdx@@ -0,0 +1,46 @@+import Layout from '~/layouts/DefaultGuideLayout'++export const meta = {+ id: 'structured-unstructured-embeddings',+ title: 'Structured and Unstructured embeddings',+ description: 'Structured and Unstructured embeddings',+ sidebar_label: 'Structured and Unstructured embeddings',+}++Most vector stores treat embeddings like NoSQL, unstructured data. Supabase is flexible enough to fit either a structured or an unstructured approach. Compare these code snippets:++Structured (SQL):++```sql+create table (+ id serial primary key,+ content text,+ embedding vector(1536),+ metadata jsonb+);+```++Unstructured (Python):++```py+import vecs++docs = vx.create_collection(name="docs", dimension=1536)+```++Both of these create a table where you can store your embeddings and some metadata.++## Choosing the right model++- Structured embeddings are typically colocated with some content that's already stored in your database.+- Unstructured embeddings are typically defined at Runtime, better-suited for a large body of external content.++Both approaches are fine, and depending on your use-case.++## Engineering for scale++Because the data source for vectors can be extremely large, as you grow you will want to run your Vector workload across several databases (sometimes called "pods"). This allows each collection to scale independently.++export const Page = ({ children }) => <Layout meta={meta} children={children} />++export default Page