Menu

📰
0

The semantic search feature in my app taught me more about React state management than any tutorial

Reddit r/reactjs·u/Confident-Map9810·about 1 month ago
#wXsRZkf0
#state#semantic#similarity#react#mind#article
Reading 0:00
15s threshold

The semantic search feature in my app taught me more about React state management than any tutorial So I've been building On Your Mind (https://on-your-mind.pages.dev), an anonymous thought-sharing app where AI matches you with strangers thinking similar things in real time. The matching piece uses BGE-small embeddings and pgvector cosine similarity on the backend, but honestly the frontend work around it was the interesting challenge. The 'Matches' page shows you your semantic thought twins, people you've never met whose thoughts land in the same vector space as yours. Sounds simple to display. It wasn't. The problem: match scores update as new thoughts come in, embeddings resolve asynchronously, and the UI needed to feel alive without hammering the database. I went through three different approaches with useEffect and Supabase realtime subscriptions before landing on something that didn't either over-fetch or feel stale.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More