# Graph Retrieval

> Graph Retrieval is an Agent Skill for research published in the study8677/repobrain repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Exposes graph-based retrieval as a tool capability via `query_graph`. Reads normalized graph store files, builds a query-relevant subgraph, and returns LLM-friendly semantic triples with replayable evidence metadata.

- Skill name: `graph-retrieval`
- Category: [Research](https://www.openparable.com/skill/research/1)
- Source: https://github.com/study8677/repobrain/blob/HEAD/engine/repobrain_engine/skills/graph-retrieval/SKILL.md
- Repository: study8677/repobrain (1,296 GitHub stars when collected)

## SKILL.md

# Graph Retrieval Skill

## Purpose
Expose graph-based retrieval as a tool capability without breaking the
existing RepoBrain execution chain.

## Tool
- `query_graph(query, max_hops=2, workspace='.')`

## Behavior
- Reads normalized graph store files under `.repobrain/graph/`.
- Builds a query-relevant subgraph.
- Returns LLM-friendly semantic triples plus replayable evidence metadata.

## Output Contract
```json
{
  "summary": "...",
  "triples": [["subject", "predicate", "object"]],
  "evidence": [{"retrieval_id": "...", "tool_name": "..."}],
  "nodes": [...],
  "edges": [...]
}
```

## Design Notes
- Keeps tool-driven and replayable architecture.
- Does not bypass pipeline.
- Intended for structure/dependency questions and context enrichment.

---

Source: https://www.openparable.com/skill/research/graph-retrieval (OpenParable). Cite the canonical URL above.
