Verbatim vs semantic recall
Semantic memory is paraphrase-prone by design — entries are retrieved by similarity and assembled into context, which is exactly right for insights and preferences and exactly wrong for a config file. This pattern is the discipline of deciding, at write time, whether a future reader needs the exact bytes or the gist — and using archive() for the former. Use it whenever your agent produces artifacts that will be re-executed, quoted, or audited.
How it works
archive(content, artifact_kind, ...) stores the content as an archive_block — immutable, exact, and addressed by the stable reference_id the call returns. dereference(reference_id) fetches it back byte-for-byte, no similarity search involved. Every other entry type is semantic: retrieved by relevance to a query, scored, trimmed, and reworded downstream — reliable for meaning, not for characters.
The two worlds still meet at query time: archived artifacts surface as archive_overlay evidence in normal queries when they're relevant, and as the archive_blocks section in assembled context — see Retrieval lanes. Evidence with referenceable: true carries its reference_id, so anything the overlay surfaces can be re-read exactly.
| You're storing | Use | Why |
|---|---|---|
| Code snippets, configs, generated SQL | archive() | One changed character breaks it |
| Legal text, exact user quotes | archive() | Must be reproduced verbatim |
| Insights, preferences, patterns | Semantic entries (remember()) | Should generalize, reconcile, and rank by relevance |
| A working artifact and the knowledge around it | Both — archive, then a semantic entry referencing the id | Exact recovery plus similarity-retrievable context |
Walkthrough
At Nimbus, Ari finally lands the batched-exporter config that fixes Acme Corp's CSV-export timeouts. The config must survive byte-for-byte; the insight about when to apply it should be semantic so it surfaces on the next similar ticket:
The combination is the point. The next timeout ticket retrieves the lesson semantically (a differently-worded query still matches), and the lesson hands the agent a reference_id it can dereference for the config with zero paraphrase risk.
archive() requires the archive_block write scope and dereference() the matching read scope — register agents with both if they round-trip artifacts. See Exact references.
When not to use it
Don't archive everything. Archived blocks are immutable and sit outside the learning loop — they are never reconciled, superseded, or promoted the way semantic entries are, so knowledge that should evolve (preferences, patterns, lessons) belongs in semantic entries. Archive is for artifacts where fidelity beats adaptability.
Related
- The memory model — where
archive_blocksits in the taxonomy - Retrieval semantics — the
archive_overlayandexact_referencelanes - Exact references — the helper pair and its scopes
- Context assembly — how the
archive_blockssection reaches the prompt