Documentation/Shared Workspace
v2.0.0-beta.1Snapshot bebdcd1Markdown ↗

Shared Workspace

Shared Workspace

The Shared Workspace store enables multi-agent coordination by providing a shared, versioned key-value space that multiple agents can read from and write to.

Setup

typescript
const agent = Agent.create({
  connector: 'openai',
  model: 'gpt-4.1',
  context: {
    model: 'gpt-4.1',
    features: { sharedWorkspace: true },
  },
});

Entry Model

Each workspace entry has richer metadata than other stores:

typescript
interface WorkspaceEntry {
  key: string;
  content?: string;           // Inline text content (for collaborative documents)
  references?: string[];      // External pointers: file paths, DB IDs, URLs
  summary: string;            // Human-readable summary (always required)
  status?: string;            // e.g., "draft", "final", "in-review"
  author?: string;            // Agent or user who wrote it
  version: number;            // Auto-incremented on each update
  tags?: string[];            // Categorization tags
  createdAt: number;
  updatedAt: number;
}

Usage

jsonc
// Store a workspace entry
{
  "name": "store_set",
  "arguments": {
    "store": "workspace",
    "key": "research_findings",
    "data": {
      "summary": "Analysis of competitor pricing models",
      "content": "Competitors: ...\nInsights: ...",
      "status": "draft",
      "tags": ["research", "pricing"],
      "references": ["market_data"]
    }
  }
}

// Get a specific entry
{
  "name": "store_get",
  "arguments": {
    "store": "workspace",
    "key": "research_findings"
  }
}

// List entries (with optional filter)
{
  "name": "store_list",
  "arguments": {
    "store": "workspace",
    "filter": { "tags": ["research"], "status": "draft" }
  }
}

Workspace-Specific Actions

The workspace store supports additional actions via store_action:

Action Params Description
log { message, author? } Append a log entry (for coordination/debugging)
history { limit? } Get recent entries from the shared team log (default limit: 20)
archive { key } Archive an entry (soft-delete)
clear { confirm: true } Clear all entries
jsonc
// Log a coordination message
{
  "name": "store_action",
  "arguments": {
    "store": "workspace",
    "action": "log",
    "params": { "message": "Starting phase 2 of analysis", "author": "researcher" }
  }
}

// Get recent team log entries
{
  "name": "store_action",
  "arguments": {
    "store": "workspace",
    "action": "history",
    "params": { "limit": 20 }
  }
}

Multi-Agent Example

typescript
// Documentation check: complete example
import { Agent, Connector, Vendor, SharedWorkspacePluginNextGen } from 'oneringai';

Connector.create({
  name: 'openai', vendor: Vendor.OpenAI,
  auth: { type: 'api_key', apiKey: process.env.OPENAI_API_KEY! },
});
const workspace = new SharedWorkspacePluginNextGen();

// Register one actual board with both contexts; enabling two separate plugins would not share state.
const researcher = Agent.create({
  connector: 'openai',
  model: 'gpt-4.1',
  instructions: 'You are a research agent. Store findings in the workspace.',
  context: { model: 'gpt-4.1', features: { sharedWorkspace: false } },
});

const writer = Agent.create({
  connector: 'openai',
  model: 'gpt-4.1',
  instructions: 'You are a writing agent. Read findings from workspace and write reports.',
  context: { model: 'gpt-4.1', features: { sharedWorkspace: false } },
});

researcher.context.registerPlugin(workspace);
writer.context.registerPlugin(workspace);

// Researcher stores findings
await researcher.run('Research AI trends for 2026');
// Agent calls: store_set("workspace", "ai_trends", { summary: "Key AI trends...", content: {...} })

// Writer reads findings and writes report
await writer.run('Write a report based on the workspace findings');
// Agent calls: store_get("workspace", "ai_trends"), then produces a report

The shared board is in-process state, not automatic database synchronization. Coordinate the participating contexts as one lifecycle and do not destroy a shared plugin while another agent still needs it. createOrchestrator() owns this wiring.

Documentation snapshot · 2026-11-02Suggest a correction ↗

Search documentation

Type to search the v2 documentation.