{"slug": "storyai-on-demand-multilingual-kids-tales-for-refugee-camps", "title": "StoryAI: On‑Demand Multilingual Kids' Tales for Refugee Camps", "summary": "A developer built StoryAI, an open-source pipeline that generates age-appropriate, culturally tailored children's stories for displaced kids and delivers them over low-bandwidth channels like SMS, WhatsApp, and offline Raspberry Pi edge nodes. The system chains a prompt builder, LLM backends (GPT-4, Claude, LLaMA), a child-safety content filter with an optional human review queue, and a delivery engine, with tokenized analytics that avoid storing raw phone numbers.", "body_md": "Millions of displaced children grow up without a single storybook. **StoryAI** changes that by generating age‑appropriate, culturally‑sensitive tales on‑demand and delivering them over the low‑bandwidth channels that dominate refugee camps—WhatsApp, SMS, or even offline‑first devices.  \n\nSince the product’s debut on Product Hunt and the sharp rise in Google Trends for “children’s stories + refugees,” NGOs are asking: *How do we turn a prototype into a privacy‑first, sustainable service?* This guide gives you the practical steps, code snippets, and deployment tips you need to start today.\n\n| Component | What It Does | Quick‑Start Command | \n|---|---|---|\n| **Prompt Builder** | Adds age, language, and cultural tags to steer the LLM. | `python build_prompt.py --age 5-7 --culture Ukrainian --lang es` | \n| **LLM Backend** | Calls GPT‑4, Claude, or LLaMA via OpenAI/Anthropic/Meta APIs. | `curl -X POST https://api.openai.com/v1/chat/completions \\ <br> -H \"Authorization: Bearer $OPENAI_KEY\" \\ <br> -H \"Content-Type: application/json\" \\ <br> -d '{\"model\":\"gpt-4\",\"messages\":[{\"role\":\"system\",\"content\":\"You are a children’s author...\"}]}'` | \n| **Safety Filter** | Rejects any output containing violence, hate, or adult content. | `python filter.py --input story.txt --policy ./policies/child_safe.yaml` | \n| **Human Review Queue** (optional) | Sends flagged stories to a reviewer Slack channel. | `slack webhook https://hooks.slack.com/services/... --payload @story.txt` | \n| **Delivery Engine** | Sends text via Twilio SMS, WhatsApp Business API, or serves locally from an edge node. | `twilio sms:create --to +1234567890 --from +1987654321 --body \"$(cat story.txt)\"` | \n| **Edge Cache** | Raspberry Pi Docker container that pre‑downloads a daily batch for offline use. | `docker run -d --restart unless‑stopped \\ <br> -v $(pwd)/cache:/app/cache \\ <br> storyai/edge:latest sync` | \n\n```\n# Clone the repo and install deps\ngit clone https://github.com/storyai/core.git\ncd storyai\npip install -r requirements.txt\n\n# Generate a prompt for a 6‑year‑old Ukrainian child in Spanish\npython build_prompt.py --age 5-7 --culture Ukrainian --lang es > prompt.txt\n```\n\nThe resulting `prompt.txt` looks like:\n\n```\nYou are a children’s author. Write a short story for a 6‑year‑old (age:5-7) in Spanish. The story must reflect Ukrainian cultural elements (e.g., sunflower fields, traditional lullabies) and contain no violence or adult themes.\ncurl -s -X POST https://api.anthropic.com/v1/complete \\\n  -H \"x-api-key: $ANTHROPIC_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d @- <<EOF\n{\n  \"model\": \"claude-2.1\",\n  \"prompt\": \"$(cat prompt.txt)\",\n  \"max_tokens_to_sample\": 500,\n  \"temperature\": 0.7\n}\nEOF > story_raw.txt\npython filter.py --input story_raw.txt --policy policies/child_safe.yaml --output story.txt\nif [ $? -ne 0 ]; then\n  echo \"Content rejected – send to human reviewer\"\n  slack webhook https://hooks.slack.com/services/... --payload @story_raw.txt\n  exit 1\nfi\n```\n\n**SMS (Twilio)**\n\n```\ntwilio sms:create \\\n  --to +1234567890 \\\n  --from +1987654321 \\\n  --body \"$(cat story.txt)\"\n```\n\n**WhatsApp (Business API)**\n\n```\ncurl -X POST https://graph.facebook.com/v17.0/<PHONE_NUMBER_ID>/messages \\\n  -H \"Authorization: Bearer $WHATSAPP_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n        \"messaging_product\":\"whatsapp\",\n        \"to\":\"1234567890\",\n        \"type\":\"text\",\n        \"text\":{\"body\":\"'\"$(cat story.txt)\"'\"}\n      }'\n```\n\n**Offline Edge Node**\n\n```\n# On the Raspberry Pi in the camp\ndocker exec -it storyai_edge sync   # pulls the daily batch\ndocker exec -it storyai_edge serve  # opens a local Wi‑Fi hotspot at http://10.0.0.1\n```\n\nCamp volunteers can now hand out a simple QR code that points to the hotspot; families download stories directly to a cheap Android tablet.\n\n``` python\n# tokenized analytics – no raw phone numbers stored\nfrom uuid import uuid5, NAMESPACE_DNS\ndef tokenise(phone):\n    return uuid5(NAMESPACE_DNS, phone)\n\n# Example logging\nlog = {\n    \"user_id\": tokenise(\"+1234567890\"),\n    \"story_id\": \"ukr_es_2024_04_12\",\n    \"timestamp\": datetime.utcnow().isoformat()\n}\n# Send to encrypted analytics endpoint\nrequests.post(\"https://analytics.storyai.org/collect\", json=log, verify=True)\n```\n\nAll data is encrypted at rest (AES‑256) and complies with GDPR and the UN Convention on the Rights of the Child.\n\n| Question | Practical Answer | \n|---|---|\n| **How do I guarantee age‑appropriate content across cultures?** | Use the prompt tags ( `age` ,`culture` ,`language` )*and* the built‑in safety filter. Fine‑tune the model on a curated UNESCO‑approved corpus; the filter will automatically reject any story that contains disallowed tokens. | \n| **What are the privacy requirements for phone numbers?** | Store only a deterministic hash (as shown above) for analytics. Keep raw numbers in a separate, encrypted table that is never queried for reporting. Record consent with a timestamped “YES” SMS reply; this single line satisfies GDPR’s consent‑record requirement. | \n| **Can the system run without internet?** | Yes. Deploy the Dockerized edge container on a Raspberry Pi or similar SBC. It syncs once per day when a mobile hotspot is available, then serves stories locally via Wi‑Fi or Bluetooth. | \n| **Which LLM should I start with?** | GPT‑4 offers the most robust safety controls out of the box, but Claude‑2.1 and LLaMA‑2‑13B are cheaper for high‑volume deployments. Test all three on a small batch and compare cost per 1 000 characters. | \n| **How do I handle audio versions for low‑literacy users?** | After the text is approved, pipe it through a TTS engine (e.g., Google Cloud Text‑to‑Speech) and store the MP3 alongside the text. The edge node can serve both files; the client app plays the audio automatically when the story is opened. | \n\n`0 2 * * * docker exec storyai_edge sync`).\nWith these concrete steps, you can move from a proof‑of‑concept to a reliable, privacy‑first storytelling service that reaches the children who need it most—today.\n\n*Herramienta mencionada: [Groq Cloud](https://groq.com)*", "url": "https://wpnews.pro/news/storyai-on-demand-multilingual-kids-tales-for-refugee-camps", "canonical_source": "https://dev.to/leojulieta/storyai-on-demand-multilingual-kids-tales-for-refugee-camps-3gmh", "published_at": "2026-11-21 01:05:51+00:00", "updated_at": "2026-11-21 01:12:12.847574+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "generative-ai", "ai-tools", "ai-agents"], "entities": ["StoryAI", "OpenAI", "Anthropic", "Meta", "Twilio", "WhatsApp Business API", "Raspberry Pi", "Product Hunt"], "also_reported_by": [], "takeaway": "Chaining a culturally-tagged prompt builder, an LLM call, and a policy-based safety filter that routes rejected outputs to human review lets you ship child-safe generated content over SMS, WhatsApp, or an offline edge node.", "recommendation": {"advice": "Run every generated story through a child-safety policy filter and route failures to a human review queue before delivery; tokenize phone numbers with UUIDs so analytics never store raw identifiers.", "playbook": "output-verification", "playbook_url": "https://wpnews.pro/playbooks/output-verification"}, "alternates": {"html": "https://wpnews.pro/news/storyai-on-demand-multilingual-kids-tales-for-refugee-camps", "markdown": "https://wpnews.pro/news/storyai-on-demand-multilingual-kids-tales-for-refugee-camps.md", "text": "https://wpnews.pro/news/storyai-on-demand-multilingual-kids-tales-for-refugee-camps.txt", "jsonld": "https://wpnews.pro/news/storyai-on-demand-multilingual-kids-tales-for-refugee-camps.jsonld"}}