David Long's Work | ContraWork by David Long
David Long

David Long

AI Engineer + Creative Technologist | AI, 3D & Spatial

    6
    Followers
Followed by Kraig M, Seth D, and Muhammad
Cover image for AI SDK + RAG chat
AI SDK + RAG chat (Postgres / pgvector) What is RAG? RAG stands for retrieval-augmented generation. Instead of hoping the model already "knows" your facts, you retrieve snippets that match the user's question and augment the prompt with that text so generation is grounded in your data. Why is RAG important? Large language models only see what they were trained on (plus whatever you put in the context window). That breaks down for private or fresh information: internal docs, product details, notes you typed yesterday, or anything after a model's knowledge cutoff. RAG fixes that by fetching relevant passages at query time and passing them in as context, so answers can stay accurate and attributable to your sources. A minimal intuition: without extra context, "What's my favorite food?" gets a generic refusal. With retrieved context ("user loves pepperoni + pineapple pizza), the model can answer correctly—because you gave it the fact, not because it remembered you. Note: Retrieval can be web search, a file store, or anything else. Here I use semantic search over embeddings stored in Postgres. That's one solid pattern, not the only one.
2
141
Beach Bum Barry is a pilot episode of an animated sitcom. It follows Barry, an honest guy who tries his best but always seems to mess things up. Heartbreak awaits Barry in the parking lot... or does it?
0
114
A flat photo is one thing. A depth map is a cheat code: it tells the shader what’s “near” and “far,” so the same image can bend, break, and breathe in 3D-ish ways without a full 3D scene. I’ve been playing with a scanning + depth setup in the browser: React Three Fiber, Three.js WebGPU, and TSL so the effects live in node materials — readable, tweakable, and ready to animate. Three moods from the same idea: Ocean Depths — sine waves distort the UVs, weighted by depth; a scan line rolls through with a cool screen-blended highlight. It reads like light moving through water. Digital Fragments — the image sorts into cells; deeper regions shift more, so the picture feels like it’s being re-sorted in place. Pointer movement nudges the distortion — “reality rearranged.” System Malfunction — noise and RGB split kick in only in a band around the scan; the glitch breathes with GSAP. The vibe is broken signal, not random noise. Add bloom on top and you get something that feels cinematic, not like a tech demo — even though under the hood it’s mostly math on textures.
0
126
Print halftone is old news — doing it live on a 3D scene in the browser still feels like magic. I’ve been building Halftone, a small WebGL playground: Next.js, React Three Fiber, and custom fragment shaders piped through a post-processing stack so the “ink” isn’t a texture trick — it’s math on the framebuffer, dot by dot, row by row. You can swap modes — classic luminance dots, CMYK screens at different angles, a gooey dot treatment — and orbit a Meebit or a procedural blob while you dial pixel size, colors, and more in the panel (press H if you want the canvas clean). It’s part experiment, part love letter to real-time graphics and the gap between print craft and GPU pixels. If you care about shaders, creative dev, or why your “simple filter” is actually half a dozen uniforms — you’ll feel at home here.
0
143