diff --git a/.github/workflows/docs-lint-v2-scheduled.yml b/.github/workflows/docs-lint-v2-scheduled.yml new file mode 100644 index 00000000000..a5e125173cb --- /dev/null +++ b/.github/workflows/docs-lint-v2-scheduled.yml @@ -0,0 +1,64 @@ +name: '[Docs] Lint v2 (scheduled)' +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +env: + CARGO_NET_GIT_FETCH_WITH_CLI: true + +permissions: + contents: write + pull-requests: write + +jobs: + lint-all: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + sparse-checkout: | + supa-mdx-lint.config.toml + supa-mdx-lint + apps/docs/content + - name: cache cargo + id: cache-cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + key: 1b63d22ef9b987f802cba06f01ec0da4b8eb4847 + - name: install linter + if: steps.cache-cargo.outputs.cache-hit != 'true' + run: cargo install --locked --git https://github.com/supabase-community/supa-mdx-lint --rev 1b63d22ef9b987f802cba06f01ec0da4b8eb4847 + - name: run linter + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + supa-mdx-lint apps/docs/content || { + echo "Linter failed, attempting to fix errors..." + git config --global user.name 'github-docs-bot' + git config --global user.email 'github-docs-bot@supabase.com' + BRANCH_NAME="bot/docs-lint-fixes" + EXISTING_BRANCH=$(git ls-remote --heads origin $BRANCH_NAME) + if [ -n "$EXISTING_BRANCH" ]; then + git checkout $BRANCH_NAME + else + git checkout -b $BRANCH_NAME + fi + supa-mdx-lint apps/docs/content --fix || FIX_FAILED=1 + git add . + git commit -m '[bot] fix lint errors' || true + git push origin $BRANCH_NAME + if [ -z "$EXISTING_BRANCH" ]; then + gh pr create --title '[bot] fix lint errors' --body 'This PR fixes lint errors in the documentation.' --head $BRANCH_NAME + fi + if [ "${FIX_FAILED:-0}" -eq 1 ]; then + echo "Fix did not correct all errors." + exit 1 + fi + } diff --git a/.github/workflows/docs-lint-v2.yml b/.github/workflows/docs-lint-v2.yml index fc1112313fc..9cdaa44d506 100644 --- a/.github/workflows/docs-lint-v2.yml +++ b/.github/workflows/docs-lint-v2.yml @@ -1,20 +1,11 @@ name: '[Docs] Lint v2' on: pull_request: - paths: - - '.github/workflows/docs-lint-v2.yml' - - 'supa-mdx-lint.config.toml' - - 'apps/docs/content/**' - push: - branches: - - master - workflow_dispatch: env: CARGO_NET_GIT_FETCH_WITH_CLI: true permissions: - contents: write pull-requests: write jobs: @@ -29,8 +20,17 @@ jobs: supa-mdx-lint.config.toml supa-mdx-lint apps/docs/content + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 #v3.0.2 + id: filter + with: + filters: | + docs: + - 'apps/docs/content/**' + - 'supa-mdx-lint/**' + - 'supa-mdx-lint.config.toml' - name: cache cargo id: cache-cargo + if: steps.filter.outputs.docs == 'true' uses: actions/cache@v4 with: path: | @@ -38,16 +38,17 @@ jobs: ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ - key: 0be447eba738c3fd56698eff8ad01fa56c2391d7 + key: 1b63d22ef9b987f802cba06f01ec0da4b8eb4847 - name: install linter - if: steps.cache-cargo.outputs.cache-hit != 'true' - run: cargo install --locked --git https://github.com/supabase-community/supa-mdx-lint --rev 0be447eba738c3fd56698eff8ad01fa56c2391d7 + if: steps.filter.outputs.docs == 'true' && steps.cache-cargo.outputs.cache-hit != 'true' + run: cargo install --locked --git https://github.com/supabase-community/supa-mdx-lint --rev 1b63d22ef9b987f802cba06f01ec0da4b8eb4847 - name: install reviewdog + if: steps.filter.outputs.docs == 'true' uses: reviewdog/action-setup@3f401fe1d58fe77e10d665ab713057375e39b887 # v1.3.0 with: reviewdog_version: v0.20.2 - - name: run linter on PR - if: github.event_name == 'pull_request' + - name: run linter + if: steps.filter.outputs.docs == 'true' env: BASE_REF: ${{ github.base_ref }} REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -57,31 +58,3 @@ jobs: | { grep -E "^apps/docs/content/" || test $? = 1; } \ | xargs -r supa-mdx-lint --format rdf \ | reviewdog -f=rdjsonl -reporter=github-pr-review - - name: run linter on push or workflow dispatch - if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - supa-mdx-lint apps/docs/content || { - echo "Linter failed, attempting to fix errors..." - git config --global user.name 'github-docs-bot' - git config --global user.email 'github-docs-bot@supabase.com' - BRANCH_NAME="bot/docs-lint-fixes" - EXISTING_BRANCH=$(git ls-remote --heads origin $BRANCH_NAME) - if [ -n "$EXISTING_BRANCH" ]; then - git checkout $BRANCH_NAME - else - git checkout -b $BRANCH_NAME - fi - supa-mdx-lint apps/docs/content --fix || FIX_FAILED=1 - git add . - git commit -m '[bot] fix lint errors' || true - git push origin $BRANCH_NAME - if [ -z "$EXISTING_BRANCH" ]; then - gh pr create --title '[bot] fix lint errors' --body 'This PR fixes lint errors in the documentation.' --head $BRANCH_NAME - fi - if [ "${FIX_FAILED:-0}" -eq 1 ]; then - echo "Fix did not correct all errors." - exit 1 - fi - } diff --git a/.github/workflows/lint-prose.yml b/.github/workflows/lint-prose.yml deleted file mode 100644 index a652acb37c3..00000000000 --- a/.github/workflows/lint-prose.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: reviewdog -on: - pull_request: - paths: - - '.vale.ini' - - 'vale/**' - - 'apps/docs/content/**' - -jobs: - vale: - name: runner / vale - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - sparse-checkout: | - .vale.ini - vale - apps/docs/content - - name: Get changed files - id: changed-files - env: - BASE_REF: ${{ github.base_ref }} - SHA: ${{ github.sha }} - run: | - git fetch origin $BASE_REF - echo "CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRT origin/$BASE_REF $SHA | grep '^apps/docs/content/' | tr '\n' ',' | sed 's/,$//')" >> $GITHUB_OUTPUT - - uses: errata-ai/vale-action@reviewdog - with: - files: '${{ steps.changed-files.outputs.CHANGED_FILES }}' - separator: ',' diff --git a/README.md b/README.md index 3a165a26d6f..0524a4cf5dc 100644 --- a/README.md +++ b/README.md @@ -53,8 +53,8 @@ You can also [self-host](https://supabase.com/docs/guides/hosting/overview) and - [Postgres](https://www.postgresql.org/) is an object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance. - [Realtime](https://github.com/supabase/realtime) is an Elixir server that allows you to listen to PostgreSQL inserts, updates, and deletes using websockets. Realtime polls Postgres' built-in replication functionality for database changes, converts changes to JSON, then broadcasts the JSON over websockets to authorized clients. - [PostgREST](http://postgrest.org/) is a web server that turns your PostgreSQL database directly into a RESTful API. -- [GoTrue](https://github.com/supabase/gotrue) is a JWT based API for managing users and issuing JWT tokens. -- [Storage](https://github.com/supabase/storage-api) provides a RESTful interface for managing Files stored in S3, using Postgres to manage permissions. +- [GoTrue](https://github.com/supabase/gotrue)is a JWT-based authentication API that simplifies user sign-ups, logins, and session management in your applications. +- [Storage](https://github.com/supabase/storage-api)a RESTful API for managing files in S3, with Postgres handling permissions. - [pg_graphql](http://github.com/supabase/pg_graphql/) a PostgreSQL extension that exposes a GraphQL API. - [postgres-meta](https://github.com/supabase/postgres-meta) is a RESTful API for managing your Postgres, allowing you to fetch tables, add roles, and run queries, etc. - [Kong](https://github.com/Kong/kong) is a cloud-native API gateway. diff --git a/apps/docs/app/contributing/content.mdx b/apps/docs/app/contributing/content.mdx index a185cff8895..8bba9d59149 100644 --- a/apps/docs/app/contributing/content.mdx +++ b/apps/docs/app/contributing/content.mdx @@ -388,6 +388,14 @@ void main() async { +### Info Tooltip + +The InfoTooltip component is used to add more context to a word or phrase via tooltip. + +```mdx +Supabase +``` + ## Partials We incorporate content reuse in the docs to avoid duplication. If you find yourself writing the same content over and over, you can put it in a partial instead. Here are some examples of commonly used partials: diff --git a/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx b/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx index ca59f1707c2..883cb4224e4 100644 --- a/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx @@ -85,6 +85,13 @@ const pageMap = [ }, remoteFile: 'mssql.md', }, + { + slug: 'notion', + meta: { + title: 'Notion', + }, + remoteFile: 'notion.md', + }, { slug: 'paddle', meta: { diff --git a/apps/docs/app/reference/[...slug]/page.tsx b/apps/docs/app/reference/[...slug]/page.tsx index c15880c4e06..617ed1fc6f4 100644 --- a/apps/docs/app/reference/[...slug]/page.tsx +++ b/apps/docs/app/reference/[...slug]/page.tsx @@ -19,7 +19,6 @@ export default async function ReferencePage({ }: { params: { slug: Array } }) { - console.log("Generating reference page for '%o'", slug) if (!Object.keys(REFERENCES).includes(slug[0].replaceAll('-', '_'))) { notFound() } diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index bd5f0b3c2a3..07eb5eeb6bf 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -1107,6 +1107,10 @@ export const database: NavMenuConstant = { name: 'Connecting to MSSQL', url: '/guides/database/extensions/wrappers/mssql', }, + { + name: 'Connecting to Notion', + url: '/guides/database/extensions/wrappers/notion', + }, { name: 'Connecting to Paddle', url: '/guides/database/extensions/wrappers/paddle', diff --git a/apps/docs/components/index.tsx b/apps/docs/components/index.tsx index 78be0f2c7b2..1c724eb4fc3 100644 --- a/apps/docs/components/index.tsx +++ b/apps/docs/components/index.tsx @@ -9,6 +9,7 @@ import { Admonition } from 'ui-patterns/admonition' import { GlassPanel } from 'ui-patterns/GlassPanel' import { IconPanel } from 'ui-patterns/IconPanel' import { TabPanel, Tabs } from '~/features/ui/Tabs' +import InfoTooltip from '~/features/ui/InfoTooltip' // Common components import { CH } from '@code-hike/mdx/components' @@ -154,6 +155,7 @@ const components = { OAuthPkceFlow, Options, Param, + InfoTooltip, ProjectConfigVariables, ProjectSetup, QuickstartIntro, diff --git a/apps/docs/content/guides/ai/automatic-embeddings.mdx b/apps/docs/content/guides/ai/automatic-embeddings.mdx index 48f1f7389c6..c7542a4eea1 100644 --- a/apps/docs/content/guides/ai/automatic-embeddings.mdx +++ b/apps/docs/content/guides/ai/automatic-embeddings.mdx @@ -462,9 +462,9 @@ Deno.serve(async (req) => { // Custom headers to report job status headers: { - 'Content-Type': 'application/json', - 'X-Completed-Jobs': completedJobs.length.toString(), - 'X-Failed-Jobs': failedJobs.length.toString(), + 'content-type': 'application/json', + 'x-completed-jobs': completedJobs.length.toString(), + 'x-failed-jobs': failedJobs.length.toString(), }, } ) @@ -582,7 +582,7 @@ create table documents ( id integer primary key generated always as identity, title text not null, content text not null, - embedding halfvec, + embedding halfvec(1536), created_at timestamp with time zone default now() ); @@ -590,7 +590,9 @@ create table documents ( create index on documents using hnsw (embedding halfvec_cosine_ops); ``` -Our `documents` table stores the title and content of each document along with its vector embedding. We use a `halfvec` column to store the embeddings, which is a `pgvector` data type that stores float values in half precision (16 bits) to save space. +Our `documents` table stores the title and content of each document along with its vector embedding. We use a `halfvec(1536)` column to store the embeddings. + +`halfvec` is a `pgvector` data type that stores float values in half precision (16 bits) to save space. Our Edge Function used OpenAI's `text-embedding-3-small` model which generates 1536-dimensional embeddings, so we use the same dimensionality here. Adjust this based on the number of dimensions your embedding model generates. We use an [HNSW index](/docs/guides/ai/vector-indexes/hnsw-indexes) on the vector column. Note that we are choosing `halfvec_cosine_ops` as the index method, which means our future queries will need to use cosine distance (`<=>`) to find similar embeddings. Also note that HNSW indexes support a maximum of 4000 dimensions for `halfvec` vectors, so keep this in mind when choosing an embedding model. If your model generates embeddings with more than 4000 dimensions, you will need to reduce the dimensionality before indexing them. See [Matryoshka embeddings](/blog/matryoshka-embeddings) for a potential solution to shortening dimensions. @@ -777,11 +779,11 @@ The `embed` Edge Function processes a batch of embedding jobs and returns a `200 It also returns the number of completed and failed jobs in the response headers. For example: ``` -X-Completed-Jobs: 1 -X-Failed-Jobs: 1 +x-completed-jobs: 1 +x-failed-jobs: 1 ``` -You can also use the `X-Deno-Execution-Id` header to trace the execution of the Edge Function within the [dashboard](/dashboard/project/_/functions) logs. +You can also use the `x-deno-execution-id` header to trace the execution of the Edge Function within the [dashboard](/dashboard/project/_/functions) logs. Each failed job includes an `error` field with a description of the failure. Reasons for a job failing could include: @@ -798,7 +800,7 @@ select from net._http_response where - (headers->>'X-Failed-Jobs')::int > 0; + (headers->>'x-failed-jobs')::int > 0; ``` ## Conclusion diff --git a/apps/docs/content/guides/ai/concepts.mdx b/apps/docs/content/guides/ai/concepts.mdx index b1265c97885..984bae34831 100644 --- a/apps/docs/content/guides/ai/concepts.mdx +++ b/apps/docs/content/guides/ai/concepts.mdx @@ -20,6 +20,7 @@ Let's explore an example of text embeddings. Say we have three phrases: 1. "The cat chases the mouse" 2. "The kitten hunts rodents" + {/* supa-mdx-lint-disable-next-line Rule004ExcludeWords */} 3. "I like ham sandwiches" Your job is to group phrases with similar meaning. If you are a human, this should be obvious. Phrases 1 and 2 are almost identical, while phrase 3 has a completely different meaning. diff --git a/apps/docs/content/guides/ai/examples/building-chatgpt-plugins.mdx b/apps/docs/content/guides/ai/examples/building-chatgpt-plugins.mdx index a60bd59f979..f50a79761f3 100644 --- a/apps/docs/content/guides/ai/examples/building-chatgpt-plugins.mdx +++ b/apps/docs/content/guides/ai/examples/building-chatgpt-plugins.mdx @@ -115,7 +115,7 @@ For this example, we'll upload Postgres documentation to the datastore. Download curl -X POST -F \\"file=@./postgresql-15-US.pdf\\" ``` -The plugin will split your data and documents into smaller chunks automatically. You can view the chunks using the Supabase dashboard or any other SQL client you prefer. For the whole Postgres Documentation I got 7,904 records in my documents table, which is not a lot, but we can try to add index for `embedding` column to speed things up by a little. To do so, you should run the following SQL command: +The plugin will split your data and documents into smaller chunks automatically. You can view the chunks using the Supabase dashboard or any other SQL client you prefer. The entire Postgres Documentation yielded 7,904 records, which is not a lot, but we can try to add index for `embedding` column to speed things up by a little. To do so, you should run the following SQL command: ```sql create index on documents diff --git a/apps/docs/content/guides/ai/examples/image-search-openai-clip.mdx b/apps/docs/content/guides/ai/examples/image-search-openai-clip.mdx index 5bcb0c7b351..4d645b719f6 100644 --- a/apps/docs/content/guides/ai/examples/image-search-openai-clip.mdx +++ b/apps/docs/content/guides/ai/examples/image-search-openai-clip.mdx @@ -134,7 +134,7 @@ After activating the virtual environment with `poetry shell` you can now run you ## Perform an image search from a text query -With Supabase Vector we can easily query our embeddings. We can use either an image as search input or alternative we can generate an embedding from a string input and use that as the query input: +With Supabase Vector we can query our embeddings. We can use either an image as search input or alternative we can generate an embedding from a string input and use that as the query input: ```python def search(): @@ -164,7 +164,7 @@ def search(): By limiting the query to one result, we can show the most relevant image to the user. Finally we use `matplotlib` to show the image result to the user. -That's it, go ahead and test it out by running `poetry run search` and you will be presented with an image of a "bike in front of a red brick wall". +Go ahead and test it out by running `poetry run search` and you will be presented with an image of a "bike in front of a red brick wall". ## Conclusion diff --git a/apps/docs/content/guides/ai/examples/nextjs-vector-search.mdx b/apps/docs/content/guides/ai/examples/nextjs-vector-search.mdx index ee4048039ad..47d201dccf4 100644 --- a/apps/docs/content/guides/ai/examples/nextjs-vector-search.mdx +++ b/apps/docs/content/guides/ai/examples/nextjs-vector-search.mdx @@ -391,7 +391,7 @@ All of this is glued together in a [Vercel Edge Function](https://vercel.com/doc With the relevant content for the user's question identified, we can now build the prompt and make a text completion request via the OpenAI API. - If successful, the OpenAI API will respond with a `text/event-stream` response that we can simply forward to the client where we'll process the event stream to smoothly print the answer to the user. + If successful, the OpenAI API will respond with a `text/event-stream` response that we can forward to the client where we'll process the event stream to smoothly print the answer to the user. diff --git a/apps/docs/content/guides/ai/examples/semantic-image-search-amazon-titan.mdx b/apps/docs/content/guides/ai/examples/semantic-image-search-amazon-titan.mdx index 4f831e609da..debd28c5710 100644 --- a/apps/docs/content/guides/ai/examples/semantic-image-search-amazon-titan.mdx +++ b/apps/docs/content/guides/ai/examples/semantic-image-search-amazon-titan.mdx @@ -192,7 +192,7 @@ After activating the virtual environment with `poetry shell` you can now run you ## Perform an image search from a text query -With Supabase Vector we can easily query our embeddings. We can use either an image as the search input or alternatively we can generate an embedding from a string input and use that as the query input: +We can use Supabase Vector to query our embeddings. We can either use an image as the search input or generate an embedding from a string input: ```python def search(query_term: Optional[str] = None): @@ -227,7 +227,7 @@ def search(query_term: Optional[str] = None): By limiting the query to one result, we can show the most relevant image to the user. Finally we use `matplotlib` to show the image result to the user. -That's it, go ahead and test it out by running `poetry run search` and you will be presented with an image of a "bike in front of a red brick wall". +Go ahead and test it out by running `poetry run search` and you will be presented with an image of a "bike in front of a red brick wall". ## Conclusion diff --git a/apps/docs/content/guides/ai/hugging-face.mdx b/apps/docs/content/guides/ai/hugging-face.mdx index ee902d128ee..424c16dc55c 100644 --- a/apps/docs/content/guides/ai/hugging-face.mdx +++ b/apps/docs/content/guides/ai/hugging-face.mdx @@ -50,8 +50,8 @@ https://huggingface.co/settings/tokens Name your token based on the app its being used for and the environment. For example, if you are building an image generation app you might create 2 tokens: -- "My Image Generator (Dev)" -- "My Image Generator (Prod)" +- "Image Generator (Dev)" +- "Image Generator (Prod)" Since we will be using this token for the inference API, choose the `read` role. diff --git a/apps/docs/content/guides/ai/hybrid-search.mdx b/apps/docs/content/guides/ai/hybrid-search.mdx index 0a21fd1f83c..d0273dea535 100644 --- a/apps/docs/content/guides/ai/hybrid-search.mdx +++ b/apps/docs/content/guides/ai/hybrid-search.mdx @@ -8,13 +8,13 @@ sidebar_label: 'Hybrid search' Hybrid search combines [full text search](/docs/guides/ai/keyword-search) (searching by keyword) with [semantic search](/docs/guides/ai/semantic-search) (searching by meaning) to identify results that are both directly and contextually relevant to the user's query. -## Why would I want to use hybrid search? +## Use cases for hybrid search Sometimes a single search method doesn't quite capture what a user is really looking for. For example, if a user searches for "Italian recipes with tomato sauce" on a cooking app, a keyword search would pull up recipes that specifically mention "Italian," "recipes," and "tomato sauce" in the text. However, it might miss out on dishes that are quintessentially Italian and use tomato sauce but don't explicitly label themselves with these words, or use variations like "pasta sauce" or "marinara." On the other hand, a semantic search might understand the culinary context and find recipes that match the intent, such as a traditional "Spaghetti Marinara," even if they don't match the exact keyword phrase. However, it could also suggest recipes that are contextually related but not what the user is looking for, like a "Mexican salsa" recipe, because it understands the context to be broadly about tomato-based sauces. Hybrid search combines the strengths of both these methods. It would ensure that recipes explicitly mentioning the keywords are prioritized, thus capturing direct hits that satisfy the keyword criteria. At the same time, it would include recipes identified through semantic understanding as being related in meaning or context, like different Italian dishes that traditionally use tomato sauce but might not have been tagged explicitly with the user's search terms. It identifies results that are both directly and contextually relevant to the user's query while ideally minimizing misses and irrelevant suggestions. -## When would I want to use hybrid search? +## When to consider hybrid search The decision to use hybrid search depends on what your users are looking for in your app. For a code repository where developers need to find exact lines of code or error messages, keyword search is likely ideal because it matches specific terms. In a mental health forum where users search for advice or experiences related to their feelings, semantic search may be better because it finds results based on the meaning of a query, not just specific words. For a shopping app where customers might search for specific product names yet also be open to related suggestions, hybrid search combines the best of both worlds - finding exact matches while also uncovering similar products based on the shopping context. diff --git a/apps/docs/content/guides/ai/integrations/amazon-bedrock.mdx b/apps/docs/content/guides/ai/integrations/amazon-bedrock.mdx index 02699d3271d..dfb0b13813f 100644 --- a/apps/docs/content/guides/ai/integrations/amazon-bedrock.mdx +++ b/apps/docs/content/guides/ai/integrations/amazon-bedrock.mdx @@ -8,7 +8,7 @@ tocVideo: 'A3uND5sgiO0' [Amazon Bedrock](https://aws.amazon.com/bedrock) is a fully managed service that offers a choice of high-performing foundation models (FMs) from leading AI companies like AI21 Labs, Anthropic, Cohere, Meta, Mistral AI, Stability AI, and Amazon. Each model is accessible through a common API which implements a broad set of features to help build generative AI applications with security, privacy, and responsible AI in mind. -This guide will walk you through an example using Amazon Bedrock SDK with `vecs`. We will create embeddings using the Amazon Titan Embeddings G1 – Text v1.2 (amazon.titan-embed-text-v1) model, insert these embeddings into a PostgreSQL database using vecs, and then query the collection to find the most similar sentences to a given query sentence. +This guide will walk you through an example using Amazon Bedrock SDK with `vecs`. We will create embeddings using the Amazon Titan Embeddings G1 – Text v1.2 (amazon.titan-embed-text-v1) model, insert these embeddings into a Postgres database using vecs, and then query the collection to find the most similar sentences to a given query sentence. ## Create an environment @@ -69,7 +69,7 @@ for sentence in dataset: ### Store the embeddings with vecs -Now that we have our embeddings, we can insert them into a PostgreSQL database using vecs. +Now that we have our embeddings, we can insert them into a Postgres database using vecs. ```python import vecs diff --git a/apps/docs/content/guides/ai/keyword-search.mdx b/apps/docs/content/guides/ai/keyword-search.mdx index 9a97488a5cd..9ee03877831 100644 --- a/apps/docs/content/guides/ai/keyword-search.mdx +++ b/apps/docs/content/guides/ai/keyword-search.mdx @@ -10,7 +10,7 @@ Keyword search involves locating documents or records that contain specific word In Postgres, keyword search is implemented using [full-text search](/docs/guides/database/full-text-search). It supports indexing and text analysis for data retrieval, focusing on records that match the search criteria. Postgres' full-text search extends beyond simple keyword matching to address linguistic nuances, making it effective for applications that require precise text queries. -## Why would I want to use keyword search? +## When and why to use keyword search Keyword search is particularly useful in scenarios where precision and specificity matter. It's more effective than semantic search when users are looking for information using exact terminology or specific identifiers. It ensures that results directly contain those terms, reducing the chance of retrieving irrelevant information that might be semantically related but not what the user seeks. diff --git a/apps/docs/content/guides/ai/rag-with-permissions.mdx b/apps/docs/content/guides/ai/rag-with-permissions.mdx index 996659da5fd..fbb1f2a7111 100644 --- a/apps/docs/content/guides/ai/rag-with-permissions.mdx +++ b/apps/docs/content/guides/ai/rag-with-permissions.mdx @@ -119,7 +119,7 @@ RLS is latency-sensitive, so extra caution should be taken before implementing t -For data sources other than Postgres, see [Foreign Data Wrappers](/docs/guides/database/extensions/wrappers/overview) for a list of external sources supported today. If your data lives in a source not provided in the list, please contact [support](https://supabase.com/dashboard/support/new) and we'll be happy to discuss your use case. +For data sources other than Postgres, see [Foreign Data Wrappers](/docs/guides/database/extensions/wrappers/overview) for a list of external sources supported today. If your data lives in a source not provided in the list, contact [support](https://supabase.com/dashboard/support/new) and we'll be happy to discuss your use case. @@ -226,6 +226,8 @@ order by document_sections.embedding <#> embedding; +{/* supa-mdx-lint-disable-next-line Rule004ExcludeWords */} + You might be tempted to discard RLS completely and simply filter by user within the `where` clause. Though this will work, we recommend RLS as a general best practice since RLS is always applied even as new queries and application logic is introduced in the future. @@ -236,7 +238,7 @@ If you would like to use the auto-generated REST API to query your Supabase data See the [Clerk Supabase docs](https://clerk.com/docs/integrations/databases/supabase) for an example of how this can be done. Modify the instructions to work with your own auth provider as needed. -Now we can simply use the same RLS policy from our first example: +Now we can use the same RLS policy from our first example: ```sql -- enable row level security diff --git a/apps/docs/content/guides/ai/vecs-python-client.mdx b/apps/docs/content/guides/ai/vecs-python-client.mdx index 616dfa5b11a..2ec86911aca 100644 --- a/apps/docs/content/guides/ai/vecs-python-client.mdx +++ b/apps/docs/content/guides/ai/vecs-python-client.mdx @@ -5,7 +5,7 @@ subtitle: 'Manage unstructured vector stores in PostgreSQL.' breadcrumb: 'AI Quickstarts' --- -Supabase provides a Python client called [`vecs`](https://github.com/supabase/vecs) for managing unstructured vector stores. This client provides a set of useful tools for creating and querying collections in PostgreSQL using the [pgvector](/docs/guides/database/extensions/pgvector) extension. +Supabase provides a Python client called [`vecs`](https://github.com/supabase/vecs) for managing unstructured vector stores. This client provides a set of useful tools for creating and querying collections in Postgres using the [pgvector](/docs/guides/database/extensions/pgvector) extension. ## Quick start diff --git a/apps/docs/content/guides/ai/vector-columns.mdx b/apps/docs/content/guides/ai/vector-columns.mdx index eee63e05822..3cc79905896 100644 --- a/apps/docs/content/guides/ai/vector-columns.mdx +++ b/apps/docs/content/guides/ai/vector-columns.mdx @@ -7,7 +7,7 @@ sidebar_label: 'Vector columns' Supabase offers a number of different ways to store and query vectors within Postgres. The SQL included in this guide is applicable for clients in all programming languages. If you are a Python user see your [Python client options](/docs/guides/ai/python-clients) after reading the `Learn` section. -Vectors in Supabase are enabled via [pgvector](https://github.com/pgvector/pgvector/), a PostgreSQL extension for storing and querying vectors in Postgres. It can be used to store [embeddings](/docs/guides/ai/concepts#what-are-embeddings). +Vectors in Supabase are enabled via [pgvector](https://github.com/pgvector/pgvector/), a Postgres extension for storing and querying vectors in Postgres. It can be used to store [embeddings](/docs/guides/ai/concepts#what-are-embeddings). ## Usage diff --git a/apps/docs/content/guides/auth/_flow-template.mdx b/apps/docs/content/guides/auth/_flow-template.mdx index de1ba20a841..119a64ef053 100644 --- a/apps/docs/content/guides/auth/_flow-template.mdx +++ b/apps/docs/content/guides/auth/_flow-template.mdx @@ -3,6 +3,8 @@ title: A DESCRIPTIVE TITLE subtitle: A DESCRIPTIVE SUBTITLE --- +{/* supa-mdx-lint-disable */} + {/* Use this template to document Auth Flows. These should be how-to guides, walking the reader through the process of (1) enabling the feature and (2) triggering the flow from their code. */} A brief description of what this flow does. Don't get into details: if the concepts require a lot of explanation, make a separate page under Concepts. diff --git a/apps/docs/content/guides/auth/auth-email-passwordless.mdx b/apps/docs/content/guides/auth/auth-email-passwordless.mdx index 11deb30dccd..8a906f248ac 100644 --- a/apps/docs/content/guides/auth/auth-email-passwordless.mdx +++ b/apps/docs/content/guides/auth/auth-email-passwordless.mdx @@ -125,6 +125,8 @@ response = supabase.auth.sign_in_with_otp({ +{/* supa-mdx-lint-disable-next-line Rule004ExcludeWords */} + That's it for the implicit flow. If you're using PKCE flow, edit the Magic Link [email template](/docs/guides/auth/auth-email-templates) to send a token hash: diff --git a/apps/docs/content/guides/auth/auth-helpers/nextjs-pages.mdx b/apps/docs/content/guides/auth/auth-helpers/nextjs-pages.mdx index abc435c7719..9af561e396d 100644 --- a/apps/docs/content/guides/auth/auth-helpers/nextjs-pages.mdx +++ b/apps/docs/content/guides/auth/auth-helpers/nextjs-pages.mdx @@ -685,7 +685,7 @@ To make these helpers more flexible as well as more maintainable and easier to u Therefore we're marking the `withApiAuth`, `withPageAuth`, and `withMiddlewareAuth` higher order functions as deprecated and they will be removed in the next **minor** release (v0.6.X). -Please follow the steps below to update your API routes, pages, and middleware handlers. Thanks! +Follow the steps below to update your API routes, pages, and middleware handlers. Thanks! #### `withApiAuth` deprecated! @@ -874,9 +874,9 @@ export const config = { ### Migrating to v0.4.X and supabase-js v2 -With the update to `supabase-js` v2 the `auth` API routes are no longer required, therefore you can go ahead and delete your `auth` directory under the `/pages/api/` directory. Please refer to the [v2 migration guide](/docs/reference/javascript/v1/upgrade-guide) for the full set of changes within supabase-js. +With the update to `supabase-js` v2 the `auth` API routes are no longer required, therefore you can go ahead and delete your `auth` directory under the `/pages/api/` directory. Refer to the [v2 migration guide](/docs/reference/javascript/v1/upgrade-guide) for the full set of changes within supabase-js. -The `/api/auth/logout` API route has been removed, please use the `signout` method instead: +The `/api/auth/logout` API route has been removed, use the `signout` method instead: ```jsx