{"slug": "an-ai-chief-of-staff", "title": "An AI Chief of Staff", "summary": "Suhas Bhairav released AICoS, an open-source AI Chief of Staff workspace that turns department-level CSV uploads into live dashboards, Slack-derived action items, and board-ready PDF reports. The tool integrates with Supabase, OpenAI, HubSpot, Linear, and Notion to synthesize metrics for CEOs and operators.", "body_md": "Turn every department's metrics into board-ready decisions, Slack-aware action tracking, executive scorecards, Supabase vector memory, CEO chat, PDF reports, board memos, and guarded AI recommendations.\n\n**Created by Suhas Bhairav**\n\nIndependent personal project. Completely open source under the MIT License.\n\nAICoS - AI Chief of Staff is an operating intelligence workspace for CEOs, founders, operators, and functional leaders. It turns department-level CSV uploads into live dashboards, current Supabase JSONB snapshots, Slack-derived action items, historical trend imports, board memos, and OpenAI-generated recommendations.\n\nThe product is designed around a simple idea: every important department should report the metrics a serious CEO would actually inspect, and the Executive dashboard should synthesize those signals into company-level operating judgment.\n\n|\nCEO-level rollups across value creation, cash, GTM efficiency, customer/product health, risk, and execution posture.\n|\nFinance, Sales, Marketing, Product, HR, Legal, IT, Operations, Support, Risk, Strategy, R&D, and Executive views.\n|\nOpenAI calls happen only when a user clicks\n|\n||\n|\nFlexible department snapshots are stored as JSONB, so changing columns does not require schema churn.\n|\nReal Slack OAuth, Web API, Events API, signed request verification, task harvesting, and message snapshots.\n|\nAll OpenAI calls are protected against prompt injection, jailbreaks, secret leakage, and unsafe task mutations.\n|\n||\n|\nSync the full CRM deal pipeline for open pipeline, weighted forecast, stage mix, stale deals, top opportunities, and owner accountability.\n|\nChat about any department, retrieve Supabase vector evidence, and escalate to guarded OpenAI synthesis only when the CEO asks.\n|\nSync Linear issues for open load, urgent work, overdue tickets, stale execution, team pressure, project risk, and completion throughput.\n|\nSync a real Notion OKR database into Product to track objectives, key results, owners, progress, status, risk, and due dates.\n|\nEvery CSV upload is appended to an immutable Supabase import ledger for multi-period analysis.\n|\n|\nBeautiful reports include cover pages, AI synthesis, KPI snapshots, chart tables, department tables, and methodology.\n|\n||||\n|\nGenerates board-facing PDFs and stores memo metadata/content in Supabase.\n|\n\n| Area | What It Does | Storage / Engine |\n|---|---|---|\n| Executive dashboard | Summarizes all departments into CEO scorecards | Supabase JSONB |\n| Department dashboards | Calculates KPI cards and charts from uploaded CSVs | Browser CSV parser + Supabase |\n| AI synthesis | Generates CEO and department recommendations | OpenAI Responses API |\n| CEO Chat | Retrieves department evidence and answers CEO questions | Supabase pgvector + OpenAI |\n| Product OKRs | Syncs live Notion OKRs into the Product dashboard | Notion API + Supabase |\n| Deal Pipeline | Tracks HubSpot pipeline health for the CEO | HubSpot CRM API + Supabase |\n| Ticket Overview | Tracks Linear execution health for the CEO | Linear npm SDK + Supabase |\n| Slack integration | Reads channels/DMs, replies, harvests commitments | Slack OAuth + Events API |\n| Master To-Do | Tracks tasks, waiting-on items, delegated work | Supabase summary JSON |\n| Historical imports | Preserves every upload for trend analysis | `department_snapshot_history` |\n| PDF reports | Exports dashboard state and OpenAI explanation | `jspdf` + `jspdf-autotable` |\n| Board memos | Saves and exports board-facing memo narratives | `board_memos` |\n| Guardrails | Blocks jailbreaks and wraps untrusted data | Shared OpenAI guardrail layer |\n\nThis is not a generic BI dashboard. It focuses on the metrics CEOs, CFOs, operators, and investors actually care about:\n\nGrowth QualityARR, revenue growth, NRR, Rule of 40 |\nCash Disciplineburn multiple, runway, FCF margin, operating expenses |\nGTM Efficiencypipeline, bookings, CAC, LTV:CAC, CAC payback, win rate |\nProduct Healthactivation, retention, adoption, NPS, P1 bugs, velocity |\nCustomer HealthCSAT, NPS, backlog, escalation rate, response/resolution time |\nOperational Executionthroughput, yield, defect rate, on-time delivery, inventory turns |\nRisk Postureenterprise risk, audit score, control coverage, unmitigated risks |\nStrategic LeverageTAM coverage, market share, partnerships, M&A pipeline |\n\nThe Executive dashboard intentionally avoids naive technical metrics like row count or column count as core charts. Those are relegated to the data-store table. Executive charts focus on operating outcomes.\n\n```\nai-chief-of-staff/\n  frontend/\n    app/\n      page.js                              # Home command center\n      departments/[slug]/page.js           # Department + executive dashboards\n      slack/page.js                        # Live Slack workspace UI\n      todo/page.js                         # Master To-Do command center\n      integrations/page.js                 # Slack integration hub\n      assistant/page.js                    # CEO chat over Supabase vector memory\n      pipeline/page.js                     # HubSpot CEO deal pipeline\n      tickets/page.js                      # Linear CEO ticket overview\n      api/\n        analytics/[department]/route.js    # Guarded OpenAI recommendations\n        ceo-chat/route.js                  # Retrieval planner + CEO answer agent\n        embeddings/rebuild/route.js        # Backfill vector memory\n        notion/okrs/route.js               # Notion OKR sync and store\n        hubspot/deals/route.js             # HubSpot deal pipeline sync and store\n        linear/tickets/route.js            # Linear ticket sync and store\n        current-data/route.js              # Supabase JSONB current store\n        historical-data/route.js           # Historical trend import ledger\n        board-memos/route.js               # Board memo persistence\n        slack/...                          # Slack OAuth, events, channels\n        todo/route.js                      # Master To-Do sync and mutation\n    lib/\n      current-data-store.js                # Supabase read/write + org rollup\n      openai/department-embeddings.js      # OpenAI embeddings + pgvector retrieval\n      openai/guardrails.js                 # Enterprise AI guardrails\n      slack/server.js                      # Slack OAuth/API helpers\n      supabase/server.js                   # Server-side Supabase client\n\n  supabase/\n    schema.sql                             # Table creation SQL\n    README.md                              # Supabase setup notes\n\n  slack/\n    slack-app-manifest.example.json        # Slack app manifest template\n\n  backend/\n    main.py                                # FastAPI CSV parsing scaffold\nphp\nflowchart LR\n  A[Department CSV Upload] --> B[Next.js API]\n  B --> C[Supabase department_snapshots]\n  B --> D[Supabase department_snapshot_history]\n  B --> M[Supabase department_embeddings]\n  C --> E[Executive Rollup]\n  D --> F[Historical Trend Ledger]\n  M --> N[CEO Chat Retrieval]\n  E --> G[CEO Dashboard]\n  G --> H[Guarded OpenAI Synthesis]\n  N --> H\n  H --> I[PDF Report / Board Memo]\n  J[Slack Events API] --> K[Task Harvester]\n  K --> L[Master To-Do]\n```\n\n- A department user downloads a CSV template.\n- The user uploads operating data in that department dashboard.\n- The frontend parses the CSV into records.\n`/api/current-data`\n\nupserts the current department snapshot.- The same upload is appended to the historical import ledger.\n- Executive rollups calculate org-level scorecards.\n- Uploads refresh Supabase vector embeddings for CEO chat retrieval.\n- OpenAI recommendations are generated only on explicit button clicks or chat sends.\n- PDF reports and board memos export from the live dashboard state.\n- Slack events and channel sync harvest commitments into the Master To-Do.\n\nPrimary tables:\n\n| Table | Purpose |\n|---|---|\n`department_snapshots` |\nOne current JSONB snapshot per department |\n`organization_summaries` |\nLatest executive rollup and summary content |\n`department_snapshot_history` |\nImmutable historical import ledger |\n`board_memos` |\nSaved board memo metadata and JSON content |\n`department_embeddings` |\npgvector chunks for CEO chat and department retrieval |\n`notion_okr_snapshots` |\nSynced Notion Product OKR snapshots |\n`hubspot_deal_snapshots` |\nSynced HubSpot deal pipeline snapshots |\n`linear_ticket_snapshots` |\nSynced Linear issue snapshots |\n`slack_installations` |\nActive Slack workspace installs and bot tokens |\n`slack_events` |\nSigned Slack Events API webhook ledger |\n`slack_message_snapshots` |\nSlack channel/DM message snapshots |\n\nRun [supabase/schema.sql](/suhasbhairav/ai-chief-of-staff/blob/master/supabase/schema.sql) in the Supabase SQL Editor before starting the app.\nThe schema enables `pgvector`\n\nand exposes `match_department_embeddings`\n\nfor cosine-similarity search.\n\nAll OpenAI API calls use [frontend/lib/openai/guardrails.js](/suhasbhairav/ai-chief-of-staff/blob/master/frontend/lib/openai/guardrails.js).\n\nPrompt Injection DefenseBlocks direct jailbreak and secret-exfiltration prompts before model calls. |\nSecret RedactionRedacts common API key, Slack token, JWT, password, and service-role patterns. |\nUntrusted Data WrappingSlack messages, CSV-derived JSON, tasks, and dashboards are marked as evidence, not instructions. |\nPayload CapsNormalizes and truncates oversized inputs before OpenAI calls. |\nGuarded Responses APIAll model calls go through `guardedResponsesCreate` . |\nAction ValidationTask resolve/delegate/add actions are validated before mutation. |\n\nIf a direct request resembles a jailbreak or credential-exfiltration attempt, the API blocks it before it reaches OpenAI.\n\nThis is a real Slack integration, not a simulator.\n\nOAuth`/api/integrations/slack/authorize` and callback token exchange. |\nEvents APISigned request verification at `/api/slack/events` . |\nWeb API`conversations.list` , `conversations.history` , `chat.postMessage` . |\nTask HarvestingSlack messages are analyzed and converted into Master To-Do items. |\n\nCreate a Slack app using [slack/slack-app-manifest.example.json](/suhasbhairav/ai-chief-of-staff/blob/master/slack/slack-app-manifest.example.json), replacing `YOUR_APP_DOMAIN.com`\n\nwith your deployed app domain.\n\nRequired Slack URLs:\n\n```\nRedirect URL: https://your-app-domain.com/api/integrations/slack/callback\nEvents URL:   https://your-app-domain.com/api/slack/events\n```\n\nRequired bot scopes:\n\n```\napp_mentions:read\nchannels:history\nchannels:join\nchannels:read\nchat:write\nchat:write.public\ngroups:history\ngroups:read\nim:history\nim:read\nim:write\nmpim:history\nmpim:read\nteam:read\nusers:read\n```\n\nRequired bot events:\n\n```\napp_mention\nmessage.channels\nmessage.groups\nmessage.im\nmessage.mpim\n```\n\nAfter install, open `/integrations`\n\nand connect Slack. Then use `/slack`\n\nfor the live workspace view, `/todo`\n\nto sync harvested commitments, and Slack DMs/app mentions to talk to Aegis from inside Slack.\n\nThis is a real Notion integration for Product OKR tracking.\n\n- Create a Notion internal integration.\n- Copy the integration secret.\n- Share your Product OKR database with that integration.\n- Copy the database ID from the Notion database URL.\n- Add the values in Vercel env vars or connect manually from\n`/integrations`\n\n. - Open\n`/departments/product`\n\nand click`Sync Notion OKRs`\n\n.\n\nRecommended database properties:\n\n```\nObjective\nKey Result\nOwner\nStatus\nProgress\nQuarter\nDue Date\nDepartment\nPriority\nConfidence\n```\n\nThe parser is flexible and also recognizes common variants like `Name`\n\n, `KR`\n\n, `DRI`\n\n, `State`\n\n, `% Complete`\n\n, `Cycle`\n\n, and `Target Date`\n\n.\n\nThis is a real HubSpot CRM integration for CEO-level deal pipeline tracking.\n\n- Create a HubSpot Private App.\n- Add CRM read scopes for deals, pipelines, and owners.\n- Copy the Private App access token.\n- Add it in Vercel env vars or connect manually from\n`/integrations`\n\n. - Open\n`/pipeline`\n\nand click`Sync HubSpot Deals`\n\n.\n\nThe pipeline dashboard tracks open pipeline, weighted forecast, next 90-day forecast, stale deals, open deal count, average deal size, pipeline by stage, pipeline by HubSpot pipeline, and top open deals.\n\nThis is a real Linear integration using Linear's official npm SDK.\n\n- Create a Linear personal API key from Linear account security settings.\n- Add it in Vercel env vars or connect manually from\n`/integrations`\n\n. - Open\n`/tickets`\n\nand click`Sync Linear Tickets`\n\n.\n\nThe ticket overview tracks open tickets, urgent issues, overdue work, stale execution, completed issues in the last 30 days, average open age, team load, priority mix, and CEO risk queue.\n\n|\n|\n\nFor the best report, upload department CSVs first and click `Fetch Suggestions`\n\nbefore exporting.\n\nCreate `frontend/.env.local`\n\nor configure the same variables in Vercel:\n\n```\nOPENAI_API_KEY=your_openai_api_key_here\nOPENAI_EMBEDDING_MODEL=text-embedding-3-small\nNEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co\nSUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_or_secret_key\nNEXT_PUBLIC_APP_URL=https://your-app-domain.com\nSLACK_CLIENT_ID=your_slack_client_id\nSLACK_CLIENT_SECRET=your_slack_client_secret\nSLACK_SIGNING_SECRET=your_slack_signing_secret\nNOTION_API_KEY=your_notion_internal_integration_secret\nNOTION_OKR_DATABASE_ID=your_product_okr_database_id\nHUBSPOT_ACCESS_TOKEN=your_hubspot_private_app_access_token\nLINEAR_API_KEY=your_linear_personal_api_key\n```\n\nDo not commit real `.env`\n\nfiles. They are ignored by `.gitignore`\n\n.\n\n```\ncd frontend\nnpm install\nnpm run dev\n```\n\nOpen:\n\n```\nhttp://localhost:3000\n```\n\nProduction check:\n\n```\ncd frontend\nnpm run lint\nnpm run build\n```\n\nThe backend is a FastAPI scaffold for CSV ingestion and validation. The current frontend primarily uses Next.js API routes for Supabase-backed JSONB storage, but the backend is available for future API-backed ingestion.\n\n```\ncd backend\npython -m venv venv\nsource venv/bin/activate\npip install fastapi uvicorn python-multipart\npython main.py\n```\n\nHealth check:\n\n```\nGET http://127.0.0.1:8000/health\n```\n\nFinanceARR, revenue growth, margin, FCF, cash, runway, burn multiple |\nSalespipeline, bookings, ARR won, win rate, quota, churn-risk ARR |\nMarketingspend, MQL, SQL, CAC, LTV, CAC payback, ROAS |\nProductactive users, activation, retention, NPS, velocity, P1 bugs |\nOperationsthroughput, demand, delivery, inventory, defects, unit cost |\nHRheadcount, attrition, eNPS, revenue per employee, time to hire |\nSupporttickets, first response, resolution time, CSAT, NPS, backlog |\nRiskrisk score, controls, audit score, mitigations, security findings |\nStrategyTAM coverage, market share, partnerships, competitive win rate |\nLegal / IT / R&Dcontracts, compliance, uptime, cloud spend, IP, experiments |\n\nThe Executive dashboard rolls up Supabase department JSON into four CEO scorecards:\n\n| Scorecard | Metrics |\n|---|---|\n| Value Creation and Cash | Rule of 40, NRR, gross margin, runway |\n| GTM Efficiency | qualified pipeline, bookings, CAC payback, win rate |\n| Customer and Product Health | 30-day retention, NPS, CSAT, activation |\n| Risk and Execution Posture | enterprise risk, audit score, on-time delivery, security incidents |\n\nThe Executive page also includes a metrics glossary so operators can understand what each metric means and how it should be interpreted.\n\n- Start at the home command center.\n- Visit each department dashboard.\n- Download the department CSV template.\n- Fill it with monthly operating data.\n- Upload the CSV.\n- Confirm charts and KPI cards update.\n- Return to Executive.\n- Review the combined scorecards.\n- Click\n`Fetch Org Suggestions`\n\n. - Open\n`/assistant`\n\nto ask CEO-level questions grounded in Supabase vector memory. - Open\n`/pipeline`\n\nto sync and inspect the HubSpot deal pipeline. - Open\n`/tickets`\n\nto sync and inspect Linear execution health. - Export a PDF report or board memo.\n- Use\n`/todo`\n\nand`/slack`\n\nto track commitments and follow-ups.\n\n```\n/                               Home command center\n/departments/executive           Executive dashboard\n/departments/finance             Finance dashboard\n/departments/sales               Sales dashboard\n/integrations                    Tool integrations hub\n/slack                           Live Slack workspace\n/todo                            Master To-Do\n/assistant                       CEO chat over Supabase vector memory\n/pipeline                        HubSpot CEO deal pipeline\n/tickets                         Linear CEO ticket overview\n/api/current-data                 Supabase JSONB store\n/api/historical-data              Supabase historical import ledger\n/api/board-memos                  Supabase board memo storage\n/api/analytics/[department]       Guarded OpenAI analysis endpoint\n/api/ceo-chat                    Retrieval planner and CEO answer agent\n/api/embeddings/rebuild          Supabase vector memory backfill\n/api/notion/okrs                 Notion Product OKR sync endpoint\n/api/hubspot/deals               HubSpot deal pipeline sync endpoint\n/api/linear/tickets              Linear ticket overview sync endpoint\n/api/integrations/slack/authorize Slack OAuth start\n/api/integrations/slack/callback  Slack OAuth callback\n/api/slack/events                 Slack Events API endpoint\n/api/slack/channels               Slack conversations.list endpoint\n```\n\n- User authentication and role-based access control\n- Department schema validation\n- Automated anomaly detection before OpenAI synthesis\n- Slack/email action routing to department owners\n- Permissioned multi-company workspaces\n- Audit log viewer for Slack events, OpenAI calls, and board memo generation\n\nThis is a completely open-source, local-first MVP of an AI operating system for company leadership. It is an independent personal project designed to be credible in front of founders, operators, investors, and technical reviewers, while remaining small enough to iterate quickly.\n\nMIT License. See [LICENSE](/suhasbhairav/ai-chief-of-staff/blob/master/LICENSE).", "url": "https://wpnews.pro/news/an-ai-chief-of-staff", "canonical_source": "https://github.com/suhasbhairav/ai-chief-of-staff", "published_at": "2026-06-28 04:32:05+00:00", "updated_at": "2026-06-28 05:04:46.089266+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-products", "ai-tools", "ai-agents", "developer-tools"], "entities": ["Suhas Bhairav", "AICoS", "Supabase", "OpenAI", "HubSpot", "Linear", "Notion", "Slack"], "alternates": {"html": "https://wpnews.pro/news/an-ai-chief-of-staff", "markdown": "https://wpnews.pro/news/an-ai-chief-of-staff.md", "text": "https://wpnews.pro/news/an-ai-chief-of-staff.txt", "jsonld": "https://wpnews.pro/news/an-ai-chief-of-staff.jsonld"}}