Agent Wealth HubFree public resources
中文 EN العربية

Back to catalog / Document automation

Build an entity graph to answer cross-document questions

Extract typed entities and relation triples, resolve name variants, then answer multi-hop questions over the graph.

Goal

Connect dispersed facts through explicit relations that can be audited.

Steps

  1. Define Pydantic entities, relations, and source fields; extract with client.messages.parse(...) as in the notebook. [graph]
  2. Extract subject-predicate-object triples per document, resolve alias candidates, and retain provenance. [graph]
  3. Build a relevant subgraph and answer a multi-hop question; include node/edge sources for review. [graph]

How to verify

Aliases resolve while original mentions remain traceable; a two-edge question is answered via graph paths, not model recall.

Troubleshooting

If entities merge incorrectly, review canonical-ID evidence and allow manual splits; uncertain relations remain candidates.

Permissions

Prerequisites

Permissions

Limitations

Extraction can miss or mislink entities/relations; the in-memory graph is not a transactional graph database.

Pinned upstream source

https://github.com/anthropics/anthropic-cookbook/blob/9c1e493ddd2b82df399d2a61b9c806c539e18be6/capabilities/knowledge_graph/guide.ipynb

Repository
anthropics/anthropic-cookbook
File path
capabilities/knowledge_graph/guide.ipynb
Pinned commit
9c1e493ddd2b82df399d2a61b9c806c539e18be6
Source checked
2026-10-14 · Reviewed against the pinned upstream source

Repository metrics

These values describe the upstream repository, not popularity or likes for an individual skill or playbook.

Stars
Not collected
Forks
Not collected
Observed at
Not collected

No metrics snapshot is available yet.

License: MIT

Main topic

Turn ecommerce campaign materials into a reviewable weekly brief

Related resources