跳到正文
Skillpedia
通用编程6.3k · #14241

framework

它能做什么

它是 Atomic Agents 框架的概览,介绍其主要构建模块,以及每个部分的参考说明。适用于使用带类型输入和输出构建大语言模型应用的 Python 开发者。

适用场景

  • ✓当开发者的项目导入了 Atomic Agents 框架,需要正确的使用模式时。
  • ✓当开发者询问智能体、工具和上下文提供者如何协同工作时。
  • ✓当开发者想将 AI 服务商接入 Atomic Agents 项目时。

技能链接

https://github.com/Eigenwise/atomic-agents/blob/main/claude-plugin/atomic-agents/skills/framework/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/Eigenwise/atomic-agents/blob/main/claude-plugin/atomic-agents/skills/framework/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“在我的 Atomic Agents 项目中,智能体、工具和结构定义是如何配合的?”

每周 5 个新技能,1 分钟读完。

工作原理

该技能列出核心类,例如智能体、其配置、结构定义和工具,并指向各个任务所需领域的专题参考说明。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Atomic Agents Framework

Atomic Agents is a lightweight Python framework for building LLM applications with typed, structured input and output. It layers on top of Instructor and Pydantic so every interaction between user, agent, tool, and context is a validated schema.

This skill orients Claude on the framework and routes to focused reference files as the task requires.

Core abstractions

Concept Class Role
Schema BaseIOSchema Typed input/output contract — every agent/tool I/O is one
Agent AtomicAgent[In, Out] LLM-backed transformer from input schema to output schema
Config AgentConfig Wires client, model, history, prompt, roles, API params
Prompt SystemPromptGenerator Three-section prompt: background, steps, output_instructions
History ChatHistory Conversation state, serializable, token-counted
Tool BaseTool[In, Out] Deterministic capability the agent can invoke
Context BaseDynamicContextProvider Dynamic section injected into the system prompt at runtime

All communication between these uses BaseIOSchema subclasses with docstring-required descriptions.

Canonical imports

from atomic_agents import (
    AtomicAgent, AgentConfig,
    BasicChatInputSchema, BasicChatOutputSchema,
    BaseIOSchema, BaseTool, BaseToolConfig,
)
from atomic_agents.context import (
    ChatHistory, Message,
    SystemPromptGenerator, BaseDynamicContextProvider,
)
# Optional: MCP interop
from atomic_agents.connectors.mcp import fetch_mcp_tools, MCPTransportType

Do not use legacy paths like atomic_agents.lib.base.* or atomic_agents.agents.base_agent — those were retired. Import from the top-level package where possible.

Minimum viable agent

import os, instructor, openai
from atomic_agents import AtomicAgent, AgentConfig, BasicChatInputSchema, BasicChatOutputSchema
from atomic_agents.context import ChatHistory

client = instructor.from_openai(openai.OpenAI(api_key=os.environ["OPENAI_API_KEY"]))

agent = AtomicAgent[BasicChatInputSchema, BasicChatOutputSchema](
    config=AgentConfig(
        client=client,
        model="gpt-5-mini",
        history=ChatHistory(),
    )
)

reply = agent.run(BasicChatInputSchema(chat_message="Hello"))
print(reply.chat_message)

AtomicAgent and BaseTool use PEP 695 generics — the type parameters carry runtime information, so write them explicitly and keep them accurate. Full runnable version: atomic-examples/quickstart/quickstart/1_0_basic_chatbot.py.

Targeted creation skills

For the four most common authoring tasks, dedicated atomic skills give a step-by-step workflow (clarify → write → verify → hand off) instead of just reference material. Prefer them when the user is actively building something specific.

User intent Atomic skill
"create a schema" / "design the input/output schema" atomic-agents:create-atomic-schema
"create an agent" / "add another agent" / "wire up an AtomicAgent" atomic-agents:create-atomic-agent
"add a tool" / "wrap an API as a tool" / "build a BaseTool" atomic-agents:create-atomic-tool
"add a context provider" / "inject X into the prompt" / "wire up RAG" atomic-agents:create-atomic-context-provider
"my agent is broken / crashing / returning garbage" + a traceback or error atomic-agents:troubleshoot

These skills auto-trigger on the matching phrasing. The reference files below are what they (and you) load for deeper material.

Decision routing

Pick the reference file that matches the task. Each is loaded only when read.

Task Reference
Design or validate an input/output schema references/schemas.md
Build, configure, or run an agent references/agents.md
Write a tool the agent will invoke references/tools.md
Inject dynamic data into the system prompt references/context-providers.md
Structure the system prompt references/prompts.md
Coordinate multiple agents references/orchestration.md
Manage conversation state and multi-agent memory references/memory.md
Register telemetry, retries, or logging references/hooks.md
Swap LLM provider or configure roles [references/provi
常见问题

什么是 Atomic Agents?

它是一个轻量的 Python 框架,用于构建带有类型和验证的输入与输出的大语言模型应用。

它基于什么构建?

该技能说明,它基于 Instructor 和 Pydantic 构建。

它涵盖多智能体设置吗?

涵盖。该技能提到,跨智能体的编排是该框架的一部分。

详情

作者的原始描述

Guide for the Atomic Agents Python framework — schemas, agents, tools, context providers, prompts, orchestration, and provider configuration. Use when code imports from `atomic_agents`, defines an `AtomicAgent`, `BaseTool`, or `BaseIOSchema`, or the user asks about multi-agent orchestration or LLM-provider wiring in an atomic-agents project.

repo: Eigenwise/atomic-agents

热度

GitHub 星标
6.3k
排名
#14241
许可证
MIT
更新时间
2026/10/29

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能