This repository contains the demo-ready A30 anti-fraud assistant:
- FastAPI backend with
/api/health,/api/analyze,/api/intervene,/api/report, and/api/knowledge/import - Static frontend dashboard served from
/ - Lightweight rule engine, knowledge retrieval, and evaluation script
-
Create and activate a virtual environment.
python -m venv .venv .\.venv\Scripts\Activate.ps1 -
Install dependencies.
pip install -r requirements.txt -
Start the app.
uvicorn app.backend.main:app --reload -
Open the dashboard.
http://127.0.0.1:8000
- Open the dashboard and choose a role:
student,adult, orelderly. - Paste suspicious text into the main input. Add optional audio and image hints if you want to show multimodal support.
- Click the main analysis button to call
/api/analyze. - Review the risk level, scam type, evidence chips, recommendation, and the generated report preview.
- Click the intervention button to call
/api/intervene. - For high-risk cases with a guardian contact, the backend returns
guardian_notified; otherwise it falls back to a warning or tip-only action. - If you want to show the report endpoint directly, call
/api/reportwith the analysis summary payload and display the returned Markdown.
Run the evaluation script from the repository root:
python scripts/evaluate.pyThe script prints a JSON summary with total, correct, and accuracy.
-
GET /api/healthreturns{"status": "ok"} -
POST /api/analyzereturnsrisk_level,scam_type,evidence, andrecommendation -
POST /api/intervenehandles the high-risk guardian flow -
POST /api/reportreturns a Markdown safety report -
GET /serves the dashboard and/assets/*serves the frontend files -
python scripts/evaluate.pyprints a JSON evaluation summary