Inspiration
I kept seeing the same problem in my English and German classrooms: a student struggles with fractions on Monday, gets help, then comes back Wednesday and the “tutor” starts from zero — as if nothing happened. Chatbots feel smart for one session and forgetful the next.
I built Duselang because I wanted an education system that remembers — not as a gimmick, but as infrastructure. Schools already juggle practice apps, quizzes, and LMS tools; teachers don’t need another black box that guesses grades or sends emails on autopilot. They need something that accumulates real signals (quizzes, practice, Comprehension gaps) and helps students and teachers pick up exactly where they left off.
The Qwen Cloud hackathon pushed me to ship this properly: a MemoryAgent that stores what matters, forgets what doesn’t, and uses Qwen only to speak — while Elixir and Rust do the thinking.
What it does
Duselang is a production-style education backend for K–12 language arts (built around German, with an IXL-like adaptive engine).
For students: adaptive practice with a 0–100 SmartScore, diagnostics on an A–M grade scale, and a tutor that recalls prior struggles (e.g. fractions, weak Comprehension) across sessions — not just the current chat.
For teachers: class analytics, trouble spots by strand, grading suggestions they must approve before anything hits the gradebook, and live quiz hosting.
Under the hood: one Phoenix API gateway powers practice (IXL-style), live games (Kahoot-style), an LMS layer (Canvas-style), billing, and an AI layer with working, episodic, and semantic memory. Simple questions are handled without calling an LLM; open-ended ones go to Qwen Cloud on DashScope after memory and context are assembled.
Only the backend runs on Alibaba Cloud and talks to Qwen. Frontends are separate apps that call the same API.
How we built it
I used an Elixir/Phoenix umbrella so each product (practice, quizzes, canvas, payments, AI) has its own database and supervisor — a Kahoot crash doesn’t take down practice sessions.
The AI layer follows one rule: Duselang decides; the model phrases. Grades, risk scores, and policy outcomes come from deterministic Elixir/Rust (including Rust NIFs for rules and policy). Qwen enters through a tagged Python bridge (:interpret / :phrase) on an OpenAI-compatible DashScope endpoint — so the NL provider is swappable, but production is Qwen Cloud.
Memory is layered on Postgres: conversation turns, episodic “struggle/achievement” moments distilled from events, and semantic facts like struggles_with:fractions that strengthen over time. Before every tier-3 reply, ContextAssembler pulls memory, cognitive state, and search snippets into a bounded context window.
For deployment I added a Docker release, RDS init scripts, and health checks including GET /health/qwen to prove live DashScope connectivity on Alibaba ECS — which the hackathon requires.
Challenges we ran into
Keeping the LLM out of decisions. It’s tempting to let the model grade, flag at-risk students, or write to the LMS. I enforced human-in-the-loop actions and a compile-time @duselang_reasoning contract so core conclusions never come from Qwen.
Cost and latency at scale. Calling Qwen on every “What’s my grade?” would be wasteful. The three-tier NLU (Rust rules → pgvector semantic match → Qwen) took real design work and telemetry to validate.
Memory without noise. Not every wrong answer deserves long-term storage. Episodic distillation uses explicit thresholds; semantic facts need repetition before they stick — otherwise the agent “remembers” trivia.
Production on Alibaba. Wiring five Postgres databases, pgvector for AI search, Redis for Kahoot in prod, and DashScope across regions (intl vs China endpoints) meant env discipline and a proper release path, not just mix phx.server on a laptop.
Frontend ↔ backend alignment. A large API surface across four frontends created integration gaps; getting Comprehension labeled correctly and routes fully wired was its own sprint.
Accomplishments that we're proud of
- A real MemoryAgent, not a demo chatbot: cross-session recall with episodic + semantic memory and context-budget assembly before Qwen speaks.
- Architectural honesty: reasoning in Elixir/Rust, natural language on Qwen Cloud, documented and health-checked (
/health/qwen). - A multi-product backend (practice, quizzes, LMS, AI) with fault isolation — closer to how schools actually operate than a single-purpose hackathon toy.
- Production posture: MIT-licensed repo, architecture docs, Docker deploy to Alibaba ECS, and Alibaba API proof in code (
alibaba_cloud.ex+ OSS-compatible storage). - Teacher trust by design: grading and LMS side effects require explicit approval — autonomy where it’s safe, humans where it matters.
What we learned
Building with Qwen Cloud taught me that compatibility isn’t enough — you still need a strict boundary for what the model is allowed to do. OpenAI-compatible APIs make integration fast; discipline makes it production-worthy.
Memory agents aren’t “store the whole chat.” They’re curate, retrieve, and forget — and the engineering is in the distillation rules and retrieval order, not the prompt.
For edtech, strand-level truth matters: a student can be strong in Vocabulary and weak in Comprehension; a single overall score hides that. Parallel diagnostic strands and honest labeling changed how I think about recommendations.
Deploying on Alibaba reinforced that hackathon submissions should be verifiable: live /health, live /health/qwen, and code that calls DashScope — not slides alone.
What's next for Duselang
Near term: finish Alibaba deploy (SLB + HTTPS), record the submission video on the live ECS URL, and open the public GitHub repo for judges.
Product: deepen Comprehension-specific memory (passage-level gaps → targeted practice plans), expand the isomorphic question generator with Qwen-assisted blueprints + lexicon validation, and wire teacher dashboards to memory insights (“3 students share this misconception”).
Platform: mix release hardening, OSS for uploads in prod, and optional MCP/skills on Qwen for document ingestion — still behind the same “Duselang decides, Qwen phrases” wall.
Community: keep it open source under MIT so schools and builders can run their own stack on Alibaba + Qwen without vendor lock-in.
Built With
- alibabacloud
- billing
- cloudflare
- cowboy
- dtrace
- elixir
- lms
- oban
- phoenix
- postgresql
- python
- qwenai
- react
- redis
- rust
- shell
- typescript
- vite
Log in or sign up for Devpost to join the conversation.