
What it does
TypeFlow AI turns a personal document library into an active writing partner. Upload documents, and the platform chunks, embeds, and indexes them into Supabase vector search. From then on, autocomplete suggestions and chat answers are grounded in your material, not generic model knowledge.
Retrieval design
Autocomplete has a hard latency budget: suggestions must land while the user is still mid-thought. The pipeline uses a two-stage retrieval: a cheap keyword prefilter narrows candidates, then pgvector similarity ranks the survivors. Results are streamed token by token so the first characters appear in well under a second.
Document chat
Chat sessions carry conversational memory plus retrieval context. Every answer cites the chunks it used, and the analytics dashboard shows which documents actually earn their storage: query hit rates, dead documents, and topic clusters.
Lessons
Embedding quality mattered less than chunking strategy. Splitting on semantic boundaries (headings, argument turns) instead of fixed token windows cut hallucinated answers dramatically before any prompt engineering.