Hello, Agent Intelligence

Example schemas for agent mail and orchestration on VibeSQL.

Prefer the terminal? vsql is the open-source command-line client for VibeSQL.

The step-by-step agent demo is being revised. To start: install vsql, then use the schemas below.

Agent Mail Schema

An example agent mail schema: 10 tables, 14 indexes.

erDiagram
    agents {
        serial id PK
        text name UK
        text display_name
        text role
        jsonb expertise_json
        boolean is_active
        timestamptz created_at
    }

    teams {
        serial id PK
        text name UK
        text description
    }

    team_members {
        serial id PK
        integer team_id FK
        integer agent_id FK
    }

    projects {
        serial id PK
        text name
        text description
        text status
    }

    kanban_boards {
        serial id PK
        text name
        integer project_id FK
    }

    kanban_columns {
        serial id PK
        integer board_id FK
        text name
        integer position
    }

    kanban_cards {
        serial id PK
        integer column_id FK
        text title
        text description
        integer assigned_agent_id FK
    }

    messages {
        serial id PK
        integer from_agent_id FK
        text thread_id
        text subject
        text body
        text importance
        timestamptz created_at
    }

    inbox {
        serial id PK
        integer message_id FK
        integer agent_id FK
        text recipient_type
        timestamptz read_at
    }

    settings {
        text key PK
        text value
    }

    agents ||--o{ team_members : "belongs to"
    teams ||--o{ team_members : "has"
    agents ||--o{ messages : "sends"
    agents ||--o{ inbox : "receives"
    messages ||--o{ inbox : "delivered to"
    agents ||--o{ kanban_cards : "assigned"
    projects ||--o{ kanban_boards : "tracked on"
    kanban_boards ||--o{ kanban_columns : "has"
    kanban_columns ||--o{ kanban_cards : "contains"
                

Agent Orchestration

The schema above isn't just mail — it's the persistence layer for full agent workflows. Here's how it maps to orchestration patterns like Pi subagents.

graph LR
    subgraph Chain["Sequential Chain"]
        direction LR
        S[Scout] -->|context.md| P[Planner]
        P -->|plan.md| W[Worker]
        W -->|progress.md| R[Reviewer]
    end

    subgraph Parallel["Parallel Execution"]
        direction TB
        W1[Worker 1
Auth module] W2[Worker 2
API layer] W3[Worker 3
UI components] end subgraph VibeSQL["VibeSQL Persistence"] direction TB AG[(agents)] MSG[(messages)] KB[(kanban_boards)] TM[(teams)] end Chain --> MSG Parallel --> MSG Chain --> KB Parallel --> KB style Chain fill:#1e1b4b,stroke:#6d28d9,color:#e2e8f0 style Parallel fill:#0c2a3e,stroke:#06b6d4,color:#e2e8f0 style VibeSQL fill:#1a1229,stroke:#7c3aed,color:#e2e8f0 style S fill:#0d3321,stroke:#22c55e,color:#22c55e style P fill:#1e1b4b,stroke:#a78bfa,color:#a78bfa style W fill:#1e293b,stroke:#3b82f6,color:#3b82f6 style R fill:#2a1215,stroke:#f472b6,color:#f472b6 style W1 fill:#1e293b,stroke:#3b82f6,color:#3b82f6 style W2 fill:#1e293b,stroke:#3b82f6,color:#3b82f6 style W3 fill:#1e293b,stroke:#3b82f6,color:#3b82f6 style AG fill:#1a1229,stroke:#a78bfa,color:#a78bfa style MSG fill:#1a1229,stroke:#a78bfa,color:#a78bfa style KB fill:#1a1229,stroke:#a78bfa,color:#a78bfa style TM fill:#1a1229,stroke:#a78bfa,color:#a78bfa
Chains

Sequential Pipelines

Scout gathers context, Planner designs the approach, Worker executes, Reviewer validates. Each step's output becomes the next step's input — all persisted as messages with thread IDs.

messages.thread_id = "chain-run-001"
messages.from_agent_id → scout, planner, worker
Parallel

Concurrent Workers

Multiple agents work simultaneously on different parts of the same project. Kanban cards track assignment and progress. Messages carry results between parallel branches.

kanban_cards.assigned_agent_id → worker_1
kanban_cards.column_id → In Progress
Async

Durable State

Agent status, execution progress, and completion events — all queryable with SQL instead of polling flat files. Any agent can check any other agent's progress in real time.

agents.last_active_at → NOW()
inbox WHERE read_at IS NULL → pending
Scout
Fast recon & context
Planner
Design & architecture
Worker
Execute & build
Reviewer
Validate & improve
VibeSQL replaces flat files with queryable state. Instead of status.json and events.jsonl, agent progress lives in PostgreSQL — joinable, indexable, and accessible to every agent on the team. Chains become message threads. Parallel task status becomes kanban columns. Async polling becomes SELECT * FROM inbox WHERE read_at IS NULL.

Ready to go deeper?

Explore the full platform — from the local tools to Server.