Skip to content
~/rahultank
all projects

AI Blog — Summaries & Q&A

A full-stack blog with AI summaries and Q&A that answers strictly from each article — streamed token-by-token with no chat SDK.

  • React 19
  • TypeScript
  • Express
  • Gemini
  • SSE

An article platform where every post gets an AI summary and a Q&A box that answers only from that article's content and declines anything out of scope. The streaming pipeline is hand-built end to end: no chat SDK, just typed SSE events read from a ReadableStream.

// Problem

I wanted real-time AI features in a content product without pulling in a heavyweight chat SDK — and without the model wandering off-topic or hallucinating beyond the article in front of the reader.

// Approach

Grounded each answer in the single article's content and had the model decline out-of-scope questions by design, so hallucination is prevented structurally rather than patched after the fact.

// Architecture

The backend writes each Gemini chunk as a typed `data:` SSE event; a `useStreamingAI` hook reads the ReadableStream, buffers partial events across chunk boundaries, and appends tokens to React state as they arrive. Deployed across Vercel (frontend) and Railway (backend) with a health-checked API.

// Outcome

A public live demo with token-by-token streaming and reliable cross-chunk parsing — proof that a robust streaming UX doesn't need a vendor SDK.