AI-native workspace architecture
Brain system replication blueprint
A navigable technical description of the architecture, modules, data model, agent runtime, workflows, and implementation plan for a Notion + Airtable + Google Drive replacement with first-class AI agents, skills, MCP access, shared credentials, and automation.
Executive summary
The system is best understood as an AI-native team operating system. Its core is intentionally small: pages, databases, and files. Everything else — charts, email campaigns, CRM enrichment, transcript analysis, task extraction, LP Telegram bots, DocSend-like analytics, and custom page design — is implemented as an app, skill, or agent on top of those primitives.
Architecture diagram
The architecture centers on a shared workspace graph. Humans use the web app, terminal/IDE tools use MCP, and bots/webhooks enter through the same API and event system.
Design principles
Keep only pages, databases, tables, and files in the product core. Everything else is an extension.
Email sending, chart generation, rewrite tools, enrichment, and bots should be pluggable.
Expose workspace tools to terminal agents, IDEs, Claude Code, and other MCP-compatible clients.
Use composable agents like small functions, rather than giant agents with too many responsibilities.
Users should be able to open a terminal or UI and speak naturally to the system.
The long-term goal is not more dashboards. It is less manual interaction and more observed outcomes.
Core primitives
The primitives are deliberately generic. They let the team model a CRM, deal pipeline, document room, website, internal wiki, email campaign, event guest list, or portfolio request tracker without separate tools.
Pages
Notion-like editable documents composed of blocks. Pages can contain text, headings, toggles, generated images, embedded databases, generated charts, files, email composer blocks, and custom components.
| Capability | Description |
|---|---|
| Block editor | Rich text, headings, lists, toggles, images, files, charts, database embeds. |
| AI actions | Spell check, rewrite, summarize, fact-check, generate image, generate chart from nearby data. |
| Custom design | Prompt-edit record pages into dashboards, landing pages, or custom views. |
| Version history | Track document versions and allow restore. |
| Collaboration | Presence, live editing, cursors, and conflict-safe updates. |
Databases
Airtable/Notion-like structured tables with fields, views, formulas, record pages, sensitive columns, action columns, and full cell-level history.
| Capability | Description |
|---|---|
| Field types | Text, number, select, status, date, person, email, URL, file, formula, relation, rollup, JSON, action. |
| Views | Table, kanban, calendar, gallery, list, timeline, dashboard, custom page view. |
| Formula columns | Prompt-generate formulas that can reference field values and cell history. |
| Action columns | Changing a cell to a trigger value runs an automation, such as LinkedIn enrichment. |
| Audit history | Record who changed every cell from old value to new value and when. |
Files
Google Drive-like object storage that automatically mirrors the workspace hierarchy.
Workspace
/ Pages
/ Brain demo
/ unicorn_image.png
/ Databases
/ Deals
/ Acme AI
/ pitch_deck.pdf
/ diligence_notes.md
/ founder_call_transcript.txt
A file uploaded to a page appears under that page. A file uploaded to a database record appears under that record. Permissions inherit from the linked page, record, or field.
Key modules
Page editor module
- Create folders and pages.
- Edit rich-text blocks with Notion-style interactions.
- Generate images directly inside a page.
- Convert nearby table data into editable chart blocks.
- Rewrite or summarize selected text with installed skills.
- Insert data from any database into text or email templates.
- Prompt-edit a chart: colors, labels, chart type, title, data source.
Database module
- Create and modify databases manually or by natural language through MCP.
- Support views, filters, sorts, grouping, relations, rollups, formulas, and record pages.
- Store full cell-change logs for SLA metrics and historical formulas.
- Mark fields as sensitive for obfuscation and field-level security.
- Use action columns as a no-code trigger surface for agents.
Sharing and analytics module
Replaces lightweight DocSend use cases by sharing live pages with analytics.
| Object | Purpose |
|---|---|
| ShareLink | Public/authenticated/email-gated access token for a page or file. |
| ShareVisitor | Email, browser, anonymized IP hash, first/last seen. |
| ShareEvent | Page open, block visible, scroll depth, chart interaction, file download. |
| Analytics dashboard | Visitors, time spent, engagement, downloads, link status. |
Real-time collaboration module
Use Yjs, Automerge, Liveblocks, or a custom CRDT/OT layer for live page and table editing.
- Presence indicators and cursors.
- Optimistic updates with server reconciliation.
- Conflict-safe block and cell edits.
- Incremental sync instead of full document reloads.
Data model
A practical relational model can sit in Postgres, with files in object storage and full-text/vector indexes in a dedicated search layer.
| Domain | Entities | Notes |
|---|---|---|
| Workspace | Workspace, User, Membership, Role, PermissionPolicy, AccessGrant | Central access layer reused by API, UI, MCP, and agents. |
| Pages | Page, Block, PageVersion, BlockVersion | Tree of editable blocks, versioned and collaborative. |
| Databases | Database, DatabaseField, DatabaseView, DatabaseRecord, CellValue, CellChangeLog | Tracks current values and historical cell changes. |
| Files | FileAsset, FileFolder, FileLink, FileVersion | Files linked to pages, blocks, records, and fields. |
| Agents | Agent, AgentVersion, AgentRun, AgentRunStep, AgentMemory, AgentFeedback | Small reusable agents with logs and feedback loops. |
| Skills | Skill, SkillVersion, SkillInstallation, SkillRun | Marketplace with private and workspace-shared skills. |
| Credentials | Credential, CredentialGrant, CredentialUseLog | Encrypted secrets with agent-specific grants. |
| Automation | Event, Trigger, Workflow, WorkflowRun, ScheduledJob | Every workspace change can become an event. |
| Sharing | ShareLink, ShareVisitor, ShareSession, ShareEvent | DocSend-like analytics for pages and files. |
Critical table: CellChangeLog
The system needs cell-level history because SLA metrics and formulas can depend on when values changed, not just what the current value is.
CellChangeLog - id - workspace_id - database_id - record_id - field_id - old_value_json - new_value_json - changed_by_user_id - changed_by_agent_id - changed_at - source: manual | import | agent | api | mcp - agent_run_id
Critical table: AgentRunStep
Every tool call should be traceable so a human or repair agent can understand what happened.
AgentRunStep - id - run_id - step_index - type: llm | tool | skill | decision | wait | human_approval - tool_name - input_json - output_json - status - started_at - completed_at - error_message - model - token_usage_json - credential_ids_used
Agents & skills
Skills are reusable capabilities. Agents are stateful or triggered workflows that use tools, skills, credentials, and workspace context. Both should be versioned, permissioned, and observable.
Small reusable capability: rewrite in my style, summarize, fact-check, generate chart, enrich LinkedIn profile, extract asks.
Workflow with triggers and state: transcript enricher, portfolio update importer, LP Telegram bot, Hero task bot.
Recommended agent inventory
| Agent | Trigger | Primary function |
|---|---|---|
| Guest list importer | Manual MCP command | Find event, map attendees, insert rows into a database. |
| LinkedIn enricher | Action column = Enrich | Enrich selected person rows with LinkedIn/profile data. |
| Transcript importer | Call recording completed | Store transcript in Call Transcripts database. |
| Transcript enricher | Transcript created | Extract people/companies, find context, update CRM. |
| Portfolio update importer | Email received | Detect founder updates and store them in Portfolio Updates. |
| Ask extractor | Portfolio update created | Create classified Requests from asks inside updates. |
| Request resolver | Request created | Search CRM for helpers and draft intro emails. |
| Hero task bot | Email/conversation action item | Send task to Telegram with dismiss, reassign, complete buttons. |
| LP pipeline bot | Deal status changed | Post shareable deals to Telegram with interactive buttons. |
| Housekeeping agent | Daily/weekly schedule | Find duplicate agents, stale workflows, broken links, unused skills. |
| Repair agent | Agent failure | Diagnose failed runs and propose or apply safe fixes. |
Natural-language agent builder flow
- Parse user intent from terminal, UI, or chat.
- Search existing agents, skills, databases, and credentials.
- Recommend reuse before creating a new agent.
- Create missing schema or fields when safe.
- Request or create credential authorization if required.
- Register trigger, workflow steps, tool permissions, and logging.
- Run a test on a small scope.
- Persist the workflow if the user asked for repeat behavior.
Skill marketplace behavior
| Visibility | Use case |
|---|---|
| Private | Personal writing style, private shortcuts, experimental tools. |
| Workspace | Team-approved skills available across the product. |
| Internal marketplace | Published skills that team members can install. |
| Agent-backed | A skill that calls a full agent workflow behind the scenes. |
MCP interface
MCP is the universal control plane. It lets external assistants inspect the workspace, use skills, create databases, register automations, and operate with explicit permissions.
| MCP tool | Purpose |
|---|---|
brain.search | Search pages, records, files, agents, skills, and schemas. |
brain.create_page | Create a page or folder. |
brain.update_page | Patch blocks, insert generated content, update custom design. |
brain.create_database | Create a database with fields and default views. |
brain.add_database_field | Add normal, formula, relation, sensitive, or action fields. |
brain.query_records | Read records with filters, sorting, and field-level permission checks. |
brain.update_record | Update row values and write cell-change logs. |
brain.run_skill | Run an installed skill against selected text, records, files, or JSON. |
brain.create_agent | Create a new agent after checking for reusable existing agents. |
brain.create_credential_request | Request OAuth/API-key authorization for an integration. |
User: Add a column called Action. When the value changes to Enrich,
enrich the corresponding row with LinkedIn data.
MCP client:
1. brain.search databases "guest list"
2. brain.add_database_field(type="action", name="Action")
3. brain.search skills "LinkedIn enrichment"
4. brain.create_agent(trigger="cell_changed", condition="Action == Enrich")
5. brain.run_agent(test_record_id=...)
Reference workflows
Workflow 1 — Event guest list import
- User creates a
Brain demo guest listdatabase with name and email fields. - User marks name/email as sensitive.
- User asks an MCP-connected assistant to import the event guest list.
- Agent searches the event platform, maps attendee data, and inserts records.
- Optional: user adds an Action column for enrichment.
Workflow 2 — LinkedIn enrichment action column
- Cell changes to
Enrich. - Automation engine emits
cell.changed. - LinkedIn enrichment agent loads row data.
- Credential vault provides approved enrichment credential.
- Agent writes LinkedIn URL, title, company, bio, and status.
- Agent sets Action to
Enrichedand logs the run.
Workflow 3 — Transcript enrichment and CRM update
- Recorded call transcript is stored in Call Transcripts.
- Agent extracts company names, people names, and action items.
- Agent searches historical emails for context: how we met, who introduced us, last interaction.
- Agent enriches people with LinkedIn and event-platform data.
- Agent updates People, Companies, Relationship Context, and Tasks databases.
Workflow 4 — Portfolio update to intro draft
- Email agent detects a founder update from a portfolio company.
- Update is stored in Portfolio Updates.
- Ask extractor creates Requests for help asks.
- Classifier assigns request type and owner.
- Resolver searches CRM for relevant helpers.
- Email agent drafts an introduction email in the right team member's inbox.
Workflow 5 — Hero Bot task management
- Task extractor reads emails and internal conversation transcripts.
- Likely action items become Task records.
- Telegram bot sends a task card with buttons: dismiss, reassign, complete.
- Dismissed tasks are treated as negative examples.
- Weekly learning job updates rules to avoid repeated false positives.
Workflow 6 — Mailchimp-like email campaign
- User writes an email inside a page.
- User inserts variables from a database.
- User selects sender account and recipient database.
- System sends individual emails, not CC, with throttling.
- Send logs are written back to the workspace.
Feature matrix
| Area | Must-have features | Differentiating features |
|---|---|---|
| Pages | Block editor, rich text, nested pages, images, files | Prompt-generated charts, AI rewrite, custom page design, version history |
| Databases | Fields, rows, views, record pages, filters, sorts | Cell audit history, prompt formulas, sensitive fields, action columns |
| Files | Upload, preview, folders, permissions | Auto folders from pages and records, extracted text, dedupe, linked objects |
| Search | Keyword search across workspace | Semantic search, permission-aware indexing, instant table search |
| Sharing | Public/authenticated links | Email-gated links, visitor analytics, time spent, DocSend replacement |
| Skills | Run reusable prompt/tool actions | Marketplace, private/team publishing, skills available everywhere |
| Agents | Manual runs and scheduled jobs | Natural-language creation, event triggers, feedback learning, repair agents |
| Credentials | Store OAuth/API keys | Shared team credentials, per-agent grants, secret redaction, usage logs |
| Communication | Email draft/send, Telegram messages | Mail merge from databases, intro drafts, LP deal bot, Hero task bot |
| Governance | Audit logs and permissions | Housekeeping, security hygiene, cost hygiene, schema hygiene agents |
Security, permissions, and safety
Because the system touches emails, transcripts, CRM data, outbound communications, and shared credentials, agents must be permissioned and auditable by design.
Mark columns such as names, emails, deal terms, LP names, and financials as sensitive.
One-click screen-sharing mode masks sensitive values across pages, databases, files, and analytics.
Agents receive explicit tool and credential grants, not universal workspace access.
Risky actions that should require approval
Audit log requirements
- Who or what triggered the action.
- Which records, pages, files, and credentials were accessed.
- Which model and prompt version were used.
- What the agent changed.
- Whether a human approved the action.
- Errors, retries, cost, and token usage.
Suggested implementation stack
The transcript does not specify all implementation choices, so this is a practical stack for building a similar system.
| Layer | Recommendation | Reason |
|---|---|---|
| Frontend | Next.js, React, TypeScript | Strong ecosystem for editor, table, dashboard, and app shell. |
| Editor | Tiptap/ProseMirror or Lexical | Composable block editor foundation. |
| Tables | TanStack Table + virtualization | Fast database rendering with large tables. |
| Collaboration | Yjs, Automerge, or Liveblocks | CRDT/OT collaboration for pages and tables. |
| Backend | Node.js/Fastify/NestJS or Python/FastAPI | TypeScript fits frontend; Python fits agent-heavy services. |
| Primary DB | PostgreSQL | Workspace graph, schemas, permissions, logs. |
| Files | S3, GCS, or Cloudflare R2 | Durable object storage for uploads and generated artifacts. |
| Search | Meilisearch, Typesense, OpenSearch, pgvector, or Qdrant | Keyword plus semantic search. |
| Queues | Temporal, BullMQ, Celery, or Cloud Tasks | Long-running agent workflows and reliable retries. |
| LLM gateway | OpenAI, Anthropic, Gemini behind one internal gateway | Model routing, structured outputs, cost tracking, retries. |
| MCP | TypeScript or Python MCP server | Expose Brain tools to any MCP-compatible client. |
Performance techniques
- Virtualized table rows and columns.
- Server-side pagination and cursor queries.
- Precomputed view indexes for common filters and sorts.
- Incremental block loading for long pages.
- Optimistic UI updates with WebSocket patch sync.
- Separate search index for full-text and semantic retrieval.
- Background formula recalculation and materialized fields.
Build roadmap
Auth, workspaces, users, roles, sidebar, pages, basic block editor, simple database tables, file uploads.
Field types, views, record pages, file fields, auto file hierarchy, sensitive fields, cell-change history.
Public links, authenticated links, email-gated links, visitor tracking, version history, restore.
Spell check, rewrite, summarize, fact-check, generate image, generate charts, prompt formulas.
MCP server, tool registry, credential vault, skills registry, agent runs, logs, database action triggers.
Gmail, calendar, transcript ingestion, event guest lists, LinkedIn enrichment, CRM auto-update.
Email composer, database mail merge, intro drafts, Telegram bot framework, LP bot, Hero Bot.
Housekeeping, repair, security hygiene, cost hygiene, schema hygiene, and agent-reuse checks.
Example schemas
Database schema: People
| Field | Type | Notes |
|---|---|---|
| Name | text | Sensitive in screen-share mode. |
| Sensitive; used for matching and campaigns. | ||
| Company | relation | Links to Companies database. |
| LinkedIn URL | url | Filled by enrichment agent. |
| Role | text | Current title or role. |
| Source | select | Email, calendar, event, manual, transcript, import. |
| Last Interaction | date | Derived from emails, calendar, transcripts. |
| Relationship Context | relation | Links to interaction/context records. |
| Action | action | Enrich, draft intro, add to CRM, verify. |
Database schema: Requests
| Field | Type | Notes |
|---|---|---|
| Request | rich_text | Extracted from founder update or conversation. |
| Company | relation | Portfolio or deal company. |
| Requester | relation | Founder/person who asked. |
| Type | select | Hiring, sales intro, fundraising, PR, legal, partnership. |
| Owner | person | Assigned by classifier. |
| Status | status | New, triaged, in progress, waiting, done. |
| Suggested Helpers | relation | CRM contacts found by resolver agent. |
| Draft Email | file/page/ref | Link to generated intro draft. |
Automation definition: action column enrichment
{
"name": "Guest List LinkedIn Enrichment",
"trigger": {
"type": "database.cell_changed",
"database": "Brain demo guest list",
"field": "Action",
"new_value": "Enrich"
},
"permissions": {
"read_fields": ["Name", "Email", "Company"],
"write_fields": ["LinkedIn URL", "Role", "Company", "Bio", "Action"],
"credentials": ["linkedin_enrichment_provider"]
},
"steps": [
{"type": "load_record"},
{"type": "run_skill", "skill": "linkedin_enrich_person"},
{"type": "update_record"},
{"type": "set_field", "field": "Action", "value": "Enriched"},
{"type": "write_audit_log"}
]
}
Formula example: SLA emoji
if(
hours_since(last_changed("Stage")) > prop("SLA Hours"),
"🟢 SLA exceeded",
"⚪ Within SLA"
)
The exact syntax can vary, but the formula engine needs functions that reference historical cell changes.
Final implementation note
The fastest path is not to clone every Notion, Airtable, Google Drive, Mailchimp, and DocSend feature at once. Build the three primitives, expose them through a strong API and MCP, then let skills and small agents compose the domain-specific workflows. That is the architectural move that makes the system powerful.