Build multi-agent systems and swarms on AINative. Use when (1) Orchestrating multiple specialized AI agents, (2) Dispatching tasks to OpenClaw agents (aurora, sage, nova, atlas, etc.), (3) Implementing agent-to-agent communication via ACP, (4) Building autonomous workflows with agent handoffs, (5) Collecting RLHF feedback for agent improvement. Closes #1524.
AINative 使用 OpenClaw 作为其本地智能体网关。共有 9 个专业智能体可用:
| 智能体 | ID | 专长 |
|---|---|---|
| 主智能体 | main | 编排、路由、默认 |
| Atlas Redwood |
bash
bash
bash
构建自己的智能体来调用 AINative API:
python
import requests
class AINativeAgent:
def init(self, apikey: str, systemprompt: str):
self.apikey = apikey
self.systemprompt = systemprompt
self.messages = []
def think(self, user_input: str) -> str:
self.messages.append({role: user, content: user_input})
resp = requests.post(
https://api.ainative.studio/v1/public/chat/completions,
headers={X-API-Key: self.api_key},
json={
model: claude-3-5-sonnet-20241022,
messages: [
{role: system, content: self.system_prompt},
*self.messages
],
max_tokens: 2048,
}
).json()
reply = resp[choices][0][message][content]
self.messages.append({role: assistant, content: reply})
return reply
def remember(self, fact: str):
将某些内容持久化到 ZeroMemory。
requests.post(
https://api.ainative.studio/api/v1/public/memory/v2/remember,
headers={X-API-Key: self.api_key},
json={content: fact, memory_type: episodic}
)
def recall(self, query: str) -> list:
检索相关记忆。
resp = requests.post(
https://api.ainative.studio/api/v1/public/memory/v2/recall,
headers={X-API-Key: self.api_key},
json={query: query, limit: 5}
).json()
return [m[content] for m in resp.get(memories, [])]
python
def route_task(task: str) -> str:
将任务路由到正确的 OpenClaw 智能体。
routing = {
test: aurora,
security: nova,
deploy: atlas,
frontend: lyra,
backend: sage,
performance: helios,
data: vega,
docs: luma,
}
for keyword, agent_id in routing.items():
if keyword in task.lower():
return agent_id
return main
import subprocess
def dispatch(task: str):
agentid = routetask(task)
subprocess.run([openclaw, agent, --agent, agent_id, --message, task])
收集反馈以提升智能体质量:
bash
python
requests.post(
https://api.ainative.studio/api/v1/public/zerodb/rlhf/feedback,
headers={X-API-Key: akyourkey},
json={
session_id: sess-123,
rating: 5,
feedback: 智能体正确识别了 SQL 注入向量,
}
)
bash
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 ainative-agent-framework-1776064750 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 ainative-agent-framework-1776064750 技能
skillhub install ainative-agent-framework-1776064750
文件大小: 2.91 KB | 发布时间: 2026-4-14 14:18