Skip to content

Guide · Agent skill

How to use the Citation Graph Ingest agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The citation-graph-ingest skill is a set of instructions that teaches an AI agent to find where one document cites another in a collection, decide what kind of relationship that is (such as overrules, distinguishes or relies_on), and store those relationships as typed links in the gbrain knowledge store. It is useful for teams and researchers who work with legal, academic, patent or regulatory documents and need to trace arguments across many files. After this guide you will know what the skill does, how to install it, how to ask for it in plain language, and what it requires.

Citation Graph Ingestgarrytan/gbrain · MIT

Quick start

  1. 1Set up gbrain and your corpus. Make sure gbrain is installed and the documents are ingested as a source using gbrain sources add with gbrain sync, or gbrain import.
  2. 2Install the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills in the Claude apps.
  3. 3Confirm the source scope. Set --source, GBRAIN_SOURCE or a .gbrain-source dotfile so every command runs under the same corpus source.
  4. 4Ask for a citation graph. Make a plain request such as build a citation graph over the documents in your source.
  5. 5Review the classified edges. Check the edge types the agent chose and the confidence it assigned, and remove any doubtful ones before relying on them.
  6. 6Verify with graph-query. Run gbrain graph-query on a hub document with --direction in and confirm the typed edges appear.
  7. 7Run hygiene checks. Run gbrain link-sources and gbrain check-backlinks check to confirm the expected edge count and no orphaned references.

What is an agent skill, and what does this one do?

An agent skill is a folder containing a SKILL.md file. The file tells an AI agent how to carry out a specific task. This skill is written for gbrain and assumes your documents are already ingested as a gbrain source.

Plain similarity search finds documents that look alike but cannot tell you that one document overrules another. This skill adds that missing layer. It reads the citations between documents, classifies each edge by type, and writes the edges with the gbrain link command so they can be traversed later.

  • Detects candidate mentions where one document references another, such as markdown links, exact title matches, docket numbers, DOIs or section references.
  • Uses the agent's judgment to classify each relationship, or to reject it as incidental. Detection alone never decides the type.
  • Writes each kept edge as a typed link with the provenance tag citation-graph.
  • Lets you query the chain of references afterwards, for example everything a brief relies on that has not since been overruled.

Install the citation-graph-ingest skill

Download the skill ZIP from this page. Then choose one of the two install routes below.

For Claude Code, unzip the file into your personal skills folder ~/.claude/skills/ or into a project's .claude/skills/ folder. The skill folder should contain SKILL.md.

In the Claude apps, you can instead upload the ZIP under Settings → Capabilities → Skills.

  • Personal install: ~/.claude/skills/ (available across your projects).
  • Project install: .claude/skills/ inside the project folder (shared with anyone using that project).
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP.

Check your requirements before you start

The skill does not work on its own. It depends on gbrain and its links table, the gbrain link command and graph-query commands. Your corpus must already be ingested as a gbrain source, using gbrain sources add with gbrain sync, or gbrain import. The agent must also be able to read SKILL.md files.

Scope every command to one source. You can set this with --source <name>, the GBRAIN_SOURCE environment variable, or a .gbrain-source dotfile. This keeps edges from spreading across sources.

  • gbrain with its links table, gbrain link and graph-query commands.
  • A corpus already ingested as a gbrain source (gbrain sources add, gbrain sync or gbrain import).
  • An AI agent capable of reading SKILL.md files.

How to trigger the skill with natural requests

You do not need special syntax. Ask for the outcome in plain words. The skill's trigger phrases include citation graph, citation graph ingest, typed citation graph, build a reference graph, graph over a corpus, and trace the argument through these documents.

Be specific about the corpus and the source name so the agent scopes its work correctly.

  • "Build a citation graph over the documents in the patents source."
  • "Build a reference graph for the case law in my legal-briefs source."
  • "Trace the argument through these documents and record which papers overrule or distinguish each other."
  • "Run citation graph ingest on the regulatory filings source, and check the graph from doc-a-foundation."

What the agent does, step by step

The skill runs a pipeline of native gbrain operations. It uses no scripts. First it confirms the source scope. Next it finds candidate mentions, then classifies each candidate pair, then writes the edges one at a time. Finally it verifies the result with a graph walk.

