Local-first social orchestration system for WhatsApp and Instagram, built with Bun, Next.js (App Router), Convex, and long-running channel workers.
This project combines:
- a real-time operator dashboard
- autonomous and review-first messaging workflows
- context-aware AI reply generation with fallback providers
- follow-up / todo extraction and scheduling
- media and meme workflows
- channel setup, runtime controls, and health telemetry
If you are preparing this repo for open source, this document is the entrypoint. Deep references live in docs/reference.
- What This Project Does
- System Architecture
- Feature Surface
- Quick Start
- Configuration
- Runtime Scripts
- OpenAI-Compatible Gateway
- Repository Layout
- Testing
- License
- Contributing
- Support and Security
- Open-Source Readiness Checklist
- Reference Docs
Social Life Manager is a local-first personal automation system for social messaging.
Core capabilities:
- Ingests inbound activity from WhatsApp and Instagram workers.
- Persists messages, thread state, drafts, outbox jobs, follow-ups, todos, media assets, and telemetry in Convex.
- Generates replies with Azure AI first and Codex CLI fallback.
- Applies guardrails, quality checks, mimicry controls, and conversation steering rules.
- Supports review-first and autonomous send modes.
- Supports a setup/onboarding flow with local instance security (PIN + unlock session).
- Exposes an OpenAI-style chat completion endpoint powered by the same internal reply pipeline.
- Includes a local self-improvement loop (
codex exec) with run history and dashboard visibility.
High-level runtime topology:
Next.jsapp (src/app/*) renders the dashboard and serves route handlers under/api/*.Convexbackend (convex/*) stores state and executes queries/mutations/actions/crons.WhatsAppworker (src/worker/index.tsvia supervisor) handles socket events, ingestion, drafting, and outbox sends.Instagramworker (src/worker/instagram.tsvia supervisor) handles IG inbox/outbox flow.Azure AIis the primary generation provider (text + optional image/video meme generation).Codex CLIis used as fallback generation and for local self-improvement runs.- Optional local ML/audio tooling:
- local embeddings via
@xenova/transformers - local voice transcription via
whisper.cpp - optional cloned voice note generation via VoxCPM setup flow
- local embeddings via
Automations are split between:
- worker-side loops (polling/claiming/sending/maintenance)
- Convex cron jobs (follow-up promotion, outreach, retention, stale cleanup, AI tuning jobs)
The dashboard is organized into product areas in src/lib/ui/dashboard-nav.ts.
Primary areas:
Home(/): command-style home surface and navigation helper.Queue(/queue): draft approvals, snoozes/rejections, follow-up/todo actions, guardrail resolution.Conversations(/conversations): thread timeline, draft edits, grounding, personality overrides, per-thread ops.Status(/status): status drafts/posts pipeline and status automation controls.Media(/media): unified media stream with source-thread linkage.Memes(/memes): meme generation and meme asset review.Backlog(/backlog): stale/unread thread triage, importance/relationship overrides, snoozing, reconnect drafts.Follow-ups(/followups): follow-up timeline, confirm/snooze/cancel, agenda todo creation.Activity Core(/activity-core): live activity and media signal stream.Systems Design(/systems-design): runtime/system event visibility.
Secondary areas:
Setup(/setup): onboarding, channel pairing, worker runtime checks.Style Lab(/style-lab): mimicry, learned traits, style rollback, persona packs.Rules(/rules): ignore target controls and boundary rules.Settings(/settings): full runtime tuning surface.System(/system): health metrics, provider traces, telemetry feed.Spending(/spending): Azure usage + spend analytics with optional env pricing.Self Improvement(/self-improvement): local Codex run history/report views.
Additional feature domains:
- Self-chat runtime commands (
pause/resume/restart/statusfor worker/app/both). - Smart self-control routing and manager planning for self-chat intents.
- Contact memory extraction and retrieval tools.
- Conversation intelligence signals (check-ins, topic lanes, pivot/close guidance).
- Relationship state tracking and adaptive romantic morning/outreach flows.
- Voice note STT and optional TTS cloning flow.
For complete capability mapping, see docs/reference/feature-catalog.md.
From local checkout:
npx --yes . -- --in-place --system --serveFrom npm after publish:
npx --yes odogwuhq -- --system --serveFrom GitHub directly:
npx --yes github:cybermonkjbot/lifemanager -- --system --serveInstaller supports flags such as:
--no-system--with-voice--no-serve--no-config--yes--dir <path>
- Install dependencies:
bun install- Create local env file:
cp .env.example .env.local- Set required values at minimum:
CONVEX_URL(orNEXT_PUBLIC_CONVEX_URL)AZURE_AI_ENDPOINTAZURE_AI_API_KEYAZURE_AI_MODEL
- Start all services:
bun run dev:allThis starts:
next devconvex devwhatsapp worker supervisorinstagram worker supervisor
- Open the app and complete setup:
http://localhost:3000- first run routes to
/setup - create/confirm instance security and connect channels
Primary configuration sources:
.env.local(runtime environment)- Convex
appConfigvalues (mutable runtime config via Settings page) - local instance setup state (
.slm/instance-config.json)
Key references:
- Full env var reference: docs/reference/environment.md
- Convex function/module map: docs/reference/feature-catalog.md
- HTTP route reference: docs/reference/http-api.md
From package.json:
bun run dev/bun run dev:next: dashboard onlybun run dev:convex: Convex backend onlybun run worker: WhatsApp worker supervisorbun run worker:instagram: Instagram worker supervisorbun run worker:raw: direct WhatsApp worker entrybun run worker:instagram:raw: direct Instagram worker entrybun run dev:all: run next + convex + whatsapp worker + instagram worker concurrentlybun run build: Next.js production buildbun run start: production Next.js startbun run lint: ESLint checksbun run pidgin:refresh: refresh pidgin lexicon candidatesbun run pidgin:promote: promote approved pidgin lexicon entriesbun run pidgin:refresh-and-promote: run both lexicon stagesbun run self-improve: run one local self-improvement cyclebun run self-improve:daemon: recurring self-improvement daemon
Endpoint:
POST /api/gateway/v1/chat/completions
Behavior:
- OpenAI-style request/response shape.
- Uses the same internal generation pipeline as dashboard + workers.
- Requires
SLM_API_GATEWAY_KEYandAuthorization: Bearer ...(orX-API-Key). stream: trueis rejected.- Optional thread scoping via
threadId,thread_id, or metadata aliases. - Adds an
slmobject in response with provider/model/quality/guardrail/context metadata.
Example:
curl -sS http://localhost:3000/api/gateway/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SLM_API_GATEWAY_KEY" \
-d '{
"model": "slm-gateway",
"messages": [
{ "role": "system", "content": "Respect all house rules." },
{ "role": "user", "content": "Draft a short check-in text for this evening." }
]
}'src/app/*: Next.js pages and API route handlerssrc/components/*: client/server dashboard componentssrc/lib/*: shared runtime helpers, auth/gate helpers, setup managers, UI helperssrc/worker/*: WhatsApp/Instagram workers and AI orchestration logicconvex/*: schema, backend modules, actions, and cronsscripts/*: installer, lexicon tooling, self-improvement runner, voice utility scriptdocs/*: design docs, reports, and reference materialdata/*: lexicon approval/candidate inputsshared/*: shared constants/generated lexicon payloads
The repo includes extensive *.test.ts coverage in both:
src/workerconvex
Run all tests:
bun testRun targeted tests (examples):
bun test src/worker
bun test convexThis repository is source-available under the PolyForm Noncommercial 1.0.0 license.
- Personal and other non-commercial use is permitted.
- Commercial use is not permitted under the default license.
- Because commercial use is restricted, this license does not meet OSI open source criteria.
If you need commercial usage rights, contact the maintainers to discuss a separate commercial license.
See CONTRIBUTING.md for contribution workflow and contribution license terms.
- Support policy: SUPPORT.md
- Security policy and disclosure process: SECURITY.md
- Community behavior standards: CODE_OF_CONDUCT.md
Implemented in this repository:
- Distribution license and package metadata are aligned (
LICENSE,package.json). - Community and governance docs are present (
CONTRIBUTING,CODE_OF_CONDUCT,SUPPORT,SECURITY). - Contributor workflows are present (
.github/ISSUE_TEMPLATE/*,.github/pull_request_template.md,.github/CODEOWNERS). - Automation is present (
.github/workflows/ci.yml,.github/workflows/codeql.yml,.github/dependabot.yml). - Release process docs are present (
CHANGELOG.md,RELEASE.md).
Manual GitHub repo settings still required:
- Enable branch protection on
mainand require CI + CodeQL checks. - Enable private vulnerability reporting and GitHub security features (secret scanning, Dependabot alerts, push protection).
- Decide whether to enable GitHub Discussions for support questions.
- Scrub full git history for secrets before public launch (if not already done).
- Feature catalog: docs/reference/feature-catalog.md
- HTTP API reference: docs/reference/http-api.md
- Environment variables: docs/reference/environment.md
- Dependencies and stack inventory: docs/reference/dependencies.md
- Release process: RELEASE.md
- Changelog: CHANGELOG.md
Project-specific implementation docs already present in this repo: