Offer: Virgo is available for free to use within your infrastructure. Book a demo

Entity relationships

An entity on its own is a node. Relationships are the edges that connect nodes, and they are what retrievers follow to move from a feature to the decision behind it, or from a person to the work they shaped.

Declaring a relation

A relation is a class decorated with @relation, extending DataSourceRelation, that names the edge and its target entity.

Private preview

The Python SDK is in private preview, so APIs may still change. Email sales@virgo.fyi for early access.

@relation(name="authored_by", to=GitUser)
class Author(DataSourceRelation):
    pass
 
@relation(name="reviewed_by", to=GitUser)
class ReviewedBy(DataSourceRelation):
    pass

Entities point at a relation by name through EntityRelationshipProperty:

reviewers = EntityRelationshipProperty(relation="reviewed_by", multiple=True)

Register the relations on your connector's relations list. A relation can carry its own properties when the edge itself holds data.

Within a source and across sources

These relations connect entities inside one source. Virgo also links entities across sources, so a GitHub pull request can connect to the Jira issue it resolves. See Cross-domain linking.