How clarke-ro/chief works
Chief is a mobile-first AI chief-of-staff product: users connect work accounts, synchronize provider data, and receive ranked priorities, a synthesized daily brief, schedule, and context-grounded chat. The Expo client uses authenticated API services; the Nest backend handles integrations, sync, workspace understanding, and AI reasoning, with PostgreSQL and Redis-backed jobs. The graph preserves documented app surfaces and backend stages. Some subsystem links rely on README-level architecture because their implementations were not sampled; those links are cited to the README.
Main entry points: sync-pipeline.service.ts Sync pipeline · client.ts API client · ChiefScreen.tsx Ask Chief · briefing.service.ts Briefing and ranking
Components 27
Expo client
- Client auth
src/services/auth/authService.ts - API client
src/services/api/client.ts
User workflows
- Onboarding
src/features/onboarding/screens/ConnectAppsScreen.tsx - Home brief
src/features/brief/HomeScreen.tsx - Today schedule
src/features/tasks/TasksScreen.tsx - Ask Chief
src/features/chief/ChiefScreen.tsx - Contextual actions
src/features/actions/actionRouter.ts - Analytics
src/features/analytics/AnalyticsScreen.tsx - Profile and settings
src/features/profile/ProfileScreen.tsx
Integrations and sync
- Integration management
backend/src/integrations/integrations.service.ts - OAuth flow
backend/src/integrations/oauth/oauth.service.ts - Provider adapters
backend/src/integrations/providers/provider.registry.ts - Sync orchestration
backend/src/sync/orchestrator/sync-orchestrator.service.ts - Sync pipeline
backend/src/sync/pipeline/sync-pipeline.service.ts - Provider fetchers
backend/src/sync/fetch - Normalize and persist
backend/src/sync/persist/sync-persist.service.ts
Workspace intelligence
- Briefing and ranking
backend/src/briefing/briefing.service.ts - Relevance scoring
backend/src/briefing/relevance.scorer.ts - Knowledge snapshot
backend/src/knowledge/knowledge-engine.service.ts - Workspace understanding
backend/src/workspace-engine/workspace-engine.service.ts - Chat context
backend/src/context/context-engine.service.ts - AI reasoning
backend/src/reasoning/reasoning.service.ts
Backend platform
- PostgreSQL
backend/src/common/prisma/prisma.service.ts - Redis and BullMQ
backend/src/common/bullmq/queue.service.ts - Background worker
Other components
- Chief user
- Connected work apps
Connections 34
- Chief user → Onboarding: connects accounts
- Onboarding → Client auth: authenticates with
- Client auth → API client: bootstraps session
src/services/auth/authService.ts - Chief user → Home brief: views priorities
- Home brief → API client: loads brief
- Chief user → Today schedule: plans day
- Today schedule → API client: refreshes schedule
src/features/tasks/TasksScreen.tsx - Chief user → Ask Chief: asks question
- Ask Chief → API client: posts chat
- Chief user → Contextual actions: chooses action
- Chief user → Analytics: reviews impact
- Chief user → Profile and settings: manages account
- API client → Integration management: calls API
- Integration management → OAuth flow: starts OAuth
- OAuth flow → Provider adapters: selects provider
backend/src/integrations/oauth/oauth.service.ts - Connected work apps → OAuth flow: authorizes access
- Provider adapters → Sync orchestration: provides adapters
backend/src/sync/orchestrator/sync-orchestrator.service.ts - Sync orchestration → Sync pipeline: dispatches resource jobs
backend/src/sync/orchestrator/sync-orchestrator.service.ts - Sync pipeline → Provider fetchers: fetches provider data
backend/src/sync/pipeline/sync-pipeline.service.ts - Sync pipeline → Normalize and persist: persists fetched batch
backend/src/sync/pipeline/sync-pipeline.service.ts - Normalize and persist → PostgreSQL: writes records
- Sync pipeline → Briefing and ranking: queues fresh brief
backend/src/sync/pipeline/sync-pipeline.service.ts - Sync orchestration → Redis and BullMQ: enqueues sync jobs
backend/src/sync/orchestrator/sync-orchestrator.service.ts - Redis and BullMQ → Background worker: delivers jobs
- Background worker → Sync pipeline: runs sync
- Briefing and ranking → Relevance scoring: ranks candidates
backend/src/briefing/briefing.service.ts - Briefing and ranking → PostgreSQL: reads workspace data
backend/src/briefing/briefing.service.ts - Knowledge snapshot → PostgreSQL: loads snapshot
backend/src/knowledge/knowledge-engine.service.ts - Workspace understanding → Briefing and ranking: builds on brief
backend/src/workspace-engine/workspace-engine.service.ts - Workspace understanding → Knowledge snapshot: loads knowledge
backend/src/workspace-engine/workspace-engine.service.ts - Ask Chief → Chat context: requests context
- Chat context → Workspace understanding: builds workspace snapshot
backend/src/context/context-engine.service.ts - Chat context → AI reasoning: supplies structured context
- AI reasoning → Ask Chief: returns reply