Views
No views yet
| Layer | Modules | Description |
|---|---|---|
| Token Engine | tracker, budget, calculator | Real-time token counting, budget enforcement, cost estimation |
| Model Runtime | router, fallback, optimizer, circuit_breaker, ollama, llama_cpp | Multi-backend routing, fallback chains, quantization, fault-tolerant circuit breaker |
| Agent Framework | partition, pool, planner, cleanup, roi, task_delegator | Isolated memory partitions, shared pool, ROI tracking, intelligent task delegation |
| Orchestration | registry, state_machine, intent_router, tool_registry, context_bus | Agent discovery & health check, task lifecycle state machine, intent routing, universal tool registry, cross-agent Pub/Sub bus |
| Team Orchestration | manager, orchestrator, runtime | DAG-based task decomposition, agent lifecycle, parallel execution |
| Context Pipeline | compressor, summarizer, truncator, window, scorer | Context window management, compression, relevance scoring |
| Bayesian Reasoning | cognitive_enhancer, pipeline, langgraph_adapter | Dual-path (SDK/fallback) query, confidence calibration, feedback loops |
| Platform Integration | 10+ adapters (WeChat, DingTalk, Feishu, Telegram, Discord, Slack...) | Webhook + async reply message processing, MCP protocol bridge (6000+ apps) |
| Lifecycle Hooks | registry, notification, session, pre_tool_use, bayesian_hooks | Non-invasive hook system for tool interception, notifications, feedback |
| Skill System | parser, loader, executor | SKILL.md parsing, skill discovery, sandboxed execution |
| Multimodal | analyzer, compressor | Image/audio token counting and compression |
pip install su-skyclaw1# Ollama local model support
2pip install "su-skyclaw[ollama]"
3
4# Full installation (all extras)
5pip install "su-skyclaw[all]"1from su_memory_agent.agent import AgentMemoryPartition, Memory
2from su_memory_agent.team import TeamManager, TeamOrchestrator
3
4# Create an agent team
5manager = TeamManager()
6orchestrator = TeamOrchestrator(manager)
7
8# Decompose and execute a complex task
9results = await orchestrator.execute("分析最近一周的销售数据并生成报告")
10print(results)1from su_memory_agent.bayesian import BayesianPipeline
2
3pipeline = BayesianPipeline()
4
5result = await pipeline.enhance("agent-1", "What is the ROI of campaign X?")
6print(result.bayesian)
7
8# Check pipeline health
9print(pipeline.health_report())1from su_memory_agent.agent import TaskDelegator, DelegationTask
2from su_memory_agent.team import TeamManager
3
4manager = TeamManager()
5delegator = TaskDelegator(manager)
6
7task = DelegationTask(
8 description="分析市场趋势",
9 required_role="explorer",
10 priority=3,
11)
12result = await delegator.delegate(task)
13print(f"Task assigned to: {result.agent_id}")1from su_memory_agent.model import ModelCircuitBreaker, CircuitBreakerConfig
2
3cb = ModelCircuitBreaker(
4 adapter=my_adapter,
5 model_name="gpt-4o",
6 config=CircuitBreakerConfig(failure_threshold=3, cooldown_seconds=30),
7)
8
9try:
10 result = await cb.call("Explain quantum mechanics")
11except CircuitBreakerOpenError:
12 # Circuit is open — use cached response or fallback
13 pass1from su_memory_agent.platforms import PlatformRouter
2from su_memory_agent.platforms.telegram import TelegramAdapter
3
4router = PlatformRouter()
5router.register(TelegramAdapter(bot_token="YOUR_BOT_TOKEN"))
6
7# Handle incoming webhook
8response = await router.handle_webhook("telegram", webhook_data)┌──────────────────────────────────────────────────────────────────┐
│ su-skyclaw │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│ │ Token │ │ Model │ │ Context Pipeline │ │
│ │ Engine │ │ Runtime │ │ (compress/trunc) │ │
│ └────┬─────┘ └────┬─────┘ └────────┬─────────┘ │
│ │ │ │ │
│ ┌────▼──────────────▼─────────────────▼─────────┐ │
│ │ Agent Framework │ │
│ │ partition · pool · planner · task_delegator │ │
│ └────────────────────┬──────────────────────────┘ │
│ │ │
│ ┌────────────────────▼──────────────────────────┐ │
│ │ Orchestration Layer │ │
│ │ AgentRegistry · TaskStateMachine │ │
│ │ IntentRouter · ToolRegistry · CrossContextBus │ │
│ └────────────────────┬──────────────────────────┘ │
│ │ │
│ ┌────────────────────▼──────────────────────────┐ │
│ │ Team Orchestration │ │
│ │ manager · orchestrator · runtime (DAG) │ │
│ └────────────────────┬──────────────────────────┘ │
│ │ │
│ ┌────────────────────▼──────────────────────────┐ │
│ │ Platform Integration │ │
│ │ WeChat · Telegram · Discord · Slack · MCP │ │
│ └────────────────────────────────────────────────┘ │
│ │
│ su-skyclaw SDK (Memory Engine) │
│ Vector Retrieval · Graph Store · Spatiotemporal Index │
└──────────────────────────────────────────────────────────────────┘| Module | Description |
|---|---|
| AgentRegistry | Agent 注册/发现/健康检查中心,替代硬编码 agent_capabilities 字典 |
| TaskStateMachine | 任务生命周期状态机,7 状态(PENDING→RUNNING→WAITING→COMPLETED/FAILED/SKIPPED),支持超时检测与级联失败传播 |
| IntentRouter | 中英文关键词 + 语义意图路由,将用户输入分发到匹配的 Agent |
| ToolRegistry | 通用工具注册中心,支持 register/unregister/get/list_by_category + OpenAI function calling schema 生成 |
| CrossContextBus | 跨 Agent Pub/Sub 上下文消息总线,Agent 发布上下文更新,其他 Agent 按主题订阅 |
| BuiltinTools | 内置工具集(echo / read_file / write_file / list_dir) |
| CrewAIToolBridge | CrewAI 工具 → ToolRegistry 桥接适配器 |
| MCPToolBridge | 6000+ MCP 工具延迟注册桥接 |
pip install su-skyclaw[ollama])pip install su-skyclaw[llama-cpp])pip install su-skyclaw[multimodal])pip install su-skyclaw[agent])1# Install dev dependencies
2pip install -e ".[dev]"
3
4# Run tests
5pytest tests/ -q
6
7# Lint
8ruff check src/su_memory_agent/
9
10# Type check
11mypy src/su_memory_agent/