SABRAMAN

SABRAMAN DANYA YUDIN КАРТОН SABRAMAN DANYA YUDIN КАРТОН SABRAMAN DANYA YUDIN КАРТОН SABRAMAN DANYA YUDIN КАРТОН SABRAMAN DANYA YUDIN КАРТОН SABRAMAN DANYA YUDIN КАРТОН
GEO / AI Search Engine
Case Study

PLONQ AI Search

Production-ready hybrid vector-keyword RAG search and recommendation engine optimizing catalog query understanding, citation rates, and semantic discovery.

Problem and context

Standard keyword search failed to resolve conversational queries like 'sweet mint device with high puff count' or 'flavor similar to apple but without ice'. The strict lexer dropped users into blank results, while typical LLM chatbot integrations hallucinated non-existent catalog items, harming user trust.

To solve this, we needed a robust, low-latency hybrid search engine tailored for Telegram mini app interfaces. It had to map imprecise, intent-rich user expressions to strict database entities, ensuring 100% catalog compliance while showing clear citations and source transparency.

RAG Pipeline & Retrieval Architecture

We built a multi-stage retrieval architecture running on Convex. The pipeline converts catalog data into optimized chunks of 200-500 tokens, embedding them using OpenAI's text-embedding-3-small (1536 dimensions) to capture flavor profiles, device parameters, and usage contexts.

The search is hybrid: a vector search query runs in parallel with a keyword BM25 search index. A reciprocal rank fusion (RRF) algorithm combines the results, weighted dynamically based on query length. This balances high semantic recall (finding 'berry breeze' for 'forest fruit') with exact keyword filtering (finding '1200' for model numbers).

Before retrieval, an LLM-driven decomposition step normalizes incoming queries, extracting intent filters (e.g., puff count range, flavor profile, brand constraint) and converting them into strict metadata parameters passed directly to Convex query filters.

AI Synthesis & Answer-First UX

The UI adopts an 'Answer-First' layout. Instead of forcing users to scroll past product cards to read descriptions, the system provides a direct, concise summary response (2-3 sentences max) at the very top, immediately followed by interactive, checkable product cards that match the retrieval sources.

To guarantee citation integrity, we implemented a strict verification consensus step: the generation model (Gemini-1.5-Flash) is constrained by a JSON schema that forces it to reference only the retrieved document IDs. Any item mentioned in the text must have a verified link to a database product card.

We integrated real-time latency optimization, streaming responses chunk-by-chunk to the user while fetching product image tokens, reducing the perceived time-to-first-token (TTFT) to under 250ms.

Tooling and Tech Stack

The serverless backend runs on Convex, offering reactive document syncing and built-in vector search. Node.js edge functions handle the integration with OpenAI embedding models and Gemini API orchestration.

The client application is built with React, styled using vanilla CSS variables for dynamic theme adaptation inside Telegram WebApp containers. Global state synchronization handles search history, cart updates, and persistent user preferences.

Outcome and metrics

Semantic matching resolved over 92% of conversational queries that previously yielded empty search screens. User engagement within the search screen rose by 34%, measured by repeat query runs per session.

By prioritizing Answer-First layouts with explicit citation marks, the average click-through rate (CTR) on recommended product cards grew from 11% to 27%, confirming that direct text justifications build strong user trust.

Constraints and tradeoffs

Maintaining a hybrid ranking system introduces tuning complexity. We had to carefully balance RRF coefficients to prevent short model numbers from dominating over semantic flavor expressions.

Serverless vector index updates have a propagation delay of up to 10 seconds. We built a local cache verification layer to ensure that out-of-stock items are omitted from search results in real time.

FAQ

Why was the document chunk size set to 200-500 tokens?

This range matches the semantic density of individual product catalogs. Chunks smaller than 200 tokens lose key context (like brand metadata), while chunks larger than 500 tokens dilute specific details, reducing the cosine similarity match precision.

How does the system prevent hallucinated product names?

The generation step uses strict function calling and JSON schemas. The LLM cannot invent product names; it is only allowed to synthesize descriptions using the exact text snippets retrieved from the Convex vector database, citing the source document IDs.

What metrics were used to evaluate search success?

We measured Citation Rate (ensuring every answer has at least 1 verified source card), Answer Reach (percentage of semantic queries answered without fallback), and Click-Through Rate (CTR) on cited product links.

Related projects

Sabraman Logo

Danya Yudin (Sabraman)

Designer & Frontend Engineer

Design-led frontend and product developer specializing in web applications, interface design, and Telegram systems.

INTERESTED IN WORKING TOGETHER?

Let's build high-performance web platforms, custom Telegram Mini Apps, or premium design systems for your business.