Back to list
AI 統合における「文字列ベース」の説明の死: 構造化されたメタデータへ
The Death of "String-Based" Descriptions in AI Integration
Translated: 2026/4/20 12:01:35
Japanese Translation
AI ツールの構築の初期段階では、私たちは全員同じパターンに従いました:関数を定義し、「このツールは非常に高速でユーザーを安全に削除します」といった巧妙なドック文字列を書き、それを LLM に渡し、何が「非常に高速」で「安全に」意味するかを祈りながら待つだけでした。2026 年にかけて、自由形式の文字列説明は AI エージェントの失敗の 1 番目の理由だと真実を受け入れる時来ました。あなたが「感(Vibes)」(プロンプトエンジニアリング)に依存してツールを定義する時、あなたは実のところ AI にあなたの意図を推測させただけです。apcore シリーズのこの第 8 稿において、私たちは「文字列ベース」の説明を構造化されたメタデータの世界へと移行している理由を説明します。
LLM は意味的なエンジンです。彼らは言語のパターンを探します。あなたのシステムに 2 つのツール——remove_user と delete_account——が存在する場合、LLM は彼らを同義詞として扱う可能性があります。違いを説明する文を加えても、モデルの内部の重みはそのトレーニングデータに基づいて、どちらを偏りさせる可能性があります。
私たちはこれを「説明ドリフト(Description Drift)」と呼びます。エンジニアリングチームが増大していくにつれ、異なる開発者は異なるスタイルで説明を書きます。誰かが絵文字を使いつき、別の誰かが技術用語を使い、誰かが曖昧な形容詞を使うのです。AI にとって、あなたの「認知インターフェース」はバラバラで組織化されていない図書館のように見えます。結果?エージェントは間違ったタイミングで間違ったツールを呼び出し、セキュリティの違反やデータ損失をもたらします。
apcore で、私たちは単一文字列の説明を二層構造メタデータモデルに置き換えました。私たちはこれを人間の複雑なスキルを学習する方法から借用しました:まず目次をスキャンし、実際に動作する前にのみ詳細なマニュアルを読みます。
description)
必須の短い文字列(最大 200 文字)。これは AI の「検索」フェーズに最適化されています。それは AI に次のことを伝えます:「このツールが存在し、これがその高レベルの目的です。」
目的:発見と RAG(リトリアル・エンハンスト・ジェネレーション)。
documentation)
長い形式で、Markdown に対応するフィールド(最大 5000 文字)。これは「マニュアル」です。詳細な使用事例、制約事項、ビジネスロジック、「何をしてはいけないか」という警告を含んでいます。
目的:計画と精度。AI はこのテキストを一時的にツールを選択したのみで「読み」ます。
class PaymentModule(Module):
# 発見:高速で安い読み
description = "Stripe を経由でクレジットカード決済処理を行う。"
# 認知:詳細で、必要になるまでのみ読み
documentation = """
## 使用規則
- 「USD」取引のみ使用します。他者は `executor.fx.payment` を使用してください。
- 最大単一チャarges: $5,000。
- システム構成に `stripe_api_key` が必要です。
## 一般的な坑道
- 同じ order_id に二回呼び出すことを行わないでください;それはデフォルトでイディempoットではありません。
"""
apcore で、説明とスキーマを持つことは「ベストプラクティス」ではありません;それは強制です。あなたは apcore レジストリにモジュールを登録することは、これらのメタデータフィールドを提供する以外不可能です。
これはあなたのシステムが AI にとって自己文書化であることを保証します。新しい開発者がモジュールを追加するたびに、彼らは「認知インターフェース」を定義する際に強制されます。これは「不可視なツール」があなたのシステムを混雑させるのを防ぎ、AI には常に成功するために必要な情報があることを保証します。
「安全」という言葉で AI にツールを伝える代わりに、私たちは行動的注釈を使います。それは破壊的な False としてマークし、requires_approval=True です。これらの文字列ではありません;それらは apcore エグゼキューターによって呼び出しを統治するために使用される構造化された原始素です。
「文字列」から「構造」へ移行することで、私たちは LLM の知覚負荷を減らします。それはもうあなたのコードの意図を「推測」する必要はありません;それは単に「知覚する」契約のみです。
次の記事では、Volume I を結び、次 10 年のために私たちに導く「apcore の設計原則」を見てみます。
これは **apcore: AI-Perceivable World* を構築する** シリーズの #8 アーティクルです。エンジニアリングのメタデータは信頼できる AI の基礎です。GitHub: aiperceivable/apcore
Original Content
In the early days of building AI tools, we all followed the same pattern:
Define a function.
Write a clever docstring like: "This tool is very fast and deletes users securely."
Pass it to the LLM.
Pray it understands what "very fast" and "securely" means.
As we move into 2026, it’s time to admit the truth: Free-form string descriptions are the #1 reason AI Agents fail.
When you rely on "Vibes" (Prompt Engineering) to define your tools, you are essentially asking the AI to guess your intent. In this eighth post of our apcore series, we explain why we’re moving beyond "String-Based" descriptions toward a world of Structured Metadata.
LLMs are semantic engines. They look for patterns in language. If you have two tools in your system—remove_user and delete_account—an LLM might treat them as synonyms. Even if you add a sentence explaining the difference, the model’s internal weights might still bias it toward one over the other based on its training data.
This is what we call "Description Drift." As your engineering team grows, different developers write descriptions in different styles. One uses emojis, another uses technical jargon, and a third uses vague adjectives.
To the AI, your "Cognitive Interface" starts to look like a messy, unorganized library. The result? The Agent calls the wrong tool at the wrong time, leading to security breaches or data loss.
At apcore, we’ve replaced the single-string description with a Dual-Layered Metadata Model. We borrow this concept from the way humans learn complex skills: we scan the table of contents first, and only read the detailed manual when we’re ready to act.
description)
A mandatory, short string (max 200 characters). This is optimized for the AI's "Search" phase. It tells the AI: "This tool exists, and this is its high-level purpose."
Purpose: Discovery and RAG (Retrieval-Augmented Generation).
documentation)
A long-form, Markdown-supported field (up to 5000 characters). This is the "Manual." It contains detailed use cases, constraints, business logic, and "What NOT to do" warnings.
Purpose: Planning and Precision. The AI only "reads" this once it has tentatively selected the tool for the task.
class PaymentModule(Module):
# Discovery: Fast, cheap to read
description = "Process credit card payments via Stripe."
# Cognition: Detailed, read only when needed
documentation = """
## Usage Rules
- Only use for 'USD' transactions. For others, use `executor.fx.payment`.
- Maximum single charge: $5,000.
- Requires `stripe_api_key` in the system configuration.
## Common Pitfalls
- Do NOT call this twice for the same order_id; it is not idempotent by default.
"""
In apcore, having a description and a schema isn't a "best practice"—it's an Enforcement. You literally cannot register a module in an apcore Registry without providing these metadata fields.
This ensures that your system is Self-Documenting for AI. Every time a new developer adds a module, they are forced to define its "Cognitive Interface." This prevents "invisible tools" from cluttering your system and ensures that the AI always has the information it needs to succeed.
Instead of telling the AI that a tool is "safe," we use Behavioral Annotations. We mark it as destructive=False and requires_approval=True. These aren't just strings; they are structured primitives that the apcore Executor uses to govern the call.
By moving from "Strings" to "Structures," we reduce the cognitive load on the LLM. It no longer has to "guess" the intent of your code; it simply "perceives" the contract.
In our next article, we wrap up Volume I by looking at the "Design Principles of apcore" that will guide us for the next 10 years.
This is Article #8 of the **apcore: Building the AI-Perceivable World* series. Engineering metadata is the foundation of reliable AI.*
GitHub: aiperceivable/apcore