Edge direction points from the citing document to the cited document. So if doc-c overrules doc-a, doc-c is the newer authority that displaces doc-a. The skill also recommends testing 3 to 5 edges before running the full corpus.

  • Preflight: confirm the corpus is a gbrain source and the scope is set.
  • Detect: find textual references between documents. This step never decides the relationship.
  • Classify: pick one edge type or none, with a confidence. Edges below your confidence floor are dropped; 0.5 is the suggested default.
  • Write: call gbrain link with --link-type and --link-source citation-graph.
  • Verify: run graph-query from a hub document. If it returns nothing, the run is reported as failed.
  • Hygiene: check gbrain link-sources and gbrain check-backlinks check.
gbrain link doc-b-example doc-a-example --link-type extends --link-source citation-graph --context "Doc B adopts Doc A's framework and applies it to a new domain" --source <corpus-source>

Check the graph with a verification walk

After writing edges, query the incoming links of a hub document. These commands are the verification gate the skill uses. Use the same --source value you used when writing.

Keep link_type spelled exactly the same everywhere. The graph-query --type filter is an exact match, so relies_on and relies-on produce two different graphs.

gbrain graph-query doc-a-example --direction in --source <corpus-source> gbrain graph-query doc-a-example --type overrules --direction in --source <corpus-source>

Safety notes: scripts, network and untrusted documents

The skill runs no scripts and uses no network access, according to its listing. Its work happens through gbrain commands on your local store.

The documents are third-party data. The skill is written so that an instruction inside a document, such as a sentence telling the reader to cite something as overruling another file, does not decide the edge type. The classification depends on what the citation actually does in its context.

Edge types are model judgments. The pipeline has been validated only on a synthetic 4-document fixture, not on a large production corpus. Keep a human reviewer in the loop for any legal or compliance decision.

  • Runs scripts: no.
  • Uses network: no.
  • Writes pages: no. Its only durable writes are typed edges in the links table.

Limits to know about

Natural-language relational queries do not use these edges yet. The relational-recall part of gbrain query walks a fixed set of edge types that does not include citation types such as overrules or relies_on. Use explicit graph-query commands instead. Do not expect a question like "is doc A still authoritative?" to walk these edges through gbrain query.

The skill adds no new storage. It does not create new tables or migrations.

  • Use graph-query for citation edges, not natural-language gbrain query.
  • Not useful as a replacement for simple similarity search.

What people use it for

  • Tracing which court decisions a legal brief relies on, and which of those have since been overruled.
  • Showing which academic papers in a corpus extend, refute or supersede others.
  • Mapping how patents or regulatory filings reference each other across a collection.
  • Building reference-aware retrieval for developers who already use gbrain.

Frequently asked questions

How do I install the citation-graph-ingest skill?

Download the skill ZIP from this page and unzip it into ~/.claude/skills/ for personal use or a project's .claude/skills/ folder for shared use. In the Claude apps, you can upload the ZIP under Settings → Capabilities → Skills instead.

What do I need before using this skill?

You need gbrain with its links table, gbrain link and graph-query commands, a corpus already ingested as a gbrain source, and an AI agent that can read SKILL.md files. The skill does not work without gbrain.

Is the citation-graph-ingest skill free?

The listing shows the licence as MIT. The source does not state any price, so check the page and the repository for the terms that apply to you.

Does the skill run scripts or use the internet?

According to its listing, it runs no scripts and uses no network access. It works through native gbrain commands on your local store.

Can I use this skill for legal decisions?

The source says edge types are model judgments validated only on a synthetic 4-document fixture. It should not be relied on for legal or compliance decisions without human review.

Why doesn't gbrain query use my citation edges?

Natural-language relational recall walks a fixed set of edge types that does not include citation types like overrules or relies_on. Use gbrain graph-query with --type to walk citation edges instead.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits teams and researchers who already run gbrain and need typed reference chains across legal, academic, patent or regulatory documents, and who will review the results. If you do not use gbrain, or you only need simple similarity search, pick a different tool, because the skill depends on gbrain's link and graph-query commands and does not improve on basic search.

Download the skill