Home-emergency AI companion. A hybrid router sends each message to one of six
specialist agents (safety, health, reminder, behavior, caregiver, companion);
agents call tools through a tool loop. The LLM is reached only through a
provider-neutral seam, so the same code runs on OpenAI cloud or a local
NVIDIA DGX Spark by changing .env alone.
See README.md for full install/run instructions and ARCHITECTURE.md / CODEBASE_MAP.md for design.
backend/— FastAPI + LangGraph agent + SQLModel DB + SSE event bus (Python).frontend/— Next.js 16 web dashboard (has its own CLAUDE.md).flutter_frontend/— Flutter mobile/desktop client (mirrors the web UI).watch/— Wear OS app that streams real vitals toPOST /vitals/ingest.scripts/—phase0.py(text in/out),try_live.py,seed_patient.py, etc.
- Use the
C:\Python313interpreter for all backend work (C:/Python313/python.exe). The other Python installs /.venvdo not have the deps; condabaseis on PATH but is the wrong one. - pip console scripts (
guardian-backend,guardian-seed) are off-PATH here. Prefer module form:python -m uvicorn backend.main:appandpython -c "from backend.db.seed import seed_all; seed_all()". Makefile targets that call bare scripts will fail. - Run all backend/DB commands from the repo root.
DATABASE_URLissqlite:///./guardian.db— relative to the process cwd. The PowerShell tool runs at the repo root; the Bash tool's cwd has been observed to befrontend/, which silently creates/migrates a strayfrontend/guardian.dbinstead of the real one. Verifyos.getcwd()before any DB write. See memoryguardians-dev-servers-and-cwd. - DB schema auto-migrates on startup (
init_db()→_lightweight_migrate()adds missing columns for SQLite). There is no Alembic setup despite Makefile mentioning it. Seeds patients Eleanor (#1) and Sarah (#2) if empty.
- Next.js 16 + Turbopack: read
frontend/CLAUDE.md— APIs differ from training data; consultnode_modules/next/dist/docs/before writing Next code. - Only one
next devper project. The user usually runs it on :3000, which blocks a second instance and the Claude Preview MCP — you cannot browser-drive the web UI here; verify withtsc --noEmit,eslint, and the dev log atfrontend/.next/dev/logs/next-development.log. - The active patient profile is a lightweight session stored in localStorage
(
profile-storage.ts):getActivePatientId()isnullwhen logged out;SessionGateshows a profile picker until one is chosen.
python -m pytestfrom the repo root.- Docker is broken here, so the testcontainers-Postgres tests (
db_sessionfixture) error out — expected; use SQLite-backed paths for Docker-free checks. - The smoke test places a real Twilio call and fails with HTTP 401 unless valid
TWILIO_*creds are set — environmental, not a code regression.
openaiis imported only inbackend/llm/(the provider seam). Never import a vendor SDK elsewhere; talk to the LLM throughbackend.llm.- Tools are registered in
backend/tools/and invoked via the registry/tool loop. - Code style:
ruff(line-length 100, py311). Runruff check/ruff formatonbackend tests scripts. - Don't commit secrets;
.envis git-ignored (.env.exampleis the template).