跪拜 Guibai
← All articles
Artificial Intelligence

A Weekend Build on EdgeOne Makers: An AI Health Coach That Remembers You Across Chats

By 一只牛博 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

The build demonstrates a practical pattern for AI agents that need long-term user memory: using a platform's conversation store as a single, persistent journal rather than relying on per-session context. The division of labor—LLMs for fuzzy estimation, deterministic code for calculation—is a replicable architecture for any app where accuracy matters alongside natural-language input.

Summary

A personal health-coach Agent, "Slim & Beautiful AI," was built and deployed on EdgeOne Makers over a single weekend. The system lets users log weight, meals, and exercise in plain language; a large language model estimates calories and macros, while deterministic code tools handle precise record-keeping and aggregation. A persistent, user-scoped journal stored in the platform's conversation memory ensures data survives across new chat sessions, so a user can ask "How much have I lost this week?" in a fresh window and get an accurate answer. The frontend renders structured data as visual cards—daily reports, trend charts, and weekly meal plans—delivered through a custom SSE event stream.

The project evolved from a template's three-column demo layout into a polished product by removing a code-display panel, adopting a warm-white and mint-green health-oriented theme, and adding mobile responsiveness. EdgeOne Makers handled runtime, memory, model access, observability, and deployment, letting the builder focus on product design and safety guardrails, such as the agent gently pushing back against extreme dieting requests.

Takeaways
EdgeOne Makers provides a full-stack Agent hosting platform with built-in runtime, conversation memory, free starter models, and one-command deployment from CLI.
Cross-session memory is achieved by giving each user a single, fixed-ID "journal" conversation in the platform's store, which all chat sessions read from and write to.
The architecture separates responsibilities: the LLM estimates food portions, calories, and macros from natural language, while code tools handle precise storage, aggregation, and trend calculation.
Structured card data is pushed to the frontend via a custom SSE `card` event, keeping the LLM's text responses brief and preventing data duplication.
Production storage on the platform is eventually consistent; a pending-writes list within a single request's toolset ensures a write followed by an immediate read returns the new data.
Frontend cards delivered over SSE disappear on page refresh; the fix is to snapshot card-bearing messages into IndexedDB and reattach them when restoring history from the server.
CDN edge-node HTML caching can cause a successful deployment to serve old pages until the cache expires or is manually cleared.
The agent's persona prompt includes explicit safety boundaries that successfully deflect unhealthy user requests, such as extreme calorie restriction or rapid weight loss.
Conclusions

A platform that absorbs runtime, memory, model routing, and deployment shifts the developer's focus from infrastructure assembly to product design—the agent's persona, safety guardrails, and user experience become the real work.

The 'LLM estimates, code records' pattern is a pragmatic middle ground between fully deterministic tracking apps and purely conversational agents, giving users natural input without sacrificing numerical accuracy.

Using the platform's own conversation store as a user-scoped journal is a clever workaround for the stateless nature of LLM APIs, avoiding the need for an external database while still achieving cross-session persistence.

The UI evolution from a three-column demo to a two-column product with a hidden debug panel reflects a broader truth: developer tools and end-user products have conflicting interface needs, and satisfying both requires deliberate design choices rather than default templates.

Concepts & terms
SSE (Server-Sent Events)
A standard allowing a server to push real-time updates to a client over a single HTTP connection. In this project, the Agent streams both text responses and structured card data to the frontend as distinct SSE events.
Isomorphic Deployment
Deploying frontend and backend code together as a single project under one domain, eliminating the need for separate deployments and CORS configuration. EdgeOne Makers supports this by hosting both the React UI and the Agent runtime from one repository.
Eventually Consistent Storage
A distributed storage model where a write operation may not be immediately visible to all subsequent read operations. This caused a bug where a just-logged meal didn't appear in an immediate daily report query, requiring a pending-writes list to bridge the gap within a single request.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