---
title: '@0xintuition/atom-enrichment'
description: Execute selected providers, preserve partial artifacts and provenance, and extract classification fields.
url: https://docs.intuition.systems/docs/reference/packages/atom-enrichment
markdown_url: https://docs.intuition.systems/docs/reference/packages/atom-enrichment.md
version: V2
llms_index: https://docs.intuition.systems/llms.txt
kind: reference
reader:
  - app
  - plugin
packages:
  - '@0xintuition/atom-enrichment@0.1.1'
---

## What it's for

Run provider plugins against classified input and collect typed artifacts with provenance. Extraction can turn those artifacts into classification fields; neither operation changes an existing atom's identity bytes.

## When to use it

Use it when you need provider metadata, a selected provider plan, or normalized fields with missing-field diagnostics. Use the IID registry to plan providers before execution. A plan is not a completed lookup, and an artifact is not evidence that every required classification field was extracted.

## Install

```sh
npm install @0xintuition/atom-enrichment@0.1.1
```

Use typed ESM or CommonJS on Node 20+; Bun is also supported. Real providers may require HTTP access, credentials, and server-compatible execution; inject those deliberately. See [module-format compatibility](https://docs.intuition.systems/docs/reference/compatibility#runtime-requirements).

## Entry points

All public modules

| Subpath | Purpose |
| --- | --- |
| `.` | Engine, providers, registries, presets, handoff, and public types |
| `./types` | Inputs, artifacts, results, and request schemas |
| `./handoff` | Adapt classification results into enrichment input |
| `./provider-data` | Normalized provider payload types |
| `./plugins` | Plugin manifests, contracts, and validation |
| `./providers` | Provider factories and request helpers |
| `./presets` | Provider bundles and explicit environment mapping |
| `./engine` | Enrichment execution engine |
| `./plugin-registry` | Register and resolve plugins |
| `./cache` | Cache contracts and memory or HTTP adapters |
| `./testing` | Deterministic fixtures and plugin conformance helpers |
| `./classifications` | Provider artifact classification registry |
| `./classifications/defaults` | Built-in artifact definitions |
| `./classifications/registry` | Artifact registration and validation |
| `./classifications/schemas` | Artifact payload schemas |
| `./provider-external-data` | External provider response schemas |
| `./provider-plan` | Match desired providers against installed capabilities |
| `./slug-aliases` | Canonicalize provider slug aliases |
| `./extraction` | Extract normalized classification fields and provenance |
| `./data-resolved-schema` | Normalized resolved-data boundary |
| `./spotify-client` | Shared Spotify client |
| `./tmdb-request-observer` | Observe TMDB requests |
| `./provider-fetch` | Provider transport helpers |
| `./plugin-api` | Public plugin authoring API |
| `./outcome` | Promise outcome wrapper for enrichment |
| `./adapters/upstash` | Explicit HTTP cache adapter |
| `./ssrf` | Pinned transport and destination policy helpers |
| `./identifier-rung-projection` | Project admissible identifier rungs |
| `./url-hygiene` | URL normalization policy |

## Depends on and works with

Runtime package dependencies: [classifications](https://docs.intuition.systems/docs/reference/packages/classifications), [iid](https://docs.intuition.systems/docs/reference/packages/iid), [iid-ladder](https://docs.intuition.systems/docs/reference/packages/iid-ladder), [iid-registry](https://docs.intuition.systems/docs/reference/packages/iid-registry), [pipeline-runtime](https://docs.intuition.systems/docs/reference/packages/pipeline-runtime), [protocol](https://docs.intuition.systems/docs/reference/packages/protocol), and [schema-org](https://docs.intuition.systems/docs/reference/packages/schema-org). Peer dependencies: none. `zod` is an additional ordinary dependency in the package manifest.

Canonical entity requirements belong to classifications. This package's artifact registry validates provider payloads. `toClassifiedAtomInput` returns usable input or `null`; handle that boundary before calling `enrich`. `createIdentifierProviderPlan` records scheduled, unavailable, and unsupported providers instead of silently treating a missing plugin as completed work.

## @0xintuition/atom-enrichment - Example

These two synthetic plugins exercise the real engine without network access. One returns a valid Open Graph artifact; the other rejects. The example preserves the successful artifact alongside the failure.

```ts
import {
  createEnrichmentEngine,
  type EnrichmentPlugin,
} from '@0xintuition/atom-enrichment';

// Synthetic fixtures: no HTTP provider, credentials, or fetched page.
const fixture: EnrichmentPlugin = {
  id: 'catalog-fixture',
  version: '1.0.0',
  runtime: 'universal',
  artifactTypes: ['opengraph'],
  supports: (request) => request.input.atomType === 'thing',
  enrich: async (_request, { now }) => [
    {
      artifact_type: 'opengraph',
      data: { title: 'Synthetic catalog' },
      meta: {
        pluginId: 'catalog-fixture',
        provider: 'offline-fixture',
        fetchedAt: now(),
      },
    },
  ],
};
const unavailable: EnrichmentPlugin = {
  ...fixture,
  id: 'unavailable-fixture',
  enrich: async () => {
    throw new Error('Fixture provider unavailable');
  },
};

const engine = createEnrichmentEngine({
  plugins: [fixture, unavailable],
  now: () => '2026-01-01T00:00:00.000Z',
});
export const enriched = await engine.enrich({
  runtime: 'server',
  input: {
    atomType: 'thing',
    jsonLd: { '@context': 'https://schema.org/', '@type': 'Thing' },
    source: {
      classificationEngine: 'offline-fixture',
      classifiedAt: '2026-01-01T00:00:00.000Z',
    },
  },
});
console.log(enriched.status, enriched.artifacts.length, enriched.errors.length);
```

The result is `partial` with one artifact and one error. Inspect `status`, `artifacts`, `errors`, `skipped`, and `timings`; do not discard useful artifacts because a provider failed. Invalid request schemas can still reject before provider execution. Runtime mismatches and unsupported inputs can produce skipped providers.

Preserve each artifact's `meta.pluginId`, `provider`, `fetchedAt`, and optional `sourceUrl`. Here the provider is explicitly an offline fixture, not a scraped page. For real providers, select a small preset and supply approved transports, credentials, timeouts, and cache policy. A keyless service can still make network calls. Spotify's URL-derived fallback, for example, is distinct from a credentialed Web API artifact.

`extractClassificationFields` reports values, provenance, missing required fields, and dropped-field reasons; it may perform additional lookups. The pinned MusicBrainz artifact does not automatically supply extracted music-recording fields. The [processing guide](https://docs.intuition.systems/docs/build/classify-enrich) demonstrates that partial boundary with a fixed fixture. Your application owns retries, queues, persistence, and access control.

## Related concepts

- [Enrichment](https://docs.intuition.systems/docs/concepts/enrichment)

See also [Classify and enrich atoms](https://docs.intuition.systems/docs/build/classify-enrich).

## Source

[Package README](https://github.com/0xIntuition/packages/blob/ccae0f0d0277cddd8490b72c49d3771866e7ffea/packages/atom-enrichment/README.md), [provider payload documentation](https://github.com/0xIntuition/packages/blob/ccae0f0d0277cddd8490b72c49d3771866e7ffea/packages/atom-enrichment/docs/README.md), [plugin contract](https://github.com/0xIntuition/packages/blob/ccae0f0d0277cddd8490b72c49d3771866e7ffea/packages/atom-enrichment/src/plugins.ts), and [partial-result tests](https://github.com/0xIntuition/packages/blob/ccae0f0d0277cddd8490b72c49d3771866e7ffea/packages/atom-enrichment/__tests__/engine.integration.test.ts).

Applies to V2 · `@0xintuition/atom-enrichment` 0.1.1
