<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hlin on Medium]]></title>
        <description><![CDATA[Stories by Hlin on Medium]]></description>
        <link>https://medium.com/@hlin2097?source=rss-c520dc677dc4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*neFCviZ7-x4UG8xN</url>
            <title>Stories by Hlin on Medium</title>
            <link>https://medium.com/@hlin2097?source=rss-c520dc677dc4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 20:10:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hlin2097/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[I’m Not a Programmer. I Used Qwen to Build an AI Agent That Knows When to Say “I Don’t Know.”]]></title>
            <link>https://medium.com/@hlin2097/im-not-a-programmer-i-used-qwen-to-build-an-ai-agent-that-knows-when-to-say-i-don-t-know-e26dcdb7f844?source=rss-c520dc677dc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e26dcdb7f844</guid>
            <category><![CDATA[qwen-cloud-hackathon]]></category>
            <category><![CDATA[ft-ir]]></category>
            <category><![CDATA[qwen]]></category>
            <dc:creator><![CDATA[Hlin]]></dc:creator>
            <pubDate>Wed, 08 Jul 2026 12:59:42 GMT</pubDate>
            <atom:updated>2026-07-08T12:59:42.739Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NK1JgPoDoK82-UNKs2Qa4w.png" /></figure><p>I’ve spent nearly 20 years in analytical testing labs — running FTIR spectrometers, interpreting spectra, writing reports. I taught myself Python in 2024, built a spectral platform (<a href="https://ftir.fun/">FTIR.fun</a>) that now has 130,000+ reference spectra and users across 50+ countries, and entered a hackathon to see if I could build something that solves the hardest problem I face at work.</p><p>Not identification. That part is easy when the answer is clean. The hard problem is what happens when it isn’t.</p><h3>The problem nobody talks about</h3><p>Run an unknown spectrum against a good library and you’ll often get a page of near-tied candidates. In a real case I use for testing, the top two matches score 0.9137 and 0.9092 — a gap of 0.0045 — with fifteen plausible names on the list. A ranked list like that does not answer the analyst’s actual question: <em>what can I defensibly conclude, and what should I do next?</em></p><p>Most AI tools would pick the top result and present it confidently. That’s exactly the wrong answer in a pharma QC lab or a forensic investigation, where acting on a wrong call is worse than admitting you don’t know.</p><h3>What I built</h3><p>ChemSpectra Agent is an AI autopilot for FTIR spectral interpretation. It uses Qwen 3.7-Max (via Alibaba Cloud DashScope) with Function Calling to route each question through six real analytical tools — library search, peak-meaning explanation, spectrum-quality check, deterministic direction arbitration, chemistry cross-validation, and public-case lookup.</p><p>The key idea is simple: when you can’t lock a single compound, check whether the candidates at least agree on what <em>kind</em> of material it is.</p><p>In that 0.91-vs-0.91 sample, the Top-1 candidate holds only 6.9% of the weighted candidate pool — but all fifteen candidates map to the same chemical family, so the direction confidence is 100%. The agent returns GREEN: the evidence is strong enough to act on.</p><p>On a harder sample — a plant oil where the top score is only 0.8182 and entity share is again low — the agent can’t lock a single compound. But 10 of the 15 candidates converge on the same ester family (66.6% direction confidence). The agent returns YELLOW and generates a concrete lab plan to narrow it down.</p><p>On a genuinely ambiguous sample (top score 0.8029, direction share only 36.4%), the same system returns RED and says: no defensible call exists. Three consecutive runs on that same sample return identical numbers — score 0.8029, confidence 0.6423. Identical, because the verdict comes from Python arithmetic, not from the LLM.</p><h3>The part I’m most proud of</h3><p>The agent doesn’t just identify materials. It classifies its own certainty into three levels:</p><ul><li><strong>GREEN</strong> — evidence is strong enough to act on</li><li><strong>YELLOW</strong> — can’t name the compound, but the family is clear, and here’s what test to run next</li><li><strong>RED</strong> — candidates diverge, and the honest answer is “I don’t know”</li></ul><p>That three-level system comes from 20 years of making these calls by hand. A senior analyst already does this — they just do it in their head. I wrote it as auditable Python rules. Every peak assignment comes with a literature DOI. Every step is logged in a timestamped JSON audit trail. There is a human confirmation checkpoint before any report is generated.</p><h3>Why I built it without a framework</h3><p>There’s no LangChain, no agent framework. The ReAct loop is about 200 lines of Python making direct API calls to DashScope with enable_thinking=True. I did this because I wanted to understand every decision the system makes — and because when a regulator or a client asks &quot;how did the AI reach this conclusion?&quot;, the answer needs to be traceable, not hidden inside a framework&#39;s abstraction layers.</p><p>The LLM decides which tool to call. The host decides what evidence is required. If the model tries to skip a step — say, jumping to a conclusion without running cross-validation — the host runs the missing tool itself and feeds the result back. The model narrates; the rules decide.</p><h3>What I learned</h3><p>The best AI applications come from people who understand the problem, not from people who understand AI. I didn’t know what Function Calling was six months ago. But I know exactly when a spectral match is trustworthy and when it isn’t, because I’ve been making that judgment call since 2007.</p><p>Verification matters more than accuracy claims. A deterministic rule engine is easier to trust than another LLM round. Exposing uncertainty earns more credibility than hiding it. And teaching an AI system to say “I don’t know” turned out to be harder — and more important — than teaching it to say “yes.”</p><p>Try it: <a href="https://chemspectra.ftir.fun/">chemspectra.ftir.fun</a></p><p>Source code: <a href="https://github.com/jxbaoxiaodong/chemspectra-agent">github.com/jxbaoxiaodong/chemspectra-agent</a></p><p>*Built for the Qwen Cloud Hackathon 2025 (Track 4: Autopilot Agent) using qwen3.7-max on Alibaba Cloud DashScope.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e26dcdb7f844" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I’m Not a Programmer. I Built an AI Agent with 55 Countries of Users.]]></title>
            <link>https://medium.com/@hlin2097/im-not-a-programmer-i-built-an-ai-agent-with-52-countries-of-users-aea35d853dd8?source=rss-c520dc677dc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/aea35d853dd8</guid>
            <category><![CDATA[qwen]]></category>
            <category><![CDATA[ft-ir]]></category>
            <category><![CDATA[qwen-cloud-hackathon]]></category>
            <dc:creator><![CDATA[Hlin]]></dc:creator>
            <pubDate>Fri, 26 Jun 2026 06:26:56 GMT</pubDate>
            <atom:updated>2026-07-02T13:26:47.112Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XQ35Z_picPEzSKFTKkdg3A.png" /></figure><p>How a materials science grad student taught himself Python and shipped a production AI platform — #QwenCloudHackathon*</p><p>I need to start with a confession: I’m not a software engineer. I’m a materials science graduate student. My daily work involves FTIR spectroscopy — shining infrared light through samples to identify what they’re made of.</p><p>Every unknown sample that came into our lab meant the same ritual: run the FTIR scan (30 seconds), then spend the next 30 to 60 minutes staring at peaks, flipping through handbooks, searching reference databases, cross-checking literature, and writing up the report. Multiply that by dozens of samples. Every day.</p><p>In 2024, I decided to teach myself Python. Not because AI was trending. Because I was tired of doing the same tedious analysis by hand, knowing a computer could do it faster and more consistently.</p><h3>From Script to Platform</h3><p>What started as a personal tool became <a href="https://ftir.fun/">FTIR.fun</a> — a production platform with:</p><ul><li><strong>130,000+</strong> DOI-linked reference spectra</li><li><strong>20+</strong> file formats (SPC, SPA, OPUS, JDX, CSV, XLSX, and more)</li><li><strong>Users in 55 countries</strong></li><li><strong>Paying customers</strong> since 2025</li></ul><p>I built the spectral matching engine, the file parsers, the knowledge graph for peak interpretation, the three-axis search system (hash screening → similarity ranking → AI evidence synthesis). All self-taught.</p><h3>Why I Built an Agent</h3><p>The platform worked well for experts — upload a spectrum, get matches, read the analysis. But not every lab has a trained spectroscopist. Some users would get a list of 10 candidate materials and not know which one to trust. Others would miss that the functional group evidence contradicted the top match.</p><p>I needed an AI layer that could do what I do manually: look at results from multiple angles, notice when something doesn’t add up, investigate further, and only commit to an answer when the evidence is consistent.</p><p>That’s ChemSpectra Agent. For the Qwen Cloud Hackathon (Track 4: Autopilot Agent), I built a ReAct reasoning loop powered by Qwen-3.7-Max that autonomously selects from 5 analysis tools, cross-validates evidence, and self-verifies when confidence is low.</p><h3>What Domain Knowledge Gives You</h3><p>Here’s what a software engineer building a generic agent wouldn’t think of:</p><p><strong>Evidence conflict detection.</strong> If the library matcher says the sample is PET (polyethylene terephthalate), there <em>must</em> be ester groups (C=O near 1730 cm⁻¹) and aromatic rings in the functional group analysis. If they’re missing, something is wrong. I encoded these chemical consistency rules because I know them from years of bench work:</p><pre>expected_groups = {<br>    &quot;pet&quot;: [&quot;ester&quot;, &quot;c=o&quot;, &quot;aromatic&quot;],<br>    &quot;nylon&quot;: [&quot;amide&quot;, &quot;n-h&quot;, &quot;c=o&quot;],<br>    &quot;polyethylene&quot;: [&quot;c-h&quot;, &quot;ch2&quot;, &quot;methylene&quot;],<br>    &quot;silicone&quot;: [&quot;si-o&quot;, &quot;si-c&quot;, &quot;siloxane&quot;],<br>}</pre><p>A generic agent framework wouldn’t have these rules. A materials scientist would.</p><p><strong>Confidence calibration.</strong> Not all high-scoring matches are reliable. If the top two candidates score 0.89 and 0.87, that’s ambiguous — the gap is too small. If they score 0.89 and 0.52, that’s decisive. I built this into the confidence estimation because I’ve been burned by misleading match scores in manual analysis.</p><p><strong>Human-in-the-loop by design.</strong> In regulated industries (pharma, forensics, environmental testing), AI cannot make final decisions alone. The agent deliberately pauses and presents its findings — confidence trace, tools used, chemical reasoning — and requires explicit human confirmation before generating the final report. This isn’t a UX choice. It’s a compliance requirement. I know this because I work in this field.</p><h3>The Qwen Integration</h3><p>All LLM reasoning runs through Alibaba Cloud’s dashscope SDK with qwen3.7-max:</p><ul><li><strong>Function Calling</strong> — Qwen autonomously selects which of 5 tools to invoke</li><li><strong>Thinking mode</strong> (enable_thinking=True) — full chain-of-thought visible during analysis</li><li><strong>Multi-round reasoning</strong> — 3–6 Qwen API calls per analysis, adaptive depth</li><li><strong>Self-repair</strong> — when JSON parsing fails, Qwen corrects its own output with error context</li></ul><p>Six distinct Qwen call sites: tool selection (ReAct loop), synthesis, verification, self-repair, follow-up chat, and report generation. One model, one provider, six different reasoning tasks.</p><h3>What I Learned</h3><p>The best AI applications come from people who understand the problem deeply. I didn’t build ChemSpectra Agent because I wanted to build an AI product. I built it because I needed a better way to do my actual job.</p><p>If you’re a domain expert sitting on years of specialized knowledge, you have something most AI developers don’t: you know what “correct” looks like. You know which edge cases matter. You know why a 95% accuracy rate isn’t good enough when the 5% errors end up in regulatory filings.</p><p>Teach yourself to code. Build the tool you wish existed. The world has enough generic chatbot wrappers.</p><p><strong>Code</strong>: <a href="https://github.com/jxbaoxiaodong/chemspectra-agent">github.com/jxbaoxiaodong/chemspectra-agent</a> | <strong>Platform</strong>: <a href="https://ftir.fun/">ftir.fun</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aea35d853dd8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Lab Bench to SaaS: Building an AI Copilot for Materials QC]]></title>
            <link>https://medium.com/@hlin2097/from-lab-bench-to-saas-building-an-ai-copilot-for-materials-qc-361cd8cd9d74?source=rss-c520dc677dc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/361cd8cd9d74</guid>
            <category><![CDATA[h0hackathon]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ft-ir]]></category>
            <category><![CDATA[vercel]]></category>
            <dc:creator><![CDATA[Hlin]]></dc:creator>
            <pubDate>Fri, 26 Jun 2026 06:21:05 GMT</pubDate>
            <atom:updated>2026-06-26T06:21:05.426Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bmWRVq_zYRvBYmwnZQkA3w.png" /></figure><p>A #H0Hackathon project — Track 2: Monetizable B2B App*</p><p>In a polymer QC lab, an FTIR scan takes 30 seconds. The analysis that follows — comparing peaks against references, consulting handbooks, writing the report — takes 30 to 60 minutes. Multiply by dozens of samples daily. That bottleneck is why I built <strong>ChemSpectra Agent</strong> for the H0 hackathon.</p><h3>The Problem</h3><p>FTIR spectroscopy identifies materials by their infrared absorption patterns — C=O near 1730 cm-1, O-H around 3300 cm-1. But interpreting those patterns requires trained spectroscopists, and not every lab has one. Even experts need time to cross-reference peaks against libraries.</p><p>ChemSpectra Agent compresses that workflow to under 2 minutes. The AI agent autonomously selects analysis tools, matches against 130,000+ reference spectra, cross-validates evidence, and presents results with confidence scores.</p><h3>Why Human-in-the-Loop Is Non-Negotiable</h3><p>This is not a black box. After multi-tool analysis, results hit a confirmation checkpoint where the analyst reviews the identification, confidence score, and chemical reasoning before accepting.</p><p>In regulated industries, this is compliance, not convenience. Pharma companies under FDA 21 CFR Part 11 need documented human review. Forensic labs need expert sign-off. Environmental facilities need verifiable audit trails. The human-in-the-loop checkpoint fits existing compliance frameworks rather than fighting them.</p><h3>Real Users, Not Demo Data</h3><p>ChemSpectra Agent runs on FTIR.fun — a production platform with users in 52 countries, 130,000+ spectra, and 20+ file formats. The hackathon added three things the platform needed: an autonomous AI agent (ReAct reasoning with Qwen-3.7-Max), persistent storage (AWS DynamoDB), and a modern frontend (Vercel v0 / Next.js).</p><h3>The B2B Opportunity</h3><p>The FTIR spectroscopy market exceeds $1.5 billion. Most labs still use 1990s vendor software or manual lookups. ChemSpectra Agent offers pay-as-you-go and subscription pricing. Save 30 minutes per sample across 200 monthly samples = 100 hours recovered.</p><p>Target segments: polymer manufacturers (incoming QC), pharmaceutical companies (identity testing), forensic labs (substance ID), and environmental testing (contaminant detection).</p><p>Building for a hackathon forces you to ship. Building for B2B forces you to think about who pays. That intersection produced something worth continuing.</p><p><strong>Live demo</strong>: <a href="https://chemspectra-agent-h0.vercel.app/">chemspectra-agent-h0.vercel.app</a> | <strong>Code</strong>: <a href="https://github.com/jxbaoxiaodong/chemspectra-agent-h0">github.com/jxbaoxiaodong/chemspectra-agent-h0</a></p><p><em>This article was written as part of my participation in the H0 AWS+Vercel Hackathon.</em></p><ul><li>Tags: #H0Hackathon #AWS #B2BSaaS #AI #MaterialsScience #FTIR #QualityControl #Vercel</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=361cd8cd9d74" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>