Get a graph neighbourhood
get_graph_neighborhoodReturn all connected nodes, edges, and predicates within a configurable hop depth. Filter by type or predicate to answer what passages, people, places, or themes link to a node.
Instructions
Everything within N hops of a document, WITH the edges that connect them and the predicate on each. Useful for asking what a passage, person or theme is connected to without fetching each document.
Filter with type to ask a shaped question — the places near an event, the people in an epoch — and with predicate to keep only one kind of edge. Depth 1 is direct links; depth 3 gets large quickly and is capped. See get_vocabulary for what each predicate means.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Document path, e.g. "people/david" or "themes/faith" | |
| type | No | Keep only neighbours of this type: Person, Place, Theme, Lexeme, Commandment, Event, Epoch, Book, Chapter, Source, Dataset, Relation Vocabulary. | |
| depth | No | How many hops out from the starting document. Defaults to 1. Capped at 3 — the graph fans out fast. | |
| limit | No | Cap on nodes returned. Defaults to 200, capped at 600. The response sets `truncated` when it bites. | |
| predicate | No | Keep only edges with this predicate, e.g. "develops". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| root | Yes | ||
| count | Yes | ||
| depth | Yes | ||
| edges | Yes | ||
| nodes | Yes | ||
| licence | No | ||
| edgeCount | Yes | ||
| truncated | Yes |