Skip to main content

Subjects & Entities

Every memory in the system is anchored to a Subject. This anchoring allows for precise filtering, multi-tenant isolation, and the construction of a rich Knowledge Graph.

What is a Subject?

A Subject is the "Who" or "What" a memory is about. It is defined by a unique combination of:

  • Type: The category of the entity (e.g., user, project, tenant).
  • ID: A unique string within that type (e.g., user_123, tenant_2024_01).
  • Display Name: A human-readable label (e.g., "Alice Smith").

Built-in Subject Types

The platform provides several standard types out of the box:

TypeDescription
UserIndividual people or stakeholders.
OrgCompanies, teams, or departments.
ProjectSpecific initiatives or workstreams.
ToolAI tools, agents, or external services.
ChannelCommunication hubs (Slack threads, emails).
DocumentSource files (PDFs, presentations).
TopicAbstract concepts (e.g., "Budget", "Security").

Custom Subject Types

Platforms can extend the domain model by defining Custom Subject Types in their PlatformConfig. This is essential for target industries:

  • Procurement: tenant, bidder, supplier, contract.
  • Legal: case, matter, litigant, judge.
  • Healthcare: patient, provider, treatment.

Example: Defining a Custom Subject

When you upsert a memory, you can simply use your custom type string. The system will automatically register it in the Graph as a node label.

client.memory.upsert(
subject={
"type": "tenant",
"id": "T-2025-X",
"display_name": "Cloud Migration RFP"
},
kind="fact",
content="The response deadline is June 1st."
)

Entity Relationships

Subjects are not isolated. They are connected via the Knowledge Graph. Common edges include:

  • WORKS_AT: User → Org
  • BELONGS_TO: Project → Org
  • MENTIONED_IN: User → Document
  • RELATED_TO: Custom relationship between any two subjects.

Next: Learn how to query these relationships in Search & Retrieval.