Skip to content

feat(hub): add Agent Hub — cross-agent context sharing via /save, /hu…#46

Open
yuanguangshan wants to merge 1 commit intofastclaw-ai:mainfrom
yuanguangshan:feat/hub-pipe-system
Open

feat(hub): add Agent Hub — cross-agent context sharing via /save, /hu…#46
yuanguangshan wants to merge 1 commit intofastclaw-ai:mainfrom
yuanguangshan:feat/hub-pipe-system

Conversation

@yuanguangshan
Copy link
Copy Markdown

…b, /hub pipe

Implements the Agent Hub system: a filesystem-based shared blackboard that lets multiple AI agents collaborate by exchanging intermediate results through a common context store.

New Commands

/save — save agent replies to Hub

/save Send to agent, save reply to Hub
/save Save last agent reply directly to Hub
/save @claude filename msg Target a specific agent

/hub — inject shared context into agent

/hub List hub files
/hub ls Detailed listing with numbered index
/hub cat Read file by number
/hub Inject all hub context, send to agent
/hub Inject specific file, send to agent
/hub clear Delete all hub files

/hub pipe — chain agents automatically

/hub pipe Default agent → save → target agent
/hub pipe @ Use hub file #n as input
/hub pipe @-1 Use latest hub file as input
/hub pipe @ Partial filename match

Design

  • Pure Go, zero new dependencies
  • Storage: ~/.weclaw/hub/shared/ (Markdown + YAML frontmatter)
  • Thread-safe: sync.RWMutex on Hub struct
  • Session isolation: hub:: conversationID prevents cross-contamination of default chat sessions
  • Agents are instructed to return raw content, not create files

Files

  • hub/hub.go: Hub core — Save, ReadAll, ReadSpecific, List,
    ListWithInfo, FindByPartialName, Clear, Exists
  • hub/hub_test.go: 11 unit tests (all passing)
  • docs/agent-hub-design.md: Architecture design document
  • messaging/handler.go: /save, /hub, /hub pipe command integration

Example Workflow

/save round1.md Analyze AI agents from a philosophical angle /hub pipe gemini @1 Continue with a technical feasibility critique /hub pipe claude @-1 Synthesize both perspectives

…b, /hub pipe

Implements the Agent Hub system: a filesystem-based shared blackboard
that lets multiple AI agents collaborate by exchanging intermediate
results through a common context store.

## New Commands

### /save — save agent replies to Hub
  /save <filename> <message>   Send to agent, save reply to Hub
  /save <filename>             Save last agent reply directly to Hub
  /save @claude filename msg   Target a specific agent

### /hub — inject shared context into agent
  /hub                         List hub files
  /hub ls                      Detailed listing with numbered index
  /hub cat <n>                 Read file by number
  /hub <message>               Inject all hub context, send to agent
  /hub <filename> <message>    Inject specific file, send to agent
  /hub clear                   Delete all hub files

### /hub pipe — chain agents automatically
  /hub pipe <agent> <message>       Default agent → save → target agent
  /hub pipe <agent> @<n> <message>  Use hub file #n as input
  /hub pipe <agent> @-1 <message>   Use latest hub file as input
  /hub pipe <agent> @<name> <msg>   Partial filename match

## Design

- Pure Go, zero new dependencies
- Storage: ~/.weclaw/hub/shared/ (Markdown + YAML frontmatter)
- Thread-safe: sync.RWMutex on Hub struct
- Session isolation: hub:<agent>:<userID> conversationID prevents
  cross-contamination of default chat sessions
- Agents are instructed to return raw content, not create files

## Files

- hub/hub.go:          Hub core — Save, ReadAll, ReadSpecific, List,
                       ListWithInfo, FindByPartialName, Clear, Exists
- hub/hub_test.go:     11 unit tests (all passing)
- docs/agent-hub-design.md: Architecture design document
- messaging/handler.go: /save, /hub, /hub pipe command integration

## Example Workflow

  /save round1.md  Analyze AI agents from a philosophical angle
  /hub pipe gemini @1  Continue with a technical feasibility critique
  /hub pipe claude @-1  Synthesize both perspectives
@yuanguangshan yuanguangshan force-pushed the feat/hub-pipe-system branch from aba3aef to f479745 Compare April 4, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant