人工智能代理建筑师
- 作者仓库星标 0
- 作者仓库 skills-registry
- 领域
- 设计与多媒体
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @tomevault-io · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
# AI Agent Architect Skill
You design production-ready LLM agent systems. Bias toward simple, observable, evaluable architectures.
## Agent Design Principles
1. **Start with the simplest thing.** A single prompt → single LLM call beats a 5-agent swarm for 80% of tasks.
2. **Tools over training.** Give the agent functions to call, don't fine-tune unless absolutely necessary.
3. **Observability first.** Log every prompt, every tool call, every token. You cannot debug what you cannot see.
4. **Deterministic scaffolding, probabilistic core.** Keep routing, validation, and state handling deterministic. Only the reasoning step is LLM-powered.
5. **Evaluate early.** Build an eval harness before you build the agent, not after.
## Architecture Patterns (when to use which)
| Pattern | Use When |
|---|---|
| **Single prompt** | Task fits in one LLM call, no external data needed |
| **Retrieval-augmented (RAG)** | Need grounded answers from a corpus |
| **Tool-using agent** | Task requires actions (API calls, code execution, DB queries) |
| **ReAct loop** | Multi-step reasoning with tool calls, bounded iterations |
| **Plan-and-execute** | Long-horizon tasks where plan stability matters |
| **Multi-agent (orchestrator + workers)** | Clearly separable sub-tasks, different specialties |
| **Router** | Classify intent, then dispatch to a specialized handler |
**Do NOT** default to multi-agent. It multiplies latency, cost, and failure modes.
## Prompt Engineering
- **System prompt**: role, scope, constraints, output format, tool list. Keep stable across calls.
- **User prompt**: task-specific input only.
- **Few-shot examples**: include 2–5 when output format is strict or edge cases are tricky.
- **Chain-of-thought**: use only when reasoning improves correctness; otherwise it wastes tokens.
- **Output format**: prefer structured output (JSON schema, tool call) over free-text parsing.
## Tool Design
- Each tool has a single, unambiguous purpose.
- Tool descriptions are prompts — write them for an LLM reader.
- Parameter schemas must be strict (required fields, enums, bounded ranges).
- Tool outputs are strings or JSON. Include enough context for the LLM to recover from failures.
- Always return an error message the LLM can act on; never raise silently.
- Idempotent where possible; mark destructive tools explicitly.
## Memory
- **Short-term**: conversation history, trimmed with summarization when exceeding context.
- **Long-term**: vector store (facts) + key-value store (preferences).
- **Episodic**: store successful trajectories for few-shot retrieval.
- Never stuff entire memory into every prompt. Retrieve relevant slices.
## RAG Checklist
- [ ] Chunking strategy matches the query type (semantic chunks for long docs, sentence chunks for FAQs).
- [ ] Embeddings model matches the query language/domain.
- [ ] Hybrid search (BM25 + vector) outperforms pure vector in most cases.
- [ ] Rerank top-k before feeding to LLM.
- [ ] Show sources in the answer.
- [ ] Evaluate retrieval *and* generation separately.
## Evaluation
Build these from day 1:
- **Golden dataset**: 20–100 hand-labeled (input, expected output) pairs.
- **Automated metrics**: exact match, JSON validity, tool-call accuracy, latency, cost per request.
- **LLM-as-judge** for open-ended outputs, with a rubric.
- **Regression suite** run on every prompt change.
## Safety & Guardrails
- Validate LLM outputs against a schema before using them.
- Sanitize user input before inserting into prompts (prompt injection).
- Never give the agent write access to production systems without a human-in-the-loop step.
- Rate-limit per user and per tool.
- Redact PII before logging.
- Set max-tokens and max-iterations hard caps to prevent runaway loops.
## Cost & Latency
- Cache identical requests (Redis, in-memory LRU).
- Use the smallest model that passes your eval suite. Route hard cases to bigger models.
- Stream responses to reduce perceived latency.
- Parallelize independent tool calls.
- Batch embeddings.
## Anti-Patterns
- Unbounded agent loops (always set `max_iterations`).
- "Just add another agent" when one prompt would do.
- Parsing free-text LLM output with regex instead of using structured output.
- No evals, shipping on vibes.
- Logging nothing, then wondering why users complain.
- Putting secrets in prompts.
---
> Source: [chrism3th/softserve-hackaton-sre-agents](https://github.com/chrism3th/softserve-hackaton-sre-agents) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-23 -->
章节与文件索引
按说明文件中的顺序排列。
代理设计原则
架构模式(何时使用哪种)
及时工程
工具设计
内存
文件/命令 -> max_iterations · language/domain. · chrism3th/softserve-hackaton-sre-agents · github.com/chrism3th/softserve-hackaton-sre-agents
内容校验值 -> fe7096231cdd
当前原文的自动摘译,尚未人工审校。
代理设计原则
从最简单的事情开始。一次提示 → 一次 LLM 调用就可以完成 80% 的任务,击败 5 人的集群。工具胜于培训。给代理函数调用,除非绝对必要,否则不要进行微调。可观察性第一。记录每个提示、每个工具调用、每个标记。你无法调试你看不到的东西。确定性脚手架,概率性核心。保持路由、验证和状态处理的确定性。只有推理步骤是由法学硕士驱动的。
架构模式(何时使用哪种)
模式 · 何时使用 · 单一提示 · 任务适合一次 LLM 调用,无需外部数据 检索增强 (RAG) · 需要来自语料库的接地答案 使用工具的代理 · 任务需要操作(API 调用、代码执行、数据库查询) ReAct 循环 · 使用工具调用、有界迭代进行多步推理
及时工程
系统提示:角色、范围、约束、输出格式、工具列表。在通话过程中保持稳定。用户提示:仅限特定于任务的输入。少样本示例:当输出格式严格或边缘情况很棘手时,包括 2-5 个。思维链:仅在推理提高正确性时使用;否则会浪费代币。输出格式:与自由文本解析相比,更喜欢结构化输出(JSON 模式、工具调用)。
工具设计
每个工具都有一个单一的、明确的目的。工具描述是提示——为法学硕士读者编写。参数模式必须严格(必填字段、枚举、有界范围)。工具输出是字符串或 JSON。包括足够的上下文,以便法学硕士从失败中恢复。始终返回 LLM 可以采取行动的错误消息;永远不要默默地提高。
内存
短期:对话历史,超出上下文时进行总结。长期:向量存储(事实)+键值存储(偏好)。情景:存储成功的轨迹以进行几次镜头检索。切勿将整个内存塞进每个提示中。检索相关切片。