<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 伟 王</title>
    <description>The latest articles on DEV Community by 伟 王 (@w18829896005).</description>
    <link>https://dev.to/w18829896005</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F99mvlsfu5tfj9m7ku25d.png</url>
      <title>DEV Community: 伟 王</title>
      <link>https://dev.to/w18829896005</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/w18829896005"/>
    <language>en</language>
    <item>
      <title>Member Assistant: An Open-Source AI Helper for Mall Mini-Programs</title>
      <dc:creator>伟 王</dc:creator>
      <pubDate>Mon, 19 Oct 2026 01:55:10 +0000</pubDate>
      <link>https://dev.to/w18829896005/member-assistant-an-open-source-ai-helper-for-mall-mini-programs-2eeo</link>
      <guid>https://dev.to/w18829896005/member-assistant-an-open-source-ai-helper-for-mall-mini-programs-2eeo</guid>
      <description>&lt;p&gt;This is a submission for the &lt;a href="https://dev.to/devteam/join-the-hacktoberfest-open-source-ai-challenge-side-hustle-2550-in-prizes-across-18-winners-55ba"&gt;Hacktoberfest x Open Source AI Challenge&lt;/a&gt; — Side Hustle.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Member Assistant&lt;/strong&gt; is a production-grade AI assistant for shopping-mall mini-programs. Members ask questions in natural language — "How many points do I have?", "How does parking work?" — and get instant, cited answers over an SSE stream.&lt;/p&gt;

&lt;p&gt;Under the hood:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Real vector RAG&lt;/strong&gt; — multilingual sentence-transformers embeddings + FAISS index over the mall's knowledge base (parking rules, points rules, coupons, floor guide)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read-only member tools&lt;/strong&gt; — points / coupons / orders, served from SQLite opened in read-only mode; the assistant can only call a closed registry of preset tools, never raw SQL&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hard safety constraints in code&lt;/strong&gt; — identity comes only from the auth header (never the request body), low-confidence answers fall back to a human agent&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FastAPI + Docker&lt;/strong&gt; — &lt;code&gt;/healthz&lt;/code&gt;, JSON structured logging, env-based config, one-command deploy&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Live demo: &lt;a href="https://8001-agqutsuuudc2eonxfv2xrllzpq.instabox.tech" rel="noopener noreferrer"&gt;https://8001-agqutsuuudc2eonxfv2xrllzpq.instabox.tech&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Try it (replace with any header value; &lt;code&gt;M10001&lt;/code&gt; has sample data):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-N&lt;/span&gt; &lt;span class="nt"&gt;-X&lt;/span&gt; POST https://8001-agqutsuuudc2eonxfv2xrllzpq.instabox.tech/chat &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-Member-Id: M10001"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"question": "我的积分有多少？"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/497900963/member-assistant" rel="noopener noreferrer"&gt;https://github.com/497900963/member-assistant&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;The whole stack is open source — no closed model APIs anywhere in the loop:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Knowledge base&lt;/strong&gt; → chunked Markdown docs → &lt;code&gt;paraphrase-multilingual-MiniLM-L12-v2&lt;/code&gt; embeddings → FAISS cosine index (&lt;code&gt;scripts/build_index.py&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Request flow&lt;/strong&gt; → &lt;code&gt;X-Member-Id&lt;/code&gt; header auth → RAG top-k retrieval → optional preset tool call (member_id injected server-side) → streamed answer with citations&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Safety by construction&lt;/strong&gt; — SQLite opened with &lt;code&gt;mode=ro&lt;/code&gt;, so even a bug can't write; tool registry is a closed dict, unknown tools are rejected&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tested&lt;/strong&gt; — 16 pytest cases covering retrieval relevance, read-only enforcement, 401/422 paths, and identity-spoofing attempts&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The companion piece in the same project, &lt;strong&gt;Ops Assistant&lt;/strong&gt; (&lt;code&gt;ops-assistant/&lt;/code&gt;), is a CLI for on-call engineers: &lt;code&gt;ask "why did coupon redemptions fail yesterday?"&lt;/code&gt; produces a structured incident report (symptoms / root cause / stop-the-bleed + permanent fix / risk / verification), and &lt;code&gt;monitor&lt;/code&gt; does P0/P1 health checks with WeCom alerts. It follows the same read-only philosophy: a command filter rejects anything resembling a write, and analysis is pure Python — no shell to escape from.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter
&lt;/h2&gt;

&lt;p&gt;A mall's member data is sensitive — points balances, coupons, order history. With a closed API:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy&lt;/strong&gt;: every member question (and its personal data) leaves the building&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost&lt;/strong&gt;: per-token billing on thousands of daily member queries adds up fast&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lock-in&lt;/strong&gt;: the day the vendor changes pricing or terms, your assistant stops working&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With open models and open code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data stays on-prem&lt;/strong&gt; — the embedding model and vector index run on the company's own machines; nothing about any member ever leaves the intranet&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero marginal cost&lt;/strong&gt; — a 120M-parameter embedding model on CPU answers retrieval in milliseconds, forever free&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auditable safety&lt;/strong&gt; — the "read-only" guarantee isn't a promise in a terms-of-service, it's &lt;code&gt;mode=ro&lt;/code&gt; in the source code anyone can read&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Open isn't just cheaper here. For member data, it's the only architecture I'd sign off on.&lt;/p&gt;

&lt;h2&gt;
  
  
  My First User
&lt;/h2&gt;

&lt;p&gt;Me. I'm a backend engineer at a shopping-mall company, and our mini-program's member support is currently humans answering the same five questions about points and parking, all day.&lt;/p&gt;

&lt;p&gt;I dogfooded this against our actual rule docs. The moment it answered "前2小时免费" with a citation to the parking rules doc — correctly, in Chinese — I knew the RAG pipeline was real. Next step: point the LLM client at our internally deployed model (it's already env-configurable) and wire the &lt;code&gt;X-Member-Id&lt;/code&gt; header to our existing &lt;code&gt;*-api&lt;/code&gt; auth gateway. The Java 8 system doesn't change at all; this service sits beside it.&lt;/p&gt;

&lt;p&gt;Would I pay for it? I'm already paying in the form of support hours it saves. If this saves our CS team even 30 minutes a day, it's paid for itself many times over.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Render&lt;/strong&gt; — the demo is containerized and deployable to Render as-is (&lt;code&gt;Dockerfile&lt;/code&gt; included)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Overall quality&lt;/strong&gt; — production structure, 27 passing tests across both assistants, and safety constraints enforced in code rather than documentation&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>hacktoberfest</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
