citation-graph-ingest

Extracts and classifies typed citation edges between documents in an ingested gbrain corpus.

29.4k|4.4k|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/garrytan/gbrain --skill citation-graph-ingest
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: citation-graph-ingest
Source: https://github.com/garrytan/gbrain/tree/main/plugin/skills/citation-graph-ingest
Command: npx skills add https://github.com/garrytan/gbrain --skill citation-graph-ingest

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Flat similarity search cannot tell you that one document overrules, distinguishes, or relies on another. This Skill builds a typed reference graph over an ingested corpus so you can trace arguments and authority relationships across documents instead of just fuzzy-matching them.

Core Features & Use Cases

  • Typed edge extraction: Detects inter-document references mechanically, then uses model judgment to classify each edge as overrules, distinguishes, relies_on, extends, refutes, supersedes, or cites.
  • Native graph storage: Writes edges via gbrain link with link_source=citation-graph provenance, making them queryable with gbrain graph-query --type and bulk-removable without touching other writers' edges.
  • Verified runs: Requires a successful graph-query walk from a hub document before reporting success, and is idempotent so re-runs skip duplicates.
  • Use Case: Ingest a case-law corpus as a gbrain source, run the pipeline, then ask gbrain graph-query doc-a --type overrules --direction in to learn that doc A was overruled by doc C — something vector search alone cannot answer.

Quick Start

Build a typed citation graph over my ingested case-law source so I can see which documents overrule or rely on each other.

Frequently Asked Questions about citation-graph-ingest

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a citation graph over a corpus of documents?

Ingest the corpus as a gbrain source, then run the pipeline: detect candidate inter-document references mechanically, classify each edge type with model judgment, write edges with gbrain link, and verify with a graph-query walk from a hub document.

What edge types does a typed citation graph support?

The skill uses snake_case link types such as overrules, distinguishes, relies_on, extends, refutes, supersedes, and cites. Pick one canonical spelling per relation because graph-query --type filters are exact-match.

Does gbrain query traverse citation edges in natural language search?

No. Natural-language relational recall inside gbrain query walks a fixed edge-type set that does not include citation types like overrules or relies_on. Use explicit gbrain graph-query commands with --type and --direction instead.

Is the citation graph pipeline safe to re-run on the same corpus?

Yes, it is idempotent. Edge uniqueness is keyed on (from, to, link_type, link_source), so re-running over the same corpus silently skips duplicates without creating redundant edges.

Why did my citation graph run report failure?

The run fails if the verification graph-query walk from a hub document returns no typed edges. Common causes are wrong source scope, slug mismatches, or a typo in the --type filter, since type matching is exact.

How is citation-graph-ingest different from citation-fixer?

citation-fixer repairs citation formatting inside the brain's own pages and never creates graph edges. citation-graph-ingest builds a typed edge graph over an ingested third-party corpus using the native links table.