How Xiaohongshu Built an Enterprise AI Personal Assistant from Zero to Full‑Staff Coverage

Xiaohongshu’s AI team describes a month‑long, three‑person effort that leveraged an AI‑Native project model, isolated Kubernetes clusters, a custom sandbox (NEX), token‑saving Self‑GC, cost‑aware routing, and a three‑layer memory architecture to roll out a secure, low‑cost AI personal assistant used by every employee.

Xiaohongshu Tech REDtech
Xiaohongshu Tech REDtech
Xiaohongshu Tech REDtech
How Xiaohongshu Built an Enterprise AI Personal Assistant from Zero to Full‑Staff Coverage

Timeline and AI‑Native Approach

The team decided on February 11 to build an AI personal assistant. A three‑person group delivered an internal‑test version in three days. By March 9 the architecture was upgraded and 2,000 public‑test slots opened. By March 17, after two weeks of scaling, the assistant covered all employees – roughly one month from decision to full rollout.

AI‑Native Project Mechanism

The core was an "AI Native" workflow: define a new mode, ship an MVP quickly, validate with real users, then scale. Early user feedback drove rapid iteration, avoiding the traditional 90%‑ready evaluation that would make AI solutions obsolete before deployment.

Security Isolation – Seal AI Zone and NEX Sandbox

Security was addressed by creating a dedicated Kubernetes cluster called Seal AI Zone , physically isolated from production. Employees access it via a Seal client. Inside, a multi‑layer security stack includes:

MicroVM‑based sandbox ( NEX – Native Engine for Agent Sandbox) with six isolation layers (VM boundary, Seccomp whitelist, default‑deny network, read‑only filesystem, cgroup limits, full audit logs).

Cold‑start P50 <300 ms , hot‑start P99 <50 ms , hot‑pool hit rate >70%, creation throughput peak 500 ops/s.

Data Privacy

All user input passes a Security SDK that performs three scans (PII, secret keys, file content). If no sensitive data is found, the request goes to external LLM APIs; otherwise it is routed to a private, on‑premise model, ensuring that sensitive data never leaves the corporate network.

Cost Optimization

Cost was tackled on two orthogonal dimensions: token consumption and model price.

Self‑GC (Token‑Saving)

Inspired by JVM garbage collection, Self‑GC treats the long‑term dialogue history as a virtual heap. It assigns identities to text fragments, then asynchronously plans which parts to fold, mask, or prune. The three‑phase commit (Async Plan → Rehearsal → Delayed Commit) ensures no abrupt context loss.

In production, Self‑GC reduced average token usage by 10‑15% during the day and up to 20% at peak, yielding substantial cost savings at enterprise scale.

Auto Model Routing (SealRouter)

SealRouter decides whether a request needs a high‑end model or a cheaper one. It combines a classification model trained on live traffic with rule‑based overrides (e.g., many tools or long context trigger a higher‑tier model). Cache‑aware cost constraints avoid unnecessary model switches.

Routing results: ~75% of requests use cost‑effective models, 22% use a higher‑tier model, and only 3% invoke the top‑tier model, cutting overall model cost by 69% without sacrificing quality.

Three‑Layer Memory Architecture

To overcome limitations of the existing memory system, a new three‑layer design was introduced:

L0 Session – short‑term context, transient state, not persisted to long‑term memory.

L1 Work Log – fact buffer with evidence; flushes to dated markdown files, preserving raw source pointers.

L2 LLM Wiki – structured, compiled markdown wiki serving as long‑term knowledge. Unlike traditional RAG, facts are pre‑compiled and retrieved on demand via BM25 + vector search, enabling continuity, traceability, filtering, and maintainability.

Ecosystem – Skill Hub and Cowork Studio

Skills are abstracted as reusable agents on Skill Hub , supporting official, personal, and private‑domain contributions. Increased usage fuels more skill contributions, creating a positive feedback loop.

Cowork Studio provides a one‑click publishing platform for internal AI applications, lowering distribution friction.

Future Directions for Enterprise Agents

The team envisions the next generation of agents evolving along three axes:

Active perception – agents proactively gather external information and discover opportunities.

Goal‑driven behavior – agents understand high‑level objectives, decompose them into tasks, and execute plans autonomously.

Collaborative agents – agents act as independent members within an organization, coordinating with other agents and humans.

Overall, using an AI‑Native methodology, a three‑person team launched the assistant in three days and achieved full‑staff coverage in a month, solving security and cost challenges while building a scalable, extensible AI ecosystem.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Cost OptimizationAI AgentSandboxenterprise AIMemory ArchitectureSkill Hub
Xiaohongshu Tech REDtech
Written by

Xiaohongshu Tech REDtech

Official account of the Xiaohongshu tech team, sharing tech innovations and problem insights, advancing together.

0 followers
Reader feedback

How this landed with the community

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.