<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[OneSearch]]></title><description><![CDATA[OneSearch]]></description><link>https://onesearchapp.hashnode.dev</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1593680282896/kNC7E8IR4.png</url><title>OneSearch</title><link>https://onesearchapp.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 15:51:01 GMT</lastBuildDate><atom:link href="https://onesearchapp.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Designing a Local-AI Search Organizer That Survives Small-Model Failures]]></title><description><![CDATA[A search engine is good at ranking links. It is less helpful when a research task needs a map of the topic.
I built OneSearch to turn a flat result list into semantic folders while keeping the actual ]]></description><link>https://onesearchapp.hashnode.dev/designing-a-local-ai-search-organizer-that-survives-small-model-failures</link><guid isPermaLink="true">https://onesearchapp.hashnode.dev/designing-a-local-ai-search-organizer-that-survives-small-model-failures</guid><category><![CDATA[local ai]]></category><category><![CDATA[ollama]]></category><category><![CDATA[Tauri]]></category><category><![CDATA[Machine Learning]]></category><dc:creator><![CDATA[OneSearch]]></dc:creator><pubDate>Wed, 22 Jul 2026 14:02:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a60cb2079e24abe31776097/1f7200f6-fa7f-489e-ac19-ab4886ebac34.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A search engine is good at ranking links. It is less helpful when a research task needs a map of the topic.</p>
<p>I built <strong>OneSearch</strong> to turn a flat result list into semantic folders while keeping the actual source pages close at hand. The desktop app runs the organization pipeline locally with Ollama and keeps the resulting folder tree visible while pages open in separate in-app tabs.</p>
<p>The interesting engineering problem was not generating a folder name. It was keeping the whole search usable when a small local model produced an incomplete answer.</p>
<h2>The pipeline</h2>
<p>A OneSearch query moves through several explicit stages:</p>
<ol>
<li>Fetch, normalize, and deduplicate web results.</li>
<li>Build embedding text from each title, snippet, and domain.</li>
<li>Generate local embeddings through Ollama and cache them.</li>
<li>Cluster the vectors.</li>
<li>Extract keywords and representative domains for every cluster.</li>
<li>Ask a local Qwen model for labels, parent labels, and short summaries.</li>
<li>Build the folder hierarchy and return timing and cache diagnostics to the UI.</li>
</ol>
<p>The stages are deliberately separate. That makes failures visible and lets the app degrade one stage without discarding all earlier work.</p>
<h2>Clustering without trusting one algorithm</h2>
<p>Search-result sets vary a lot. Some queries produce several clean topics; others contain one broad theme plus a few outliers.</p>
<p>OneSearch starts with a lightweight HDBSCAN-style pass. If it cannot form at least two useful groups, the pipeline falls back to agglomerative clustering. If that result collapses into one group or creates one group per item, it tries k-means++.</p>
<p>Afterward, it removes outliers, merges overly similar groups, splits oversized groups, and balances the result. This is more code than calling a single clustering function, but it avoids treating one algorithm as universally correct.</p>
<h2>Where the 4B model failed</h2>
<p>The free configuration uses <strong>qwen3:4b</strong> for labeling. It is fast enough for a desktop workflow, but small models do not always follow a structured-output contract.</p>
<p>The most common failure was malformed or incomplete JSON. A label request could successfully finish at the model level and still be unusable by the application. Originally, that surfaced as a labeling error and made the whole search appear broken.</p>
<p>That was the wrong failure boundary. Search results, embeddings, clusters, keywords, and domains were already available. Only the human-friendly names were missing.</p>
<h2>A three-layer recovery path</h2>
<p>Version 1.0.0 handles labeling in three layers.</p>
<h3>1. Constrain generation</h3>
<p>The Ollama request uses JSON output, disables thinking text, sets temperature to zero, and limits the prediction budget. This reduces variation before parsing begins.</p>
<h3>2. Repair once</h3>
<p>If the first response is not valid JSON, OneSearch sends the raw output through one focused repair prompt. The repair request asks for minified JSON only and preserves the original data.</p>
<p>The retry is intentionally bounded. Repeating the same request indefinitely would make local latency unpredictable.</p>
<h3>3. Fall back deterministically</h3>
<p>If generation still fails, or if the response does not contain a complete entry for every cluster, the app creates labels from data it already trusts:</p>
<ul>
<li>the top cluster keywords,</li>
<li>the most representative domain,</li>
<li>a short slice of the first result title,</li>
<li>or a numbered search-group name as the final fallback.</li>
</ul>
<p>The hierarchy remains usable and the UI shows that folder names were recovered. Failed model output is not written to the label cache, while complete successful responses can be reused.</p>
<p>This changed a fatal AI dependency into an optional quality improvement.</p>
<h2>Desktop tradeoffs</h2>
<p>Local processing gives users control over the model and keeps the organization step on their machine, but it is not free of cost.</p>
<p>The first Ollama model download is large. Lower-memory machines take longer to embed and label a result set. The current macOS and Windows installers are also unsigned, so Gatekeeper or SmartScreen can display a warning. Those limitations are stated on the download page rather than hidden behind the launch message.</p>
<p>The next release priorities are code signing, clearer model-size guidance, and more real-world evaluation of folder cohesion.</p>
<p>OneSearch 1.0.0 is available for macOS Apple Silicon and Windows x64. The free workflow does not require an account.</p>
<p><a href="https://onesearch-download.adultdongsoo0516.chatgpt.site/?utm_source=hashnode&amp;utm_medium=community&amp;utm_campaign=1-0-launch">Try OneSearch and see the implementation details</a></p>
<p>I would especially value feedback on the fallback boundary: when a local model fails, is a deterministic but less polished label the right behavior, or should the UI stop and ask the user to retry?</p>
]]></content:encoded></item></channel></rss>