Structured Tasks and Indexed Entities for Agentic Execution
Agents aren’t just explaining anymore.
They’re:
- Guiding users through enrollment
- Recommending providers
- Completing forms
- Processing benefits
- Comparing options
- Resolving workflows
To do that, they don’t just need facts or logic.
They need step sequences and entity indexes—structured fragments they can follow and trust.
That’s where ProcedureFragments and DirectoryFragments come in.
What Is a ProcedureFragment?
A ProcedureFragment is a multi-step, logic-aware instruction set designed to guide an agent or user through a process—structured in YAML and embedded as memory.
This isn’t a long blog post that says, “First, do this…”
It’s an embedded, retrievable sequence of steps:
- Each with a purpose
- Optional gating
- Conditional branches
- Output expectations
- Surface-agnostic formatting
Agents use these to:
- Provide guided flows
- Prevent hallucinated instructions
- Cite tasks step-by-step
- Execute logic with transparency
Example: ProcedureFragment
<template data-visibility-fragment>
FragmentType: ProcedureFragment
ProcedureID: medicare-plan-enrollment
Title: How to Enroll in a Medicare Advantage Plan
Steps:
– Step: Confirm eligibility
Instruction: Use the EligibilityFragment for Medicare Advantage to validate.
Requires: user.age, user.zip
– Step: Compare plans in service area
Instruction: Pull plans from DirectoryFragment: MA-Plans-2025-FL-32608
– Step: Select a plan
Instruction: Ensure selected plan includes required drug coverage
– Step: Enroll
Instruction: Submit application via plan provider or call 1-800-MEDICARE
– Step: Confirm enrollment
Instruction: Expect plan materials to arrive within 14 business days
ExpectedOutcome: Enrollment submission recorded
Provenance: MedicareWire Enrollment Guide, 2025
trust_layer: procedure-definition
</template>
Key Fields:
| Field | Description |
| Steps | Ordered instructions, optionally linked to other fragments |
| Requires | Pre-conditions or input gates |
| ExpectedOutcome | What success looks like |
| Provenance | Source of trust for the process |
| trust_layer | Declares confidence and retrieval use case |
This isn’t instruction text.
It’s an actionable semantic procedure.
What Is a DirectoryFragment?
A DirectoryFragment is a structured index of entities—optimized for retrieval by agents, not users—so that listings can be selected, filtered, or reasoned with by machines.
Think of it like:
- A plan directory
- A provider index
- A services list
- A network of structured entities
But instead of flat pages or JavaScript tables, you publish structured index blocks that can be retrieved and reasoned over.
Example: DirectoryFragment
<template data-visibility-fragment>
FragmentType: DirectoryFragment
Title: 2025 Medicare Advantage Plans in Alachua County, FL
EntityType: Medicare Advantage Plan
Entities:
– ID: H1234-005-2025
Name: WellCare Giveback (HMO)
Premium: $0
DrugCoverage: Yes
Rating: 4.0
MaxOutOfPocket: 5400
Dental: Comprehensive
CoverageArea: FL-32608
– ID: H5678-003-2025
Name: Aetna Value Plan (PPO)
Premium: $42
DrugCoverage: Yes
Rating: 3.5
MaxOutOfPocket: 5900
Dental: Preventive only
CoverageArea: FL-32608
Provenance: MedicareWire.com Plans Index, 2025
trust_layer: factual-core
</template>
Why It Works
This isn’t a full-blown API.
It’s an index snapshot with structured fields agents can ingest.
You can:
- Publish one per county
- Link them to Eligibility + ProcedureFragments
- Cite plan IDs in Enrollment fragments
- Update annually with versioned Provenance
It’s the retrieval-first version of a directory page.
And it works at scale—with zero JavaScript.
How These Fragments Work Together
Let’s map a common agent workflow:
“I want to enroll in a Medicare plan in my area.”
| Agent Action | Fragment Used |
| Validate user is eligible | EligibilityFragment |
| Explain enrollment process | ExplainerFragment or ProcedureFragment |
| Pull relevant plans | DirectoryFragment |
| Check for drug coverage | Field in entity block |
| Recommend a plan | Based on logic + rating |
| Guide user to enroll | ProcedureFragment, Step 4 |
You didn’t publish a chatbot.
You published a trust-driven decision workflow—in fragments.
Best Practices
- Structure each ProcedureFragment with 3–7 steps
- Link to glossary and eligibility fragments where relevant
- Keep DirectoryFragment fields predictable (avoid nested arrays unless necessary)
- Always declare Provenance and trust_layer
- Publish to crawlable, static HTML surfaces (yes, even GitHub works)
Why This Is the Future
Because AI agents:
- Don’t browse
- Don’t click
- Don’t scroll
- Don’t guess
They:
- Retrieve
- Reason
- Compare
- Guide
And now they can do it using your fragments.
You don’t need to build a no-code platform or AI SaaS.
You just need to publish memory that knows what to do.
Final Word
You’ve now given the machine:
- Definitions
- Explanations
- Conditional logic
- Access gates
- Contextual roles
- And now—tasks it can perform with confidence
You’re not publishing web content anymore.
You’re authoring semantic task flows and machine-usable indexes.
Let’s finish strong in Chapter 27—PythonFragments: Executable Logic Inside Trusted Memory.