#fastapi

5 posts

Optimizing Guest-to-Login Data Transfer: From 4s to 100ms

How reordering async operations, splitting API calls, and deferring storage moves eliminated a 4-second login delay and fixed missing chat history.

Python asynccontextmanager & FastAPI Lifespan Pattern

How @asynccontextmanager and yield divide startup/shutdown in FastAPI lifespan, and how dunder methods __aenter__/__aexit__ work as Python's context manager protocol.

AI Pipeline Patterns from LinguaRAG: RAG, Streaming, and Prompt Architecture

A comprehensive breakdown of AI pipeline concepts learned building LinguaRAG — a Korean-German textbook AI tutor using RAG, SSE streaming, multi-layer prompts, and pgvector.

Supabase Auth + FastAPI JWT Verification: HS256 → ES256 Migration

New Supabase projects sign JWTs using the ES256 algorithm. How to verify with PyJWT + JWKS client and how to resolve macOS Python SSL issues.

RAG Architecture Fundamentals — pgvector, FastAPI, SSE Streaming, and Embedding Models

Core RAG concepts understood while planning LinguaRAG: offline/online phase separation, SSE streaming mechanics, prompt assembly, and the role of pgvector.