[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81045":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":12,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":11,"stars30d":11,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":14,"rankGlobal":8,"rankLanguage":8,"license":15,"archived":16,"fork":16,"defaultBranch":17,"hasWiki":18,"hasPages":16,"topics":19,"createdAt":8,"pushedAt":8,"updatedAt":20,"readmeContent":21,"aiSummary":22,"trendingCount":13,"starSnapshotCount":13,"syncStatus":11,"lastSyncTime":23,"discoverSource":24},81045,"safeabroad-agent","liangchenwei666-ai\u002Fsafeabroad-agent","liangchenwei666-ai",null,"Python",30,2,1,0,39.63,"MIT License",false,"main",true,[],"2026-06-12 04:01:31","# SafeAbroad Agent\n\n![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.8%2B-blue)\n![FastAPI](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FFastAPI-App-009688)\n![Safety](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSafety-Trauma--Informed-green)\n![Privacy](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPrivacy-Local--First-purple)\n![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow)\n\nA trauma-informed, privacy-first emergency documentation agent for international students overseas.\n\nSafeAbroad Agent helps Chinese-speaking international students document assault, street violence, threats, injuries, property loss, and follow-up needs in a structured way. It turns Chinese recall into a careful bilingual case record, keeps uncertainty visible, and drafts neutral English materials that users can review before sharing with police, doctors, universities, insurers, victim support services, or consulates.\n\n## Why This Project Exists\n\nAfter an assault or frightening incident abroad, international students may face language barriers, unfamiliar legal systems, insurance confusion, and psychological shock. Many users need help organizing facts without being pressured, led, or encouraged to exaggerate.\n\nSafeAbroad Agent focuses on documentation, evidence preservation, and communication preparation. It is not a replacement for emergency services, lawyers, doctors, counsellors, or university support staff.\n\n## What It Can Do\n\n- Immediate safety triage in Chinese\n- Trauma-informed incident intake\n- Chronological timeline reconstruction\n- Follow-up questioning for missing details and logical conflicts\n- Editable timeline with uncertainty markers\n- Evidence and injury checklist with collection guidance\n- Chinese-to-English police-style statement generation\n- Medical, university, police follow-up, insurance, and victim-support drafts\n- Jurisdiction-aware support-resource suggestions\n- Local-first API-key settings for Qwen, OpenAI, Anthropic, or OpenAI-compatible providers\n\n## What It Does Not Do\n\n- It does not replace police, lawyers, doctors, counsellors, or emergency services.\n- It does not provide legal, medical, immigration, or psychological advice.\n- It does not tell users whether a suspect is guilty.\n- It does not predict exact criminal sentences or court outcomes.\n- It does not fabricate, exaggerate, or “clean up” uncertain memories into confirmed facts.\n- It does not encourage retaliation, confrontation, or unsafe evidence collection.\n\n## Demo Flow\n\nUser input:\n\n> 我昨晚在便利店外被一个陌生人推了一下，他还抢了我的薯条。我很害怕，记不太清顺序。\n\nAgent follow-up:\n\n> 先不用急着把所有细节说完整。我们一步一步来。你最先注意到对方是在便利店里面、门口，还是外面街上？\n\nGenerated police-style statement:\n\n> On the evening of [date], I was outside a convenience store when an unknown person approached me. I remember being pushed and feeling frightened. I am not fully certain of the exact sequence, but I recall that the person took my fries and made threatening remarks...\n\nThe example intentionally preserves uncertainty instead of turning unclear memory into a stronger claim.\n\n## Architecture\n\n```text\nsafeabroad-agent\u002F\n├── backend\u002F\n│   ├── agents\u002F            # deterministic agent modules\n│   ├── models\u002F            # Pydantic case state\n│   ├── prompts\u002F           # runtime prompt templates\n│   ├── services\u002F          # workflow orchestration and LLM adapter\n│   ├── static\u002F            # Chinese web UI\n│   └── tests\u002F             # Python safety and workflow tests\n├── lib\u002F\n│   ├── agent\u002F             # TypeScript reference contracts\n│   ├── prompts\u002F           # public prompt-design docs\n│   ├── safety\u002F            # safety-boundary constants\n│   └── schemas\u002F           # Zod schemas for incident data contracts\n├── tests\u002F                 # TypeScript reference tests\n├── docs\u002F                  # architecture, modules, safety, roadmap\n└── examples\u002F              # sample case and CLI demo\n```\n\nThe current runnable app is a FastAPI backend with a static browser UI. The TypeScript `lib\u002F` layer documents stable agent contracts and schemas for future SDK, Next.js, or PWA implementations.\n\n## Quick Start\n\n```powershell\npython -m pip install -r requirements.txt\npython -m uvicorn backend.main:app --host 127.0.0.1 --port 8002\n```\n\nOpen:\n\n```text\nhttp:\u002F\u002F127.0.0.1:8002\u002F\n```\n\nAPI docs:\n\n```text\nhttp:\u002F\u002F127.0.0.1:8002\u002Fdocs\n```\n\n## Configure an LLM Provider\n\nThe app can run with deterministic fallback logic, but LLM calls improve timeline extraction and wording.\n\nCreate `.env` locally:\n\n```powershell\nCopy-Item .env.example .env\n```\n\nExample Qwen-compatible settings:\n\n```text\nLLM_PROVIDER=qwen\nDASHSCOPE_API_KEY=your-dashscope-key\nQWEN_BASE_URL=https:\u002F\u002Fdashscope.aliyuncs.com\u002Fcompatible-mode\u002Fv1\nQWEN_MODEL=qwen-plus\n```\n\nNever commit `.env` or API keys. The web UI also includes a local API settings modal for Qwen, OpenAI, Anthropic, and custom OpenAI-compatible endpoints.\n\n## Run Tests\n\nPython workflow tests:\n\n```powershell\npython -m pytest backend\u002Ftests\n```\n\nTypeScript reference tests:\n\n```powershell\nnpm install\nnpm test\n```\n\n## Screenshots\n\nScreenshots are stored in `docs\u002Fscreenshots\u002F` when generated from the local demo UI.\n\nRecommended captures:\n\n- Emergency triage\n- Incident intake\n- Timeline builder\n- Evidence checklist\n- English statement preview\n\n## Roadmap\n\n- [x] Incident intake workflow\n- [x] Timeline reconstruction\n- [x] Follow-up interview loop\n- [x] Evidence checklist and preservation guidance\n- [x] English police-style statement draft\n- [x] Medical, university, police follow-up, and support drafts\n- [x] API settings for multiple LLM providers\n- [ ] PDF export\n- [ ] Offline encrypted storage\n- [ ] Mobile PWA mode\n- [ ] Broader jurisdiction-aware support resources\n- [ ] Multi-language support beyond Chinese and English\n\n## Professional GitHub Checklist\n\n- [x] README explains the problem quickly\n- [x] README includes features and limitations\n- [x] Safety boundaries are documented\n- [x] Privacy policy is included\n- [x] Security policy is included\n- [x] Agent specification is included\n- [x] Prompt files are version-controlled\n- [x] Pydantic and Zod schemas exist\n- [x] Python workflow tests exist\n- [x] TypeScript reference tests exist\n- [x] Example user flow is shown\n- [x] License and contribution guide are included\n- [x] `.env` and secrets are ignored\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","SafeAbroad Agent 是一个面向海外中国留学生的创伤知情、隐私优先的紧急事件记录工具。它帮助用户以结构化的方式记录袭击、街头暴力、威胁、伤害、财产损失等事件，并生成双语案件记录，支持用户在与警方、医生、大学、保险公司或受害者援助服务沟通前审阅材料。项目采用FastAPI构建后端服务，支持中文输入并能转换成中立的英文陈述，同时提供证据收集指导和跟进需求草稿。适用于留学生遭遇突发事件后需要整理事实、保存证据以及准备后续沟通材料的场景。","2026-06-11 04:03:19","CREATED_QUERY"]