Building a notes chatbot: why semantic search fails on dates and membership queries
bzarnal · reddit · 2026-10-17
A developer building an AI chat interface for a note-taking app shares architecture lessons on feeding context to gpt-4o-mini cost-effectively.
- Semantic search/RAG performs poorly on membership queries ("notes in the folder I created 2 weeks ago", "travel notes not in the music folder updated before August") and date-range queries ("last week", "3 days before June 1")
- Option A: dump all notes into context — expensive with strong models, hallucination-prone with mini models
- Option B: first convert the user question into structured filters (one prompt for date ranges, one for membership) applied to MongoDB, then run semantic search on the filtered results and feed top-k to the LLM
He asks the community for tried-and-tested approaches, plug-and-play libraries, model recommendations at comparable cost, and validation of his design.
More from coding & agent
- Poll: 70% say chat is not the final form of agent UI — jonathan_wilke · 2026-10-17
- 'Yes, I'm a Full Stack Engineer': The Joke About Juggling Claude, Codex and OpenCode Models — rachittshah · 2026-10-17
- Reddit dev shares checkpoint-and-clear loop for running AI agents for days without losing state — Motiv31 · 2026-10-17
- 14B judge no better than 8B: one prompt tweak lifted grading from 3/14 to 10/14 — Lost-Masterpiece2400 · 2026-10-17
- Reddit user slams Codex for over-engineering: turning a 30-second task into an hour-long run — Reaper_1492 · 2026-10-17
- 10 open-source repos for training small models to do your agent's job — victor_explore · 2026-10-17