← 返回
数据分析 中文

Nanobot Overstory Bridge

Seamless bidirectional bridge between nanobot (Ollama Mistral orchestrator) and overstory (Claude Code agent swarm). Routes tasks through the OverClaw gatewa...
在 nanobot(Ollama Mistral 编排器)与 overstory(Claude Code 智能体集群)之间建立无缝双向桥接,通过 OverClaw 网关路由任务。
runeweaverstudios
数据分析 clawhub v1.1.0 1 版本 99848.5 Key: 无需
★ 0
Stars
📥 659
下载
💾 18
安装
1
版本
#latest

概述

OverClaw Bridge (nanobot-overstory)

The critical integration layer in the OverClaw stack. Connects nanobot (lightweight AI backend powered by Ollama Mistral) to overstory (Claude Code agent swarm system) through the OverClaw HTTP gateway on port 18800. nanobot handles task intake and orchestration; overstory handles all subagent creation, coordination, worktree management, and execution.

Architecture

┌─────────────────────────────────────────────────────────────┐
│                        nanobot                              │
│  (Ollama Mistral orchestrator — task intake & routing)      │
└──────────────────────┬──────────────────────────────────────┘
                       │  task_router.py
                       │  (classify → capability → overstory format)
                       ▼
┌─────────────────────────────────────────────────────────────┐
│              nanobot-overstory Bridge                        │
│                                                             │
│  ┌──────────────┐  ┌────────────────┐  ┌────────────────┐  │
│  │ task_router   │  │ session_bridge │  │ memory_sync    │  │
│  │ .py           │  │ .py            │  │ .py            │  │
│  │               │  │                │  │                │  │
│  │ route_task()  │  │ create_mapping │  │ sync_to_over() │  │
│  │ translate()   │  │ get_agent()    │  │ sync_from()    │  │
│  │ capability()  │  │ cleanup()      │  │ prune()        │  │
│  └──────┬───────┘  └───────┬────────┘  └───────┬────────┘  │
│         │                  │                    │           │
│         └──────────┬───────┴────────────────────┘           │
│                    │                                        │
│           overstory_client.py                               │
│           (subprocess wrapper around `overstory` CLI)       │
└────────────────────┬────────────────────────────────────────┘
                     │
                     ▼
┌─────────────────────────────────────────────────────────────┐
│                       overstory                             │
│  (Claude Code agent swarm — subagent lifecycle & execution) │
│                                                             │
│  coordinator → supervisor → agents (worktrees)              │
│  mail system, merge, inspect, status                        │
└─────────────────────────────────────────────────────────────┘

Components

overstory_client.py

Python wrapper around the overstory CLI binary. Provides a clean OverstoryClient class with methods for every overstory operation: sling, status, inspect, mail_send, mail_read, coordinator_start, supervisor_start, merge, and list_agents.

task_router.py

Translates nanobot task descriptions into overstory-compatible formats. Maps task intent to overstory capabilities:

Task PatternCapability
------
Research, trends, analysisresearcher
Social media, posting, tweetssocial-media-manager
Blog, article, contentblogger
Code, build, fix, implementbuilder
Explore, find, searchscout
Logs, memory, notesscribe
Review, mergereviewer

session_bridge.py

Maintains a persistent mapping between nanobot session IDs and overstory agent names. Uses SQLite at ~/.nanobot/session_bridge.db for thread-safe, persistent storage. Supports stale mapping cleanup.

memory_sync.py

Bidirectional memory synchronization. Pushes nanobot's MEMORY.md context to overstory agents before task execution, and pulls agent insights back into nanobot's memory after completion.

Usage

From Python

from overstory_client import OverstoryClient
from task_router import TaskRouter
from session_bridge import SessionBridge
from memory_sync import MemorySync

client = OverstoryClient()
router = TaskRouter(client)
bridge = SessionBridge()
memory = MemorySync()

# Route a task from nanobot to overstory
result = router.route_task("Research trending AI papers this week")
# result: {"capability": "researcher", "agent_name": "researcher-abc123", ...}

# Check agent status
status = client.status("researcher-abc123")

# Send inter-agent mail
client.mail_send("coordinator", "researcher-abc123", "Priority update needed")

# Sync memory before/after
memory.sync_to_overstory()
memory.sync_from_overstory({"insight": "Found 3 key papers on reasoning"})

From CLI

# Route a task
python3 scripts/task_router.py route --task "Build a REST API for the dashboard" --json

# Check overstory status
python3 scripts/overstory_client.py status --json
python3 scripts/overstory_client.py status --agent researcher-abc123 --json

# Spawn an agent
python3 scripts/overstory_client.py sling \
  --capability builder \
  --name "api-builder" \
  --description "Build REST API for dashboard" --json

# Sync memory
python3 scripts/memory_sync.py sync --direction to_overstory --json
python3 scripts/memory_sync.py sync --direction from_overstory --json

# List session mappings
python3 scripts/session_bridge.py list --json

# Clean up stale mappings
python3 scripts/session_bridge.py cleanup --max-age 24 --json

Requirements

  • Python 3.9+
  • overstory CLI installed and on PATH (or set OVERSTORY_BIN env var)
  • OverClaw gateway running on port 18800 (scripts/start-overclaw.sh)
  • Ollama with Mistral model
  • SQLite3 (bundled with Python)

Environment Variables

VariableDefaultDescription
---------
NANOBOT_GATEWAY_URLhttp://localhost:18800OverClaw gateway URL
OVERCLAW_PORT18800OverClaw gateway port
OVERSTORY_BINoverstoryPath to overstory binary
NANOBOT_WORKSPACE/Users/ghost/.openclaw/workspaceWorkspace root
NANOBOT_SKILLS_DIR/skillsSkills directory
NANOBOT_MEMORY_PATH/MEMORY.mdPath to MEMORY.md
SESSION_BRIDGE_DB~/.nanobot/session_bridge.dbSession mapping database
BRIDGE_LOG_LEVELINFOLogging verbosity

> Note for existing nanobot/OpenClaw users: OverClaw runs on port 18800, separate from the legacy OpenClaw gateway (18789) and nanobot default (18790). No conflicts.

Integration Flow

  1. nanobot receives task from user via TUI/API
  2. task_router classifies the task and determines the overstory capability
  3. session_bridge creates a mapping between nanobot session and upcoming overstory agent
  4. memory_sync pushes relevant context to overstory
  5. overstory_client spawns the agent via overstory sling
  6. overstory manages the agent lifecycle (worktree, execution, mail)
  7. On completion, overstory_client retrieves results via inspect/status
  8. memory_sync pulls insights back into nanobot memory
  9. session_bridge marks the mapping as completed
  10. nanobot delivers the result to the user

版本历史

共 1 个版本

  • v1.1.0 当前
    2026-03-30 04:45 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Agent Swarm

runeweaverstudios
必须使用 OpenRouter。将任务路由至合适模型,并始终通过 sessions_spawn 委派工作。
★ 4 📥 3,609
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 198 📥 65,129
data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 165 📥 60,029