lbb_decode
Identify the relation between two entities in a knowledge graph. Resolves types automatically and narrows candidates, using a model when multiple relations are possible. Use to fill edge labels, verify relationships, or build triples.
Instructions
Name the relation between two entities. The database narrows the candidates to the relations its type signatures admit for the (source type, target type) pair; if the pair admits exactly one, the database answers alone (mode: forced, no model call). Otherwise a small model fine-tuned on this graph's own edges picks from the narrowed set (mode: model_narrowed), constrained to real vocabulary so it can only emit a relation that can exist. You can OMIT the types — pass just the names and the database recovers each type by resolving the name to a real entity (echoed in resolved_source/resolved_target). Use it to fill a missing edge label, verify a relationship, or assemble structured triples. Returns the relation, the admissible candidates, and signature_forced.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| graph | No | Graph to target; defaults to the connection's graph | |
| branch | No | Branch to target; defaults to the connection's branch | |
| detail | No | Response detail level. Defaults to compact. | |
| source_name | Yes | Source entity display name | |
| source_type | No | Source entity type; omit to have the DB recover it from the name | |
| target_name | Yes | Target entity display name | |
| target_type | No | Target entity type; omit to have the DB recover it from the name | |
| use_model_when_forced | No | Call the model even when the type pair forces one relation (default false — a forced pair is answered by the DB alone) |