JimmyLv

@jimmylv
1 Followers
0 Following
702 Posts

🚧 building https://chatvid.ai
https://bibigpt.co
https://pipigpt.co
https://airss.co

🐣learning & earning while helping others
❀️making software, storytelling videos

βœ… Summary: Postgres Maximalism

We use Postgres for Search, Auth, Vectors, and JSON.
Keep your stack simple and your architecture lean.

Next: 2.4 Task Queues.
Don't let heavy AI tasks block your database connections. πŸš€

#BibiGPT #Postgres #pgvector #Database #FullStack

4/ πŸ›‘οΈ Migration-Based Workflow

Never modify your schema manually.
BibiGPT follows a strict migration-based flow. Every change is an auditable .sql file in the repo.
Version control for your database is a non-negotiable.

3/ πŸ” Semantic Search

The core of RAG (Retrieval-Augmented Generation).
User Question -> Vector -> Cosine Distance -> Result.
We implement this logic inside Postgres using SQL functions. Computing happens right next to the data. Fast.

2/ 🧠 pgvector: The Brain of Postgres

Traditional SQL LIKE queries cannot find 'meaning'.
With pgvector, Postgres stores and retrieves Embeddings directly.
Ditch the complexity of a separate Vector DB like Pinecone. One database to rule them all.

1/ πŸ“¦ Hybrid Schema: Relational meets NoSQL

BibiGPT uses JSONB for AI outputs like subtitles and summaries.
Why? Because AI output structure changes fast.
JSONB gives us the flexibility of NoSQL without sacrificing SQL's strong consistency.

πŸ’Ύ Module 2.3: Database Design - Memory for AI

Deep in the castle vaults: Module 2.3.
Designing for AI is different. You need Relational Metadata, Unstructured JSON, and High-dimensional Vectors all in one place. πŸ‘‡ Thread

βœ… Summary: The Backend Gateway

From SSR clients to RLS deep defense, Supabase is more than a database β€” it is your gateway.

Next: 2.3 Database Design.
Modeling for AI Search and RAG. πŸš€

#BibiGPT #Supabase #Auth #FullStack #IndieHacker

4/ πŸš€ 2025 Standard: PKCE

For maximum security, we use the PKCE flow.
By exchanging codes on the backend, we eliminate the risk of leaking Access Tokens in the URL Hash.
Professional SaaS demands professional security.

3/ 🧱 SQL as the "Constitution"

Defining logic in SQL Policies is far more robust than scattered 'if' statements in code.
This is the lifeblood of multi-tenant security for any AI SaaS.

2/ πŸ” RLS: The Database Firewall

Row Level Security (RLS) is the killer feature.
Even if your API has a bug, the database layer enforces 'auth.uid() = user_id'.
Stop relying on fragile API checks; let the database verify identity.