跳至主要内容

Cognitive Modules

可验证的结构化 AI 任务规范

快速开始

# Zero-install run
export OPENAI_API_KEY=sk-xxx
cat <<'EOF' | npx cogn@2.2.16 core run --stdin --args "hello" --pretty
Return a valid v2.2 envelope (meta + data). Put your answer in data.result.
EOF

# Provider/model flags must come after the command:
# ... core run --stdin --provider minimax --model MiniMax-M2.1 ...
查看完整安装指南 →

Killer Use Case: PR Review Gate (CI)

Run a module on the PR diff, route by meta.risk, and block merges on high risk.

Contract: always v2.2 envelope (ok/meta/data|error)
Routing: low/medium/high risk as a first-class field
Stability: provider differences downgrade safely, with reasons in meta.policy

核心特性

强类型契约

输入与输出均通过 JSON Schema 双向校验,确保结构化结果稳定可靠。

控制/数据分离

meta 控制面用于路由决策,data 数据面承载业务结果与审计信息。

模块分层

exec / decision / exploration 三层能力模型,匹配不同任务严格度。

可解释输出

每次调用都要求置信度与 rationale,便于追溯与复核。

多模型支持

支持 OpenAI / Anthropic / MiniMax / Ollama,一套模块跨模型运行。

MCP 集成

原生支持 Claude Desktop、Cursor 等 AI 工具,接入路径直接。