---
title: "retrieve"
description: "Get specific data by reference (ID, path, URI)"
canonical: "https://acs.synapti.ai/capabilities/retrieve/"
last_updated: "2026-11-16T01:14:10Z"
---

# retrieve

Get specific data by reference (ID, path, URI)

Generated from [schemas/capability_ontology.yaml](https://github.com/synaptiai/agent-capability-standard/blob/main/schemas/capability_ontology.yaml), [skills/retrieve/SKILL.md](https://github.com/synaptiai/agent-capability-standard/blob/main/skills/retrieve/SKILL.md) at commit 18c38b74ac21. Ontology version 2.2.0.

Layer: [PERCEIVE](https://acs.synapti.ai/layers/perceive/index.md)

## Safety

| Property | Value |
| --- | --- |
| Risk | Low |
| Changes state | No |
| Needs checkpoint | No |
| Needs approval | No |
| Overridable | No |
| Blocked from autonomy | No |

**Figure: Ordering rules for retrieve in a workflow.** In a workflow, it is a recommended step before ground; and where the workflow has transform, retrieve must come before it (V102).

| Where | Capability | Rule | Enforcement | Diagnostic |
| --- | --- | --- | --- | --- |
| After retrieve | [`ground`](https://acs.synapti.ai/capabilities/ground/index.md) | `soft_requires` | SHOULD | W601 |
| After retrieve | [`transform`](https://acs.synapti.ai/capabilities/transform/index.md) | `precedes` | MUST | V102 |

## Relationships

**Figure: Relationships of retrieve: 5 relationships with 5 capabilities.** retrieve has 5 relationships with 5 capabilities: 4 with edges out of it and 1 joined to it only by edges that run both ways.

| Capability | Row | Relationships |
| --- | --- | --- |
| [`search`](https://acs.synapti.ai/capabilities/search/index.md) | Either way | `alternative_to` (both ways) |
| [`detect`](https://acs.synapti.ai/capabilities/detect/index.md) | Edges out of retrieve | `enables` (out of) |
| [`discover`](https://acs.synapti.ai/capabilities/discover/index.md) | Edges out of retrieve | `enables` (out of) |
| [`ground`](https://acs.synapti.ai/capabilities/ground/index.md) | Edges out of retrieve | `soft_requires` (out of) |
| [`transform`](https://acs.synapti.ai/capabilities/transform/index.md) | Edges out of retrieve | `precedes` (out of) |

- `soft_requires`: Recommended before [`ground`](https://acs.synapti.ai/capabilities/ground/index.md)
- `enables`: Unlocks [`detect`](https://acs.synapti.ai/capabilities/detect/index.md), [`discover`](https://acs.synapti.ai/capabilities/discover/index.md)
- `precedes`: Comes before, when both are present [`transform`](https://acs.synapti.ai/capabilities/transform/index.md)
- `alternative_to`: Can substitute for [`search`](https://acs.synapti.ai/capabilities/search/index.md)

## Contract

**Figure: Contract of retrieve: 4 inputs (1 required), 5 outputs.** retrieve takes 4 inputs, 1 required (filled pin) and 3 optional (hollow pin), and returns 5 outputs. The tables below list every field.

### Inputs

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `target` | string | Yes | Reference to data (ID, path, URI) |
| `format` | string | No | Expected format of retrieved data |
| `filter` | object | No | Criteria the retrieved data must meet (e.g. a time range) |
| `references` | array of object | No | Further references to retrieve along with the target (e.g. search results) |

### Outputs

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | any | Yes | Retrieved data |
| `evidence_anchors` | array of Anchor (or deprecated string or object) | Yes | Source references (Standard v1.2 §6.5). |
| `confidence` | number | Yes | The producer's probability that the output's claim is correct, self-reported unless the host documents a calibration (Standard v1.2 §4.1.1) From 0 to 1 |
| `inference_method` | string | No | How the output was reached when it is not grounded in evidence; with confidence it marks the output inferred (Standard v1.2 §3.1, §4.1.1). A producer should use model_knowledge, deduction, induction, abduction, analogy, statistical, simulation, assumption or an x- vendor value; a grounding policy (§5.20) requires one of them. |
| `uncertainty` | Uncertainty | No | The uncertainty of the output's principal value; its confidence equals the output's confidence (Standard v1.2 §4.1.1) |

The skill returns 8 fields: 3 are in retrieve's output contract (3 required) and 5 are the skill's own, outside the contract; it leaves out 2 contract fields (inference_method, uncertainty).

| Field of the skill's output | In the output contract |
| --- | --- |
| `data` | Yes, required |
| `retrieved` | No, the skill's own |
| `citation` | No, the skill's own |
| `provenance` | No, the skill's own |
| `extraction` | No, the skill's own |
| `confidence` | Yes, required |
| `evidence_anchors` | Yes, required |
| `assumptions` | No, the skill's own |
| `inference_method` | Yes, but the skill leaves it out |
| `uncertainty` | Yes, but the skill leaves it out |

## Used in workflows

**Figure: retrieve in workflows.** 16 workflows use retrieve, in 25 steps in all; its steps are the squares in an ink ring, and the key under the strips names the other squares.

- [`world_model_build`](https://acs.synapti.ai/workflows/world-model-build/index.md): step 1
- [`rag_pipeline`](https://acs.synapti.ai/workflows/rag-pipeline/index.md): step 2
- [`data_pipeline_validation`](https://acs.synapti.ai/workflows/data-pipeline-validation/index.md): steps 1, 2 and 5
- [`anomaly_investigation`](https://acs.synapti.ai/workflows/anomaly-investigation/index.md): step 1
- [`report_generation`](https://acs.synapti.ai/workflows/report-generation/index.md): step 1
- [`model_monitoring`](https://acs.synapti.ai/workflows/model-monitoring/index.md): steps 2 and 5
- [`patient_monitoring`](https://acs.synapti.ai/workflows/patient-monitoring/index.md): step 2
- [`clinical_alert_triage`](https://acs.synapti.ai/workflows/clinical-alert-triage/index.md): steps 1 and 2
- [`care_plan_review`](https://acs.synapti.ai/workflows/care-plan-review/index.md): steps 1, 3 and 4
- [`handoff_preparation`](https://acs.synapti.ai/workflows/handoff-preparation/index.md): steps 1, 2, 4 and 5
- [`quality_control_loop`](https://acs.synapti.ai/workflows/quality-control-loop/index.md): step 1
- [`predictive_maintenance`](https://acs.synapti.ai/workflows/predictive-maintenance/index.md): step 1
- [`supply_chain_sync`](https://acs.synapti.ai/workflows/supply-chain-sync/index.md): step 2
- [`schedule_management`](https://acs.synapti.ai/workflows/schedule-management/index.md): step 1
- [`information_research`](https://acs.synapti.ai/workflows/information-research/index.md): step 4
- [`communication_drafting`](https://acs.synapti.ai/workflows/communication-drafting/index.md): step 4

## Claude Code skill

**Figure: What the retrieve skill's tools can do, against the ontology.** The skill may use 2 tools: 2 only read; the ontology marks retrieve as read-only, and every tool only reads.

| What they can do | Tools |
| --- | --- |
| Only read | `Read`, `Web` |
| Run commands, which can change state | none |
| Change files | none |

**Figure: The field names each step of the retrieve procedure uses.** 6 of the procedure's 8 steps use the name of an input or output field of the retrieve skill as a word; 4 output fields of 8 are used by no step (extraction, confidence, evidence_anchors, assumptions).

| Step | Inputs it uses by name | Output fields it uses by name |
| --- | --- | --- |
| 1. Identify target | `target` |  |
| 2. Verify source accessibility |  |  |
| 3. Execute retrieval |  | `data` |
| 4. Validate retrieved data | `format` | `data`, `retrieved` |
| 5. Extract relevant portions | `filter` | `data` |
| 6. Construct citation |  | `citation` |
| 7. Document provenance |  | `provenance` |
| 8. Handle failures |  |  |

All 3 examples of the skill write out every one of its 8 output fields.

**Figure: The field names each verification check of the retrieve skill uses.** 2 of the 5 checks use the name of an input or output field as a word; 7 output fields of 8 are named by no check (retrieved, citation, provenance, extraction, confidence, evidence_anchors and assumptions).

| Check | Inputs it uses by name | Output fields it uses by name |
| --- | --- | --- |
| 1. Retrieved data matches expected format | `format` | `data` |
| 2. Citation enables exact re-retrieval |  |  |
| 3. Hash validates data integrity (when available) |  | `data` |
| 4. Truncation is explicitly flagged |  |  |
| 5. Timestamp is accurate |  |  |

**Figure: The neighbours the skill lists for retrieve, checked against the ontology and the catalogs.** The skill lists 5 capabilities as common neighbours of retrieve; 2 of them have an edge with it in the ontology, and 2 run next to it, in that order, in a catalog workflow (search most often, 6 times). Under each tile, an edge reads from its source to its target, with retrieve's symbol in its place: "requires Rt" is a requires edge from the tile's capability to retrieve, so the tile's capability must run before retrieve; "Rt precedes" is a precedes edge from retrieve to the tile's capability.

| Listed as | Capability | Ontology edge | Next to it in a workflow |
| --- | --- | --- | --- |
| commonly follows | [`search`](https://acs.synapti.ai/capabilities/search/index.md) | `alternative_to`, `alternative_to` (into it) | 6 times |
| commonly follows | [`observe`](https://acs.synapti.ai/capabilities/observe/index.md) | none | never |
| commonly precedes | [`state`](https://acs.synapti.ai/capabilities/state/index.md) | none | never |
| commonly precedes | [`ground`](https://acs.synapti.ai/capabilities/ground/index.md) | `soft_requires` (into it) | never |
| commonly precedes | [`integrate`](https://acs.synapti.ai/capabilities/integrate/index.md) | none | 2 times |

### Intent

Execute **retrieve** to fetch specific, known information from specified sources. Unlike `search` (which explores under uncertainty), retrieve fetches identified items with full provenance tracking.

**Success criteria:**
- Requested data is fetched completely
- Source and timestamp are recorded
- Data integrity is verified where possible
- Citations enable re-retrieval
- Missing data is explicitly flagged

**World Modeling Context:**
Retrieve feeds into all world modeling layers by providing grounded observations for `state`, timestamps for reasoning about time, and evidence for `ground`.

**Compatible schemas:**
- `schemas/output_schema.yaml`

### Inputs

| Parameter | Required | Type | Description |
|-----------|----------|------|-------------|
| `target` | Yes | string | What to retrieve (path, URL, query, or identifier) |
| `format` | No | string | Expected format (json, text, binary); default: auto-detect |
| `filter` | No | object | Criteria the retrieved data must meet (e.g. `time_range`) |
| `references` | No | array | Further references to retrieve along with `target` (e.g. search results) |

Inputs not listed here are outside the capability's contract: a workflow step that binds them gets W604 (STANDARD v1.1 §5.5).

### Procedure

1) **Identify target**: Determine exactly what to fetch
   - File path: Exact file location
   - URL: Web resource address
   - API endpoint: Service + parameters
   - Record: Database/system identifier

2) **Verify source accessibility**: Confirm retrieval is possible
   - Check permissions
   - Verify network access if remote
   - Confirm source exists

3) **Execute retrieval**: Fetch the data
   - For files: Read with line numbers preserved
   - For URLs: Fetch with timeout and retry
   - For APIs: Call with appropriate auth
   - Record exact timestamp of retrieval

4) **Validate retrieved data**: Check completeness and integrity
   - Verify format matches expected
   - Check for truncation or corruption
   - Validate against schema if available
   - Compute hash for integrity tracking

5) **Extract relevant portions**: If a `filter` is specified
   - Apply filters to reduce data
   - Project specific fields
   - Slice by line numbers or sections

6) **Construct citation**: Build verifiable reference
   - Full path/URL
   - Timestamp of retrieval
   - Version/revision if available
   - Hash for integrity verification

7) **Document provenance**: Record retrieval metadata
   - Source authority
   - Freshness (how current)
   - Reliability (historical accuracy)

8) **Handle failures**: If retrieval fails
   - Record failure reason
   - Suggest alternatives if available
   - Note partial success if applicable

### Output Contract

Return a structured object:

```yaml
data: object | string | array  # The retrieved content
retrieved:  # What was fetched, from where, and when
  target: string  # What was requested
  source: string  # Where it came from
  timestamp: string  # ISO 8601 retrieval time
  format: string  # Data format (json, text, etc.)
  complete: boolean  # Was full content retrieved?
citation:
  reference: string  # Full citation for re-retrieval
  version: string | null  # Version/revision if applicable
  hash: string | null  # Content hash for integrity
  authority: low | medium | high
provenance:
  source_type: string  # file, api, database, web
  last_modified: string | null  # When source was last changed
  freshness: fresh | stale | unknown  # How current is this data
  reliability: string  # Assessment of source reliability
extraction:
  applied_filters: object | null
  original_size: integer | null
  returned_size: integer | null
  truncated: boolean
confidence: number  # probability that the retrieved data is accurate and complete (§4.1.1)
evidence_anchors: array[EvidenceAnchor]  # each {ref, kind, digest?} (STANDARD v1.2 §6.5)
assumptions: array[string]
```

#### Field Definitions

| Field | Type | Description |
|-------|------|-------------|
| `data` | any | The fetched content |
| `retrieved` | object | Request target, source, retrieval timestamp, format, and whether the content is complete |
| `citation` | object | Verifiable reference to re-fetch |
| `provenance` | object | Source reliability and freshness |
| `extraction` | object | Filtering/processing applied |
| `confidence` | number | Probability, 0.0-1.0, that the retrieved data is accurate and complete (§4.1.1) |
| `evidence_anchors` | array of evidence anchors (§6.5) | References to the exact source locations |
| `assumptions` | array | Explicit assumptions |

### Examples

#### Example 1: Retrieve Configuration File

**Input:**
```yaml
target: "config/database.yml"
```

**Output:**
```yaml
data:
  development:
    adapter: postgresql
    host: localhost
    database: myapp_dev
  production:
    adapter: postgresql
    host: "${DATABASE_HOST}"
    database: myapp_prod
    pool: 25
retrieved:
  target: "config/database.yml"
  source: "file:config/database.yml"
  timestamp: "2025-01-24T15:30:00Z"
  format: yaml
  complete: true
citation:
  reference: "config/database.yml:1-15"
  version: "git:abc123"
  hash: "sha256:def456..."
  authority: high
provenance:
  source_type: file
  last_modified: "2025-01-20T10:00:00Z"
  freshness: fresh
  reliability: "Version controlled, reviewed configuration"
extraction:
  applied_filters: null
  original_size: 450
  returned_size: 450
  truncated: false
confidence: 1.0
evidence_anchors:
  - {ref: "file:config/database.yml:1-15", kind: file}
assumptions:
  - "File contents reflect deployed configuration"
```

**Evidence pattern:** Read file directly, computed hash, tracked git version.

---

#### Example 2: Retrieve API Documentation

**Input:**
```yaml
target: "https://api.example.com/docs/v2/endpoints"
format: json
```

**Output:**
```yaml
data:
  version: "2.0.0"
  endpoints:
    - path: "/users"
      methods: ["GET", "POST"]
      auth_required: true
    - path: "/users/{id}"
      methods: ["GET", "PUT", "DELETE"]
      auth_required: true
retrieved:
  target: "https://api.example.com/docs/v2/endpoints"
  source: "web:api.example.com"
  timestamp: "2025-01-24T15:35:00Z"
  format: json
  complete: true
citation:
  reference: "https://api.example.com/docs/v2/endpoints"
  version: "v2.0.0"
  hash: "sha256:789abc..."
  authority: high
provenance:
  source_type: web
  last_modified: "2025-01-15T00:00:00Z"
  freshness: fresh
  reliability: "Official API documentation"
extraction:
  applied_filters: null
  original_size: 2500
  returned_size: 2500
  truncated: false
confidence: 0.95
evidence_anchors:
  - {ref: "https://api.example.com/docs/v2/endpoints", kind: url}
assumptions:
  - "API documentation reflects actual API behavior"
```

---

#### Example 3: Retrieve with Filtering

**Input:**
```yaml
target: "src/models/user.ts"
filter:
  lines: "1-50"
  sections: ["interface", "class"]
```

**Output:**
```yaml
data: |
  interface UserAttributes {
    id: string;
    email: string;
    name: string;
    createdAt: Date;
  }

  class User implements UserAttributes {
    id: string;
    email: string;
    name: string;
    createdAt: Date;

    constructor(attrs: UserAttributes) {
      Object.assign(this, attrs);
    }
  }
retrieved:
  target: "src/models/user.ts"
  source: "file:src/models/user.ts"
  timestamp: "2025-01-24T15:40:00Z"
  format: text
  complete: false
citation:
  reference: "src/models/user.ts:1-50"
  version: "git:abc123"
  hash: null
  authority: high
provenance:
  source_type: file
  last_modified: "2025-01-22T09:00:00Z"
  freshness: fresh
  reliability: "Source code"
extraction:
  applied_filters:
    lines: "1-50"
    sections: ["interface", "class"]
  original_size: 5000
  returned_size: 500
  truncated: true
confidence: 0.95
evidence_anchors:
  - {ref: "file:src/models/user.ts:1-20", kind: file}
  - {ref: "file:src/models/user.ts:22-35", kind: file}
assumptions:
  - "Extracted sections are complete within specified lines"
```

### Verification

- [ ] Retrieved data matches expected format
- [ ] Citation enables exact re-retrieval
- [ ] Hash validates data integrity (when available)
- [ ] Truncation is explicitly flagged
- [ ] Timestamp is accurate

**Verification tools:** Hash verification, re-retrieval test

### Safety Constraints

- `mutation`: false
- `requires_checkpoint`: false
- `requires_approval`: false
- `risk`: low

**Capability-specific rules:**
- Do not retrieve from paths marked as sensitive
- Respect rate limits on remote sources
- Flag stale data (>24h old for volatile sources)
- Never fabricate retrieved content

### Composition Patterns

**Commonly follows:**
- `search` - After finding, retrieve full content
- `observe` - Retrieve specific files discovered during observation

**Commonly precedes:**
- `state` - Retrieved data becomes observations
- `ground` - Retrieved content provides evidence, and retrieval is a step in its provenance chain
- `integrate` - Retrieved data feeds integration

**Anti-patterns:**
- Avoid retrieving without tracking provenance
- Never assume retrieval succeeded without checking `complete`

**Workflow references:**
- See `reference/composition_patterns.md#world-model-build` for retrieval in model construction
- See `reference/composition_patterns.md#digital-twin-sync-loop` for ongoing data retrieval
