ReEntryOS is an AI-powered case coordination system designed to synthesize hyper-localized, actionable service plans for individuals in their critical first 72 hours after release from incarceration. By deploying a team of specialized AI agents, the platform automates risk assessment, coordinates transitional housing, determines benefit eligibilities, schedules Google Calendar appointments, and manages Twilio SMS communication sequences.
Follow these numbered steps to configure ReEntryOS in your development environment:
-
Clone the Repository
git clone <your-repo-link> cd reentryos
-
Install Dependencies
npm install
-
Configure Environment Variables
- Duplicate the example template to create your local variables:
cp .env.example .env.local
- Open
.env.localand populate all requested API keys (see API Key Provisioning below).
- Duplicate the example template to create your local variables:
-
Initialize Database Migrations
- Go to Supabase Console.
- Open your project's SQL Editor.
- Copy the entire SQL contents from 001_initial_schema.sql and execute the query to set up tables, indexes, and row-level security (RLS).
-
Start the Development Server
npm run dev
Open http://localhost:3000/dashboard to view the interface.
Configure each required service to populate .env.local:
- Endpoint: console.anthropic.com
- Sign in or create a developer profile, navigate to the API Keys section, and generate an API key. Add it to
ANTHROPIC_API_KEY.
- Endpoint: tavily.com
- Register for a developer account to get a search API key. This powers the agent's web searches for real-time local shelters, food banks, and vital records offices. Add it to
TAVILY_API_KEY.
- Endpoint: supabase.com
- Create a new project.
- Go to Project Settings > API to copy:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEY(required to bypass RLS policies during intake flows).
- Endpoint: twilio.com
- Copy your
TWILIO_ACCOUNT_SIDandTWILIO_AUTH_TOKENfrom the Twilio Console Dashboard. - Buy a phone number with SMS capability and add it to
TWILIO_PHONE_NUMBER. - Create a Messaging Service under Messaging > Services in your Twilio Console. Note the
TWILIO_MESSAGING_SERVICE_SIDfor automated scheduling rules. - Configure Twilio Webhook:
- In the Twilio Console under your active Phone Number settings, scroll to the Messaging section.
- Set the "A MESSAGE COMES IN" webhook URL to:
https://<your-deployed-domain>/api/sms/webhook - Ensure the method is set to
POST.
To allow the Calendar Agent to automatically book client appointments on your calendar:
- Go to the Google Developer OAuth2 Playground.
- On the right, click the OAuth2 Playground Configuration gear icon and check the "Use your own OAuth credentials" box (if you have them; otherwise leave it unchecked for testing).
- Under Select & authorize APIs (Step 1) on the left, search for
Calendar API v3and select:https://www.googleapis.com/auth/calendarhttps://www.googleapis.com/auth/calendar.events
- Click Authorize APIs and authenticate with your Google account.
- In Step 2, click Exchange authorization code for tokens.
- Copy the Refresh Token into your
.env.localasGOOGLE_REFRESH_TOKEN. - Configure
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETfrom your Google Cloud Console credentials page, and specify the targetGOOGLE_CALENDAR_ID(usually your primary email address).
We have included a seed pipeline script to simulate a client intake flow and verify agent execution:
-
Deploy Mock Client Intake Pipeline Run the seed script in a separate terminal:
npx ts-node -r dotenv/config --project tsconfig.json scripts/seed.ts
This will post a mock profile for Marcus Thompson to
/api/intake/stream, instantiate all AI agents, stream their logs in real-time, synthesize the plan, and output Marcus's correlated Client ID. -
Navigate the Coordination Hub
- Open http://localhost:3000/dashboard.
- Select Marcus Thompson from the sidebar list.
- 72-HOUR PLAN Tab: Inspect synthesized urgent needs, transitional housing, snap/medicaid screening, and vital records DMV pathways.
- SCHEDULE Tab: Confirm Google Calendar appointments were created and synchronized.
- MESSAGES Tab: Inspect automated messages queued to Twilio scheduler.
- AGENT LOGS Tab: Click through individual agent filter chips ("HOUSING", "BENEFITS", "PLAN") to inspect pipeline telemetry logs and duration costs.