Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Supabase 10 min read How-to mediumAdept

Build a content recommendation app with Flutter and OpenAI

A Flutter movie app recommends related films by storing OpenAI text-embedding-3-small embeddings of TMDB movie overviews in Supabase Postgres with pgvector. A Supabase Edge Function fetches popular movies from TMDB, generates 1536-dimension embeddings and upserts them into a films table. A SQL database function, backed by an HNSW index with cosine distance, returns the six nearest movies, excluding the current one, and the Flutter details page calls it via RPC. Recommending from a user's whole viewing history, rather than a single movie, is left as an open extension.

Related posts

  • Generate embeddings with Neon AI Gateway

    Neon mediumAdept

    Neon AI Gateway now serves embedding models on its OpenAI-compatible /v1/embeddings endpoint using the same branch-scoped credential as chat, accepting up to 150 inputs per request. Two models launch: qwen3-embedding-0-6b (1024 configurable dimensions, normalized, $0.02 per 1M tokens) and gte-large-en (1024 dimensions, unnormalized, $0.13 per 1M tokens), with qwen recommended unless matching existing vectors. Combined with Object Storage triggers, Functions, Lakebase Postgres and the lakebase_vector/lakebase_text search extensions, a full RAG pipeline (ingest, embed, store, hybrid retrieve, generate) runs inside one Neon branch, letting teams re-embed and evaluate model or chunking changes against production data without duplicating storage.

  • Build your own ChatGPT-style doc search with Fresh, OpenAI, and Supabase

    Deno mediumAdept

    A Deno Fresh starter template builds a ChatGPT-style documentation search on Supabase Postgres with pgvector and OpenAI. A GitHub Action running Deno preprocesses .mdx docs, generates OpenAI embeddings and stores them in Postgres, using per-file checksums so only changed files are re-embedded. At query time an edge endpoint embeds the question, runs a pgvector similarity search, injects the matching doc sections into a text-davinci-003 completion prompt, and proxies the streamed SSE response to a Fresh island that reads it with EventSource.

  • ChatGPT plugins now support Postgres & Supabase

    Supabase mediumAdept

    Supabase contributed Postgres and Supabase datastore providers to OpenAI's ChatGPT Retrieval Plugin, storing text-embedding-ada-002 embeddings in pgvector. The Postgres provider connects directly via psycopg2, while the Supabase provider goes through PostgREST to enable Row Level Security. Both share the same documents schema and use a plpgsql match function that filters by source, author and date and ranks results by inner product distance. A walkthrough ingests the PostgreSQL 15 docs (about 7,904 chunks), adds an approximate ivfflat index with lists ≈ rows/1000, and registers the local plugin with ChatGPT to answer documentation questions.

  • SQLite Retrieval Augmented Generation and Vector Search

    Turso mediumAdept

    Retrieval-augmented generation fixes stale or hallucinated LLM answers by retrieving relevant data, typically via embeddings and vector similarity search, and injecting it into the prompt. libSQL adds native vector search to SQLite: embeddings are stored in an F32_BLOB column (SQLite treats column types as hints), inserted with a vector() function, and queried with vector_distance_cos() plus ORDER BY/LIMIT for exact top-k results. That exact search is a full table scan and only scales to small datasets, so larger collections need approximate nearest-neighbour indexing, which a follow-up post will cover.

  • Building Vector Search and Personal Knowledge Graphs on Mobile with libSQL and React Native

    Turso mediumAdept

    Kin, a local-first personal AI app, stores its agent memory as a vector-searchable knowledge graph on the user's device using libSQL through the OP-SQLite React Native binding, enabled with a package.json flag. Nodes and edges live in relational tables with F32_BLOB embedding columns. Edges are indexed with libsql_vector_idx, using compress_neighbors and max_neighbors to save space, and queried via vector_top_k joined on rowid, with distance computed by vector_distance_cos. Practical gotchas include serializing Float32Array vectors into dynamic SQL because OP-SQLite lacks typed-array parameters, and iOS/Android build clashes when other packages such as expo-updates or expo-sqlite compile their own SQLite.

The quest for software engineering knowledge.

Look:
Layout: