Artificial Intelligence 17 min read

AI-Powered Home Inventory Management Application: Design, Implementation, and Experience

This article describes the development of an AI-driven home inventory management tool that addresses storage waste, food expiration, item locating, and duplicate purchases by integrating barcode scanning, image recognition, intelligent classification, and multimodal models, while also comparing the performance of Cursor and Trae IDEs and Claude‑3.5‑sonnet versus deepseek‑r1 models.

ByteFE
ByteFE
ByteFE
AI-Powered Home Inventory Management Application: Design, Implementation, and Experience

Feature Demonstration

The author, Wang Lei from ByteDance, built a home inventory management app after noticing storage space waste, food expiration, difficulty locating items, and duplicate purchases during a recent move.

Storage space waste: Expired items occupy storage.

Food expiration waste: Lack of expiry tracking leads to discarded food.

Item locating difficulty: No proper labeling makes finding items hard.

Duplicate purchases: Unclear stock leads to unnecessary buying.

To solve these problems, the author used Cursor and Trae (Claude‑3.5‑Sonnet and deepseek‑r1) to develop a tool that digitizes household goods, records key attributes, and provides reminders.

Overall Architecture

The system architecture (illustrated by images in the original source) combines a front‑end interface, back‑end services, AI models for image and text recognition, and a vector database for similarity search.

Implementation Process

Barcode Recognition

Barcode lookup is performed via Alibaba Cloud's barcode query API; developers provide a simple curl example to Cursor, which generates the integration code.

Product Recognition

Image‑based product identification relies on prompt engineering to separate brand and category recognition, using the Doubao‑1.5‑vision‑pro‑32k model.

# 角色
你是一位专业的图像识别专家,具备深厚的图像识别知识与丰富经验,能够精准通过图片中的特征和文字信息,识别并详细描述商品。你将依据客户提供的图片需求,严格按照以下规则逐步执行任务。
# 任务描述与要求
1. 运用先进的图像识别技术,准确确定图片中物品的种类,给出一个精准描述物品的名词(如:番茄、遥控器、马桶、抽纸、可乐等),此名词记为A。
2. 仔细根据物品呈现的文字或特征,识别出物品的品牌(如:康师傅、维达、中华等),若图片中存在多个可能的品牌名称,仅保留确定无误的品牌名。
3. 若无法识别出物品的品牌,需敏锐识别物品的颜色(如:红色、黄色、黑色)。
4. 按照特定格式输出识别结果:若可以识别出品牌,输出格式为:**品牌名+名词A**(如:康师傅方便面,中华香烟);若无法识别出品牌,输出格式为:**颜色+名词A**(如:黑色遥控器,白色马桶)。
5. 对图片内容进行详细且全面的描述,涵盖识别到的文字、图案以及其他显著特征。若识别到图片内容为字符串,直接输出这些字符串。
6. 输出结果必须采用JSON格式,且内容要包含以下全部字段:
    - status:0代表识别成功,1代表识别失败。
    - productName:识别到的商品名,格式为品牌名+名词A 或 颜色+名词A。
    - msg:当`status`为1时,详细输出识别失败的原因。
    - desc:清晰描述所看到的图片,如果识别到图片的内容是一些字符串,请输出这些字符串。
    - category:准确描述所看到的物品的分类,如:鼠标、牙线、杯子。
    - color:如实描述所看到的物品的颜色,如:黑色、粉色。
    - brand:正确描述所看到的物品的品牌,如:三只松鼠、维达、罗技。

Intelligent Classification

To avoid custom taxonomy issues, the project adopts the globally standard GPC product classification, which has four levels and over 6,000 categories. A retrieval‑augmented generation (RAG) approach first uploads all GPC data, then uses a generation step to filter noisy terms before searching.

# 角色
你是一名专业的商品分类专家,具备丰富的商品知识和分类经验,能够精准地根据用户输入的商品名称,提供贴合实际且易懂的分类信息,并依据这些分类在知识库中检索匹配的GPC分类项,以标准JSON格式输出。
# 任务描述与要求
1. 仔细分析用户提供的商品名称,精准确定其主要分类。
2. 围绕主要分类,从不同角度思考,提供3 - 5个含义接近且简洁明了、常见易懂的词语,辅助用户理解商品分类。
3. 依据生成的商品分类词语,在知识库中全面、细致地进行检索。
4. 对检索出的若干个GPC分类项进行综合评估,挑选出最相关的一个。
5. 准确提取该GPC分类项的名称和代码,以JSON格式输出,确保JSON格式正确无误且易于解析。
6. 整个过程只针对商品分类展开,不涉及其他无关话题。
7. 严格仅在知识库内检索,不借助任何外部搜索工具。
8. 若知识库中无匹配分类项,给出恰当的错误信息或提示。

Shelf Life and Production Date Recognition

OCR models extract expiration and production dates, which are then normalized to days (e.g., 1 year = 365 days).

# 角色
你是一名专业的图像识别专家,擅长从图片中精准提取保质期信息,并将其转换为天数,以满足客户对于产品保质期快速、准确分析的需求,按照以下规则一步步执行任务。
# 任务描述与要求
1. 运用图像处理工具和技术,仔细识别用户提供图片中的文本内容,从中提取并解析保质期信息,务必保证准确无误。
2. 将识别出的保质期信息,按照一年 = 365天,9个月 = 270天等规则,精确计算并转换为对应的天数。
3. 以JSON格式输出识别和转换的结果,JSON应包含以下字段:
    - status:状态码,明确表示识别过程的状态。若识别成功,状态码为0;若获取到图片但未识别出保质期信息,状态码为1;若未获取到图片,状态码为2。
    - shelfLife:准确填写保质期的天数,比如30天就输出30。
    - message:当`status`不为0时,给出相应的补充说明。
# 角色
你是一位专业的图像识别专家,专注于从图片中提取特定信息,特别是生产日期。你需要根据用户提供的图片,识别其中的生产日期信息,并以JSON格式输出。
# 技能
- 任务:从用户提供的图片中识别生产日期。
  - 使用图像识别工具(如OCR)来识别图片中的文字。
  - 提取并解析生产日期信息,确保其符合YYYY-MM-DD格式。
  - 将识别结果以JSON格式输出,包含以下字段:
    - status:表示识别状态的整数。
      - 0:识别成功。
      - 1:获取到图片,但没有识别到生产日期信息。
      - 2:没有获取到图片。
    - productionDate:识别到的生产日期,格式为YYYY-MM-DD。
    - message:当`status`不为0时,需要补充的其他信息。

Image Search (以图搜物)

When a product lacks a barcode, its image is vectorized using Doubao‑embedding‑vision and stored; during checkout, a new image is vectorized and matched against stored vectors via Alibaba Cloud's DashVector service.

Experience Summary

Cursor vs Trae Comparison

The project (over 6,000 lines of AI‑generated code) shows that both tools produce similar code quality when using Claude‑3.5‑Sonnet, but Cursor’s Pro version offers faster generation and more stable performance, while Trae suffers from network‑related instability.

Claude‑3.5‑sonnet vs deepseek‑r1 Comparison

Both models generate comparable code, yet Claude is preferred because its “think” phase is shorter, leading to higher efficiency, and it handles API‑key management more professionally by using environment variables instead of hard‑coded constants.

Source Code

The complete source code is available at https://github.com/jsceoz/goo .

AIsoftware developmentmultimodalImage RecognitionBarcodeHome Inventory
ByteFE
Written by

ByteFE

Cutting‑edge tech, article sharing, and practical insights from the ByteDance frontend team.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.