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:
| Type | Description |
|---|---|
| User | Individual people or stakeholders. |
| Org | Companies, teams, or departments. |
| Project | Specific initiatives or workstreams. |
| Tool | AI tools, agents, or external services. |
| Channel | Communication hubs (Slack threads, emails). |
| Document | Source files (PDFs, presentations). |
| Topic | Abstract 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 → OrgBELONGS_TO: Project → OrgMENTIONED_IN: User → DocumentRELATED_TO: Custom relationship between any two subjects.
Next: Learn how to query these relationships in Search & Retrieval.