Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
AutoSwarm-Shadow-Adapter

AutoSwarm-Shadow-Adapter

> 后端框架
Free

Zero-modification Human-in-the-Loop adapter for OpenOPC's agentic DAG runtime.

2.0K stars0 likes5 views
WebsiteGitHub

About

Zero-modification Human-in-the-Loop adapter for OpenOPC's agentic DAG runtime.


What is AutoSwarm-Shadow-Adapter?

AutoSwarm-shadow-adapter is a high-concurrency Temporal Bridge for AutoSwarm. It allows AutoSwarm agentic DAGs to pause non-blockingly when a role requires human sign-off (Carbon) or remote GPU execution (Silicon BYOC), without causing engine timeouts or stalling parallel branches.

  1. Non-Blocking Intercept: Intercepts AutoSwarm task execution in 900s** | Engine crash (timeout failure) | **Zero timeouts (unlimited duration)** | | **System restart resilience** | State lost | **Persisted in isolated SQLite WAL DB** | | **Multi-user access control** | Local user only | **Multi-user queue with JWT auth** | | **File attachments** | Text only | **Up to 5 files, 50MB payload** | | **Audit log compliance** | Basic engine log | **Immutable timeline with user attribution** | | **Iterative rework loop** | Manual intervention | **Built-inrework_requested` state transition** |

How It Works

…

User Workflow & Execution Pipeline

  1. Task Decomposing & Assignment: When a user launches an AutoSwarm session (e.g. opc chat --mode company "Build feature X"), AutoSwarm's Manager AI creates work items and assigns them to configured role seats (e.g., senior_developer, legal_counsel).
  2. **Shadow Intercept ( Local Ollama)
bash
export OLLAMA_HOST="http://localhost:11434"
shadow-worker \
  --server-url "[http://192.168.1.100:8800](http://192.168.1.100:8800)" \
  --username "dev_node_1" \
  --password "secure_pass_1" \
  --role "senior_developer" \
  --provider "ollama" \
  --model "llama3.3:70b"

2. Remote Enterprise Server (Role: Legal Counsel -> Enterprise Claude API)

bash
export LOCAL_ANTHROPIC_KEY="sk-ant-api03-enterprise-key..."
shadow-worker \
  --server-url "[http://192.168.1.100:8800](http://192.168.1.100:8800)" \
  --username "legal_node_2" \
  --password "secure_pass_2" \
  --role "legal_counsel" \
  --provider "anthropic" \
  --model "claude-3-5-sonnet-20241022"

3. Remote Tester Machine (Role: QA Tester -> OpenAI GPT-4o)

bash
export LOCAL_OPENAI_API_KEY="sk-proj-openai-key..."
shadow-worker \
  --server-url "[http://192.168.1.100:8800](http://192.168.1.100:8800)" \
  --username "qa_node_3" \
  --password "secure_pass_3" \
  --role "qa_tester" \
  --provider "openai" \
  --model "gpt-4o"

Programmatic Python SDK Usage

You can also embed ShadowWorker into custom Python pipelines on remote nodes:

python
import asyncio
from shadow_adapter import ShadowWorker

# Custom task handler executing local agent pipeline
async def my_local_agent(task: dict) -> str:
    # Query your local GPU, private database, or custom agent model
    return f"Processed task '{task['title']}' on local node."

worker = ShadowWorker(
    server_url="[http://192.168.1.100:8800](http://192.168.1.100:8800)",
    username="custom_node_01",
    password="password123",
    role="legal_counsel",
    custom_handler=my_local_agent,
)

asyncio.run(worker.run_forever())

The Consolidated Corporate Brain (Knowledge Graph)

A real company doesn't just pass text strings—employees share documents, reports, and data. AutoSwarm-shadow-adapter acts as the Central Nervous System for your AI and Human workforce by maintaining a centralized artifact registry.

1. The Shared Artifact Registry

When a Silicon or Carbon employee finishes a task, their deliverables (PDFs, CSVs, code files) are saved to the centralized CorporateArtifacts registry. This creates an indexed, searchable corporate memory for your entire DAG.

2. Hierarchical Context Injection

The adapter dynamically parses your AutoSwarm company_config.yaml to understand your corporate hierarchy. When a downstream Manager receives a task to "Review the Analyst's work," the adapter automatically packages and injects the Analyst's upstream artifacts directly into the Manager's workspace (via the React Portal or the ShadowWorker API payload).

3. Role-Based Inheritance

Employees natively inherit the context of the workers below them. A Human Legal Director reviewing a contract doesn't just get a text summary—they are handed the exact .docx file the remote AI Drafter uploaded 5 minutes prior.


Architecture Deep-Dive

All detailed technical specifications are decoupled from this overview:

  • Architecture Specification & Implementation Contracts
  • Technical Lifecycle & Sequence Diagram
  • State Machine Integration Diagram
  • Database Schemas & Tables (shadow_tasks.db)

Configuration Reference

Variable Default Value Required Description
SHADOW_JWT_SECRET None Yes Secret key for signing JWT tokens (min 32 chars).
SHADOW_DB_PATH ./shadow_tasks.db No Path for the isolated Shadow SQLite database.
SHADOW_OPC_STORE_PATH .opc/projects/default/store.db No Path to AutoSwarm's store.db for WAL resume writes.
SHADOW_UPLOAD_DIR ./shadow_uploads No Directory for storing deliverable attachments.
SHADOW_MAX_FILES_PER_SUBMISSION 5 No Max files permitted per submission.
SHADOW_MAX_FILE_SIZE_MB 10 No Max allowed size per file in MB.
SHADOW_MAX_TOTAL_UPLOAD_SIZE_MB 50 No Max total upload payload per submission in MB.
SHADOW_API_PORT 8800 No Network port for FastAPI server and React SPA.

Development & Testing

bash
# Run full anti-fragility & host integration test suite (55 tests)
# Enforces Concurrency, Property-Based Fuzzing, Black Hole Exception Trapping, and AutoSwarm Host Mutation Survival
pytest tests/ -v --cov=shadow_adapter --cov-report=term-missing

# Run engine simulator demo
python tests/mock_AutoSwarm_engine.py

AutoSwarm-Shadow-Adapter | Non-Blocking Human-in-the-Loop Layer for AutoSwarm

GitHub Repository | PyPI Package | Issue Tracker | Architecture Spec


Thanks for visiting Build for AutoSwarm Community

> Tags

fastapihitlhuman-in-the-loop

No comments yet. Be the first to share.

> Details

PublishedOct 20, 2026
UpdatedOct 21, 2026
Category后端框架
PricingFree

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架