Skip to content
Go back / Projects

MindStore AI

A retrieval-augmented generation (RAG) app — upload PDFs, text, or Markdown and chat with them using streamed AI answers grounded in your own documents, with local embeddings and no paid embedding API.

MindStore AI

Overview

personal2026-06

A retrieval-augmented generation (RAG) app — upload PDFs, text, or Markdown and chat with them using streamed AI answers grounded in your own documents, with local embeddings and no paid embedding API.

Tech Stack

Next.jsTypeScriptPostgreSQLXenova TransformersOpenAITailwind CSSPDF ParseVercel

Challenges & Learnings

MindStore AI answers questions from a user's own uploaded documents rather than a model's general knowledge. On upload, text is extracted, split into ~150-word overlapping chunks, and embedded locally with a Transformers.js pipeline (all-MiniLM-L6-v2) — avoiding per-call costs from a hosted embeddings API — then stored in Supabase Postgres. Retrieval is deliberately simple: rather than reaching for pgvector or an ANN index, every chunk is pulled back into memory and scored with a hand-rolled cosine-similarity function. That's a real tradeoff — easy to reason about and zero extra infrastructure, but it won't scale past a small document set before becoming a bottleneck. The top-matching chunks get stitched into a system prompt and streamed to the client through a hand-written SSE parser, rather than a higher-level SDK streaming helper. The app also fails gracefully: missing Supabase or AI provider config returns a clear 503 with a setup hint instead of crashing.