Problem
When an LLM agent is reasoning about a rivet artifact and its neighbours, the natural workflow is rivet get <ID> → read description → call rivet get again on each link target → paste the assembled context into the conversation. This is N round-trips for what should be one.
Karpathy's LLM Wiki gist describes the equivalent for markdown wikis: "the LLM reads the index first to find relevant pages, then drills into them." Rivet's typed graph already has the link information; we just don't have a verb that emits the closure as a single pasteable document.
Proposal
rivet bundle REQ-006 --depth 2 --as yaml
rivet bundle DD-064 --depth 1 --as jsonl
- Root: any artifact ID.
--depth N: how many link-graph hops to include. Depth 1 = root + direct neighbours.
--as {yaml,jsonl}: output format. YAML preserves typed structure for paste-into-prompt; JSONL is one-record-per-line for tool consumers.
- Inline link annotations: each artifact in the bundle carries its outgoing links, with the link type rendered as in-stream text (
# satisfies → REQ-004) so an LLM reading top-to-bottom resolves references without a second lookup.
Why YAML, not Markdown
The closest Karpathy analogue is "paste the wiki into the LLM context." For rivet, YAML preserves typed structure with zero information loss; markdown would flatten typed links into prose and re-introduce exactly the ambiguity rivet's typed model exists to remove. See the companion blog post for the longer argument.
Implementation sketch
- New module
rivet-core/src/bundle.rs — graph traversal over Store::all_artifacts() + Link graph.
- New CLI command in
rivet-cli/src/main.rs — Command::Bundle { id, depth, format }.
- New MCP tool
rivet_bundle in rivet-cli/src/mcp.rs so an agent can call this without shelling out.
- Tests: snapshot test against a small fixture; depth-0 → only root; depth-1 → root + direct neighbours; cycle handling.
Out of scope
- Markdown rendering. Add a separate request if a rendered-for-humans surface is wanted.
- Anything beyond the typed link graph. No prose stitching, no LLM-mediated synthesis.
Problem
When an LLM agent is reasoning about a rivet artifact and its neighbours, the natural workflow is
rivet get <ID>→ read description → callrivet getagain on each link target → paste the assembled context into the conversation. This is N round-trips for what should be one.Karpathy's LLM Wiki gist describes the equivalent for markdown wikis: "the LLM reads the index first to find relevant pages, then drills into them." Rivet's typed graph already has the link information; we just don't have a verb that emits the closure as a single pasteable document.
Proposal
--depth N: how many link-graph hops to include. Depth 1 = root + direct neighbours.--as {yaml,jsonl}: output format. YAML preserves typed structure for paste-into-prompt; JSONL is one-record-per-line for tool consumers.# satisfies → REQ-004) so an LLM reading top-to-bottom resolves references without a second lookup.Why YAML, not Markdown
The closest Karpathy analogue is "paste the wiki into the LLM context." For rivet, YAML preserves typed structure with zero information loss; markdown would flatten typed links into prose and re-introduce exactly the ambiguity rivet's typed model exists to remove. See the companion blog post for the longer argument.
Implementation sketch
rivet-core/src/bundle.rs— graph traversal overStore::all_artifacts()+Linkgraph.rivet-cli/src/main.rs—Command::Bundle { id, depth, format }.rivet_bundleinrivet-cli/src/mcp.rsso an agent can call this without shelling out.Out of scope