Foyshal Sarkar
← All work

Case study · LLM / RAG · Sep 2026

Phone Advisor: a local RAG and multi-agent system

Answers questions about Samsung phones and writes grounded reviews and comparisons, using only local open-source models. Built end to end: scraper, database, retrieval, agents, API and tests.

Context
Built solo as a technical assessment, in about three days
Stack
Python, requests + BeautifulSoup, SQLAlchemy (MySQL, PostgreSQL or SQLite), sentence-transformers (MiniLM), FAISS, Qwen2.5-1.5B-Instruct, CrewAI, FastAPI
Links
Demo (recorded answers) · Code on GitHub

Problem

People ask phone questions in very different shapes: "which has the best battery?", "compare the S23 and S24", "what camera does the S24 have?". A single vector search handles the last one well and the first two badly, because embeddings cannot rank numbers or guarantee that both phones in a comparison are retrieved.

Architecture

A question is classified by intent and sent to SQL ranking, a two-record comparison, or filtered FAISS search, then answered by a local model QuestionFastAPI /chat Intent routerphone + aspect SuperlativeSQL ORDER BY on parsed specs Comparisonload both spec sheets LookupFAISS, filtered by phone + aspect Qwen2.5-1.5Bor template fallback

Key decisions

Result

Evaluation

I built a labelled set of 188 questions (lookups, prices, comparisons, rankings, recommendations, nicknames such as "S23U", and off-topic questions), each checked against the database, and split it in half. I fixed routing using only the dev half, then measured once on the held-out test half.

Held-out test split (template mode, n = 92)BeforeAfter
Intent accuracy78.3%95.7%
Phone resolution76.7%100%
Retrieval hit@190.9%100%
Answer fact recall90.7%98.6%
Off-topic questions declined40.0%53–93%*
False declines0%0%

* 93.3% with all scope rules; 53.3% without three rules that happen to match only test questions, so the honest held-out gain is at the lower end. With the local LLM, answers whose every number is backed by the retrieved data rose from 86.4% to 93.5%. Full results

Limitations and next steps

← All work