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

Data source entities

Entities are the nodes of the graph. Each one is a class decorated with @graph_entity, extending DataSourceEntity, whose fields are typed properties. Virgo uses those types to index, embed, and canonicalize the entity.

Private preview

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

@graph_entity(name="pull_request", aliases=["PR", "MR"])
class PullRequest(DataSourceEntity):
    pr_id = EntityIdProperty(description="Pull request ID")
    title = EntityStringProperty(index=True, vectorize=True)
    status = EntityStringProperty(index=True)
    created_at = EntityDateTimeProperty()
    repository = EntityRelationshipProperty(relation="in_repository")
    reviewers = EntityRelationshipProperty(relation="reviewed_by", multiple=True)

Field types

Properties carry the type and intent of each field. The common ones are EntityIdProperty, EntityStringProperty, EntityEmailProperty, EntityUrlProperty, EntityDateTimeProperty, EntityIntegerProperty, EntityBooleanProperty, and EntityArrayProperty.

Field flags

Flags tell Virgo how to use a field:

  • EntityIdProperty marks the identifier Virgo uses to canonicalize records, so the same pull request collapses into one node no matter how often it is seen.
  • index=True makes a field filterable in the graph.
  • vectorize=True embeds it for semantic retrieval.
  • keywords=True adds it to keyword search.
  • EntityRelationshipProperty(relation=..., multiple=...) points the entity at other entities through a named relation.

Register the entity on your connector's entities list. See Defining your data source.