Inspiration

Pactwell began with my own family.

Some of my family members may face Alzheimer’s or other forms of memory loss one day. I have also observed how responsibility in healthcare can become divided between relatives, caregivers, institutions, and software.

People experiencing memory loss are among the most vulnerable people in society. They may depend on others to explain where they are, what happened, and whom they can trust. I wanted to explore whether AI could provide useful grounding support while holding the humans responsible for their care accountable to one another.

Pactwell follows one central rule:

No caregiver should be able to silently rewrite another person’s reality.

What it does

Pactwell is a working prototype built around a fictional patient named June.

June can ask personal grounding questions by typing or speaking. The assistant answers using her currently approved information. If the available facts do not support an answer, Pactwell says so instead of guessing.

The caregiver workflows demonstrate several safeguards:

  • Editing protected personal-history facts or medication reminders creates a proposal instead of immediately replacing the approved version.
  • June continues receiving the previous approved information while a change awaits review.
  • The assigned independent reviewer can compare the approved and proposed versions before approving or rejecting the change.
  • Trusted-family and physician review roles are enforced separately.
  • Potential coercion or exploitation triggers warnings and access restrictions.
  • Temporary caregivers receive read-only, limited, expiring access.
  • Consent, revocation, review decisions, and important actions are added to a browser-local accountability record for the demonstration.
  • Sensitive-access reviewers can revoke their recorded approval and review the request again without generating duplicate signatures.

Pactwell does not assume that a caregiver, institution, or AI system is automatically trustworthy. Important changes remain visible, reviewable, and attributable to a person.

How I built it

Pactwell is an installable progressive web app built with React 19, TypeScript, Next.js 16, Vite, and Vinext. It is deployed through Cloudflare Workers and uses IndexedDB for fictional, browser-local demonstration state.

For normal grounding requests, Cloudflare Workers AI receives June’s question and her current approved facts. The model selects request-scoped fact IDs. The server resolves those IDs to the exact approved text supplied with that request.

This allows a reviewed fact to change from “32 years” to “40 years” without hard-coded answers. The model identifies relevant evidence, but it does not freely invent June’s personal information.

The prototype uses:

  • Cloudflare Workers AI with Llama 3.1 8B for grounding selection
  • Whisper Large V3 Turbo for speech transcription
  • Deepgram Aura 2 for voice replay
  • IndexedDB for local demonstration state
  • GitHub for source control and deployment workflows

I used Codex with GPT-5.6 across product design, implementation, debugging, testing, deployment, and browser verification. I defined the product direction, safeguarding rules, and acceptance criteria. Codex handled bounded implementation tasks, traced defects across the interface and API, added regression tests, managed GitHub delivery, and verified completed changes in the browser.

GPT-5.6 was used through Codex during development. The deployed application uses Cloudflare Workers AI at runtime. Product boundaries, consent rules, review requirements, and final acceptance remained human decisions.

Challenges

The hardest problem was deciding what the system was allowed to treat as true.

An early caregiver workflow changed approval status while someone was still editing a form. This could lock the screen even when no change had been submitted, and it did not preserve a reliable comparison between the approved information and the proposed replacement.

I redesigned the flow so typing remains a local draft. Saving an unchanged form does nothing. Submitting a real protected change creates a separate proposal, while the previous approved information stays active until the assigned reviewer makes a decision.

Grounding presented another problem. A rigid keyword system could answer one known example but fail when the wording or stored value changed. The final implementation calls the runtime AI first, asks it to select request-scoped fact IDs, and resolves the selected facts on the server. A narrower second AI request handles malformed or empty selections. A value-agnostic local retrieval system is used only when AI inference is unavailable.

The application also needed usable failure states. Written responses remain available when voice playback fails, typed input is available when transcription cannot be used, and unsupported questions do not receive invented personal details.

What I learned

Pactwell reinforced that AI safety cannot be handled by a prompt alone.

The surrounding application must control the model’s evidence, validate its output, preserve approved records during disputes, expose pending changes, restrict access, and provide a clear route back to a responsible person.

I also learned how effectively Codex can support a complete development loop:

Product direction → Codex → GitHub → Cloud deployment → Browser testing

Codex accelerated the implementation, but I reviewed and accepted the completed work and remained responsible for the product.

What’s next

Pactwell currently uses fictional information and browser-local storage. The accountability history is not tamper-proof and the prototype should not be used with real patient data.

Further development would require:

  • Research with people experiencing memory loss, family caregivers, advocates, and care professionals
  • Secure authentication and encrypted server-side storage
  • Verified caregiver and reviewer identities
  • Tamper-evident accountability records
  • Configurable review policies
  • Independent accessibility, privacy, security, and clinical-safety assessments
  • Usability testing with the people affected by these decisions

Pactwell is a hackathon prototype, not a medical device, diagnostic system, or emergency service.

Built With

  • accessibility
  • cloudflare-workers
  • cloudflare-workers-ai
  • codex
  • css
  • deepgram-aura
  • github
  • gpt-5.6
  • html
  • indexeddb
  • javascript
  • llama
  • pwa
  • react
  • responsible-ai
  • speech-to-text
  • text-to-speech
  • typescript
  • vinext
  • vite
  • whisper
Share this project:

Updates