How sach-pro/keyflowos works
KEYFLOW OS is an AI-powered business operating system for small teams. A principal workflow is a user asking KEY to act on business data: the KEY Cortex query pipeline processes the request, applies autonomy and approval oversight, then invokes business capabilities whose results are persisted. The product also includes CRM, finance, bookings, calendar, inbox, integrations, analytics, and public-facing surfaces. Relationships are grounded in the README and SOURCE INDEX references; unsampled capability links are omitted where their runtime wiring is not shown.
Main entry points: key-cortex-query-pipeline.service.ts KEY Cortex · prisma.service.ts Prisma data access · flow-orchestrator.service.ts Flow orchestration · web Web workspaces
Components 23
User experience
- Web workspaces
apps/web - CRM pipeline
apps/web/src/app/app/crm/pipeline/pipeline-toolbar.tsx - NestJS API
apps/server/src/main.ts
KEY AI
- KEY Cortex
apps/server/src/modules/key-cortex/key-cortex-query-pipeline.service.ts - Model gateway
apps/server/src/modules/ai/model-gateway.service.ts - AI oversight
apps/server/src/modules/ai/ai-oversight.service.ts - Flow tools
apps/server/src/modules/ai/flow-tool-registry.ts - Flow orchestration
apps/server/src/modules/ai/flow-orchestrator.service.ts
Business operations
- CRM
apps/server/src/modules/crm/crm.service.ts - Commerce and finance
apps/server/src/modules/commerce/commerce.service.ts - Bookings
apps/server/src/modules/bookings/bookings.service.ts - Calendar queries
apps/server/src/modules/calendar/calendar-query.service.ts - KEY Inbox
apps/server/src/modules/key-inbox/key-inbox.service.ts - Business analytics
apps/server/src/modules/analytics - Public surfaces
apps/server/src/modules/bookings
Ingestion and integrations
- Ingestion review
apps/server/src/modules/ingestion/ingestion-orchestrator.service.ts - Connector framework
apps/server/src/core/connectors/connector.interface.ts - Gmail ingestion
apps/server/src/core/connectors/implementations/gmail-ingestion.service.ts
Platform services
- Prisma data access
apps/server/src/core/prisma/prisma.service.ts - PostgreSQL
packages/db/src/client.ts - Redis services
apps/server/src/core/redis/redis.service.ts
Other components
- Business user
- External providers
Connections 22
- Business user → Web workspaces: uses
README.md - Web workspaces → NestJS API: calls API
README.md - Business user → KEY Cortex: asks KEY
- NestJS API → KEY Cortex: routes requests
- KEY Cortex → Model gateway: queries models
apps/server/src/modules/key-cortex/key-cortex-query-pipeline.service.ts - KEY Cortex → AI oversight: checks autonomy
- KEY Cortex → Flow tools: dispatches tools
- AI oversight → Flow tools: checks tool risk
apps/server/src/modules/ai/ai-oversight.service.ts - Flow orchestration → CRM: invokes CRM
apps/server/src/modules/ai/flow-orchestrator.service.ts - Flow orchestration → Commerce and finance: invokes commerce
apps/server/src/modules/ai/flow-orchestrator.service.ts - Flow orchestration → Bookings: invokes bookings
apps/server/src/modules/ai/flow-orchestrator.service.ts - CRM pipeline → NestJS API: updates records
- Gmail ingestion → Connector framework: implements contract
apps/server/src/core/connectors/implementations/gmail-ingestion.service.ts - Gmail ingestion → KEY Inbox: adds messages
apps/server/src/core/connectors/implementations/gmail-ingestion.service.ts - Ingestion review → KEY Inbox: upserts threads
apps/server/src/modules/ingestion/ingestion-orchestrator.service.ts - Ingestion review → Prisma data access: reads items
apps/server/src/modules/ingestion/ingestion-orchestrator.service.ts - Calendar queries → Prisma data access: queries data
apps/server/src/modules/calendar/calendar-query.service.ts - KEY Inbox → Prisma data access: stores messages
apps/server/src/modules/key-inbox/key-inbox.service.ts - Prisma data access → PostgreSQL: uses client
apps/server/src/core/prisma/prisma.service.ts - KEY Cortex → Redis services: uses cache
apps/server/src/modules/key-cortex/key-cortex-query-pipeline.service.ts - External providers → Connector framework: supplies data
- Web workspaces → Public surfaces: presents services