{"slug": "building-a-diversifi-memory-agent-on-qwen-cloud", "title": "Building a Diversifi Memory Agent on Qwen Cloud", "summary": "A solo developer built DiversiFi, a treasury management agent with persistent memory, for the Qwen Cloud Global AI Hackathon. The project uses Alibaba Cloud's DashScope for LLM consolidation, Tablestore's Agent Memory Store for long-term memory, and Function Compute for periodic profile updates. However, the developer hit a three-hour roadblock when Tablestore's Memory Storage API returned 'The user is disabled' errors, ultimately discovering the service is in invitation-only beta and requires manual account allowlisting.", "body_md": "I'm a solo builder. That means when something breaks at 2am, there's no teammate to Slack — just me, a terminal, and a growing suspicion that I've misconfigured something obvious. This is the story of building DiversiFi, my submission for Track 1 of the Qwen Cloud Global AI Hackathon (MemoryAgent), and the three-hour detour into Alibaba Cloud's beta-access purgatory that taught me more than the parts that actually worked.\n\nThe idea\n\nDiversiFi is a treasury management agent — but the part I actually wanted to build wasn't the treasury logic. It was the memory.\n\nMost \"agent memory\" is just chat history with a fancier name. I wanted something different: an agent that distills your actual profile out of the noise. Your risk tolerance. Your financial philosophy — maybe it's Africapitalism, maybe Islamic finance principles, maybe Buen Vivir. Your recurring anxiety about currency depreciation. Your swap patterns over time. Not \"here's everything you've ever said to me,\" but \"here's who you are, as best I can tell.\"\n\nThat means two things have to happen continuously: raw interactions need to get consolidated into durable statements, and old, irrelevant signal needs to get forgotten. That's the whole game for Track 1, and it's a genuinely hard problem dressed up as a simple one.\n\nWiring three services together\n\nI ended up leaning on three Alibaba Cloud pieces:\n\nDashScope (Model Studio / Bailian) is the brain. I used the OpenAI-compatible endpoint, which meant I could point my existing OpenAI-client-shaped provider at Qwen by changing exactly one base URL. Zero rewrites. The consolidation pipeline feeds up to 40 raw memories into Qwen and asks it to boil them down into 3-7 durable profile statements — qwen-plus by default, qwen-long when I need the 1M-token context for bigger memory pools, qwen-max when quality matters more than speed. I even stood up a dedicated MaaS workspace endpoint in Singapore, and I have a live curl against it returning real completions. That part felt great.\n\nTablestore's Agent Memory Store was supposed to be the long-term memory layer underneath all of it — the official SDK gives you createMemoryStore, addMemories, searchMemories, the works, plus something I didn't expect to love as much as I do: it runs its own background extraction pass on raw messages, so you get a second, independent take on what matters, layered on top of my own Qwen-based consolidation. The four-level scope — appId / tenantId / agentId / runId — is exactly the multi-user isolation model a treasury agent needs, and I didn't have to invent it myself.\n\nFunction Compute is the glue. A small Node.js 18 handler in cn-beijing that pulls raw memories out of storage, sends them to Qwen for consolidation, writes the distilled profile back as a high-priority memory, and evicts what it just absorbed. A cron job on my Hetzner box hits this every six hours per active user, quietly keeping every profile fresh.\n\nOn paper, that's the whole architecture. In practice, one of the three legs never got to stand.\n\n\"The user is disabled\"\n\nHere's where it stopped being a hackathon and started being a mystery.\n\nI created the Tablestore instance, set up a RAM user with full OTS and FC access, double-checked the AccessKey was active. Every single call to the Memory Storage API came back with the same error:\n\nOTSAuthFailed: The user is disabled.\n\nThat phrase is doing a lot of misdirection. My first instinct, and probably yours, is \"okay, something's wrong with my IAM policy.\" So I re-read the docs. Rebuilt the RAM user. Tried the root account's own key, just to rule out permissions entirely. Same error, every time.\n\nTurns out the Tablestore Memory Storage sub-service — the actual API surface behind createMemoryStore and friends — is in 邀测, invitation-only beta. It's restricted to cn-beijing, and access is gated at the account level by a manual allowlist, not by any policy I could write myself. \"The user is disabled\" isn't a permissions message. It's the beta gate itself, phrased in a way that sends you chasing IAM ghosts for hours. The official guide, once I found it, points you to a DingTalk group to request access. The billing docs even quietly confirm the service isn't GA yet — pricing doesn't kick in until the end of July.\n\nI want to be honest about how much time that cost me. If you're building on an Alibaba Cloud beta service for a hackathon with a deadline, request access before you write a line of code. I didn't, and I paid for it in hours I didn't have.\n\nWhat a solo builder does when a dependency won't cooperate\n\nNot stop, obviously. But also — not fake it.\n\nThe Tablestore adapter is done. Fully written, fully tested, using the SDK exactly as documented. It just can't run yet, because the account isn't allowlisted. So instead of blocking the whole submission on someone else's approval queue, I wired a local fallback — Cognee — that implements the identical remember/recall/sweep interface. The consolidation service tries Tablestore first if the endpoint is configured, and falls back seamlessly if it isn't. From the user's side, nothing changes. From my side, the app is fully functional today, and the moment that DingTalk request gets approved, Tablestore comes online with zero code changes — the environment variable is already sitting there waiting.\n\nThat fallback pattern ended up being the thing I'm proudest of in this whole build, more than any single integration. Every Alibaba Cloud service in this app sits behind an environment variable, and none of them are load-bearing for the app to function:\n\nNo ALIBABA_CLOUD_FC_ENDPOINT? The Guardian cron just consolidates locally.\n\nNo TABLESTORE_ENDPOINT? Memory falls back to Cognee.\n\nNo DASHSCOPE_API_KEY? The LLM chain falls through to Gemini, then Venice, then down the list.\n\nAlibaba Cloud makes this thing better. It was never allowed to be a single point of failure — and that turned out to matter a lot more than I expected when one of its own services locked me out.\n\nForgetting, on purpose\n\nThe other requirement — timely forgetting — actually got easier to think about once I stopped treating memory as something that only grows. There are two layers to it. A soft decay function quietly penalizes the recall score of anything older than 30 days, hitting zero at twice that age, so stale memories fade from relevance before they're deleted. A harder sweep then actually evicts anything below that threshold, and consolidation itself evicts the raw memories it just absorbed into a distilled statement — otherwise you're just accumulating noise forever and calling it \"memory.\"\n\nThe third requirement — recalling critical memories inside a limited context window — turned out to have a slightly counterintuitive answer. Qwen's qwen-long genuinely does give you a million tokens of context. But the real win wasn't using all of it. It was consolidating 40 raw memories down into 3-7 durable statements and prioritizing those in recall, so the advisor's context stays full of signal — your philosophy, your risk profile — instead of scrollback.\n\nWhere it stands\n\nDashScope: live, verified, answering real requests today. Function Compute: fully configured, one s deploy away from running. The Tablestore instance itself exists, has internet access enabled, has the right policies attached — it's just waiting on a beta gate that isn't mine to open. And Cognee is quietly doing the job in the meantime, with 880 tests green behind it.\n\nIf there's a lesson in here for another solo builder eyeing a cloud hackathon: build for the failure of the shiny new thing before you've even confirmed it works. Not out of pessimism — out of respect for the fact that beta services, by definition, might not let you in on the first try. The interesting engineering, it turns out, wasn't the Qwen integration. It was making sure the whole thing didn't depend on it.\n\nCode: github.com/thisyearnofear/diversify FC handler (all three services in one place): alibaba-cloud/fc-memory-consolidation/index.js Tablestore adapter: packages/shared/src/services/tablestore-memory-service.ts DashScope provider: packages/shared/src/services/ai/providers/dashscope-provider.ts Deployment docs: docs/alibaba-cloud-deployment.md\n\nBuilt for the Qwen Cloud Global AI Hackathon, Track 1: MemoryAgent.", "url": "https://wpnews.pro/news/building-a-diversifi-memory-agent-on-qwen-cloud", "canonical_source": "https://dev.to/papajams/building-a-diversifi-memory-agent-on-qwen-cloud-5gek", "published_at": "2026-07-20 18:03:03+00:00", "updated_at": "2026-07-20 18:21:16.639421+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-agents", "ai-tools", "developer-tools"], "entities": ["DiversiFi", "Qwen Cloud", "Alibaba Cloud", "DashScope", "Tablestore", "Function Compute", "Hetzner"], "alternates": {"html": "https://wpnews.pro/news/building-a-diversifi-memory-agent-on-qwen-cloud", "markdown": "https://wpnews.pro/news/building-a-diversifi-memory-agent-on-qwen-cloud.md", "text": "https://wpnews.pro/news/building-a-diversifi-memory-agent-on-qwen-cloud.txt", "jsonld": "https://wpnews.pro/news/building-a-diversifi-memory-agent-on-qwen-cloud.jsonld"}}