| title | Knowledge Graph |
|---|---|
| description | Implementation reference for Signet's scoped ontology and graph traversal layer. |
| order | 3 |
| section | Core Concepts |
The knowledge graph is Signet's scoped ontology storage and traversal layer. It organizes raw memories, structured remember payloads, source artifacts, and reviewed ontology operations into entities, aspects, grouped claim slots, attributes, dependencies, proposals, and assertions.
For the conceptual model, see KNOWLEDGE-ARCHITECTURE.md. This document is the implementation reference.
The base graph schema starts in migration 019 and is extended by later migrations.
Top-level graph nodes. Important fields include:
idnamecanonical_nameentity_typeagent_iddescriptionmentionspinnedpinned_atstatusarchived_at,archived_by,archive_reasonproposal_idproposal_evidencelast_synthesized_at- timestamps
ENTITY_TYPES is defined in platform/core/src/types.ts and currently includes
people, projects, systems, tools, concepts, skills, tasks, sources, artifacts,
agents, policies, actions, workflows, events, object types, interfaces,
observations, claim slots, claim values, and unknown.
List queries filter to agent_id and active rows, then sort pinned entities
first:
ORDER BY e.pinned DESC, e.pinned_at DESC, e.mentions DESC, e.updated_at DESC, e.name ASCNamed dimensions under an entity. Important fields include:
identity_idagent_idnamecanonical_nameweightstatus- archive fields
- proposal fields
- timestamps
Aspects are unique on (entity_id, canonical_name). Traversal reads active
aspects ordered by weight DESC.
Stored facts and constraints under an aspect. Important fields include:
idaspect_idagent_idmemory_idkind:attributeorconstraintcontentnormalized_contentgroup_keyclaim_keyconfidenceimportancestatus:active,superseded, ordeletedsuperseded_byversionversion_root_idprevious_attribute_id- archive fields
- source provenance fields
- proposal fields
- timestamps
group_key and claim_key are the navigation and update identity layer:
entity -> aspect -> group_key -> claim_key -> attribute versions
When group_key is missing, navigation treats the row as part of general.
When claim_key is present, claim history and supersession are scoped to that
specific claim slot instead of the whole aspect.
Directed cross-entity edges. Important fields include:
idsource_entity_idtarget_entity_idagent_idaspect_iddependency_typestrengthconfidencereasonstatus- archive fields
- source provenance fields
- proposal fields
- timestamps
DependencyType is defined in platform/core/src/types.ts. Traversal currently
uses outgoing dependency edges and gates them by both:
confidence * strength >= minDependencyStrength
confidence >= minConfidence
related_to edges require a non-empty reason. Migration 050 adds
entity_dependency_history, an append-only audit table populated by triggers
for dependency insert, update, and delete events.
Task lifecycle metadata keyed by entity_id. It stores status, expires_at,
retention_until, and completed_at for entities whose lifecycle should behave
like a task rather than durable background knowledge.
Proposal and operation history. Pending proposals are review queues; applied rows are audit records for direct operation handlers. Fields include:
operationstatus:pending,applied,rejected, orfailedpayloadconfidencerationaleevidencerisk- source provenance
created_by,applied_by,rejected_byresult- timestamps
The daemon operation handlers can run in three modes:
- dry-run: validate and preview without mutation
- apply: mutate graph rows and write an applied proposal row
- propose: write pending proposal rows for later review
Attribution records for statements that should not automatically become current ontology truth. Fields include:
subject_entity_id- optional
claim_attribute_id predicate:claims,believes,observed,decided,prefers,denies, orquestionscontentspeakerasserted_atconfidenceevidence- source provenance
status:active,archived, orsupersededsupersedes_assertion_id- archive fields
- timestamps
Assertions can be linked to current claim attributes, but they remain a separate evidence/attribution layer.
Source: platform/daemon/src/pipeline/graph-transactions.ts
txPersistStructured writes caller-provided structured data from the remember
API. It:
- persists extracted entity triples through
txPersistEntities; - upserts mentioned entities;
- upserts aspects by
(entity_id, canonical_name); - inserts attributes with optional
groupKeyandclaimKey; - links rows to the source memory through
memory_idandmemory_entity_mentions; - supersedes likely conflicting sibling attributes in the same
aspect_id + group_key + claim_keyslot; - creates low-strength
related_todependencies between co-occurring structured entities.
If the source memory is decision-like, structured attributes are promoted to
kind = 'constraint'; otherwise they are normal attributes.
txPersistEntities persists extracted source/relationship/target triples into
entities, the older relations table, and memory_entity_mentions.
This path links memories to entities and maintains mention counts. It does not create aspect or attribute rows by itself.
Background extraction graph writes are controlled by
memory.pipelineV2.graph.extractionWritesEnabled, which defaults to false.
Keeping graph traversal enabled does not necessarily mean the async extractor is
allowed to author ontology structure.
Source: platform/daemon/src/ontology-proposals.ts
The control plane applies or proposes graph operations such as:
create_entityadd_claim_valueset_claim_valuerename_entityarchive_entitycreate_aspectrename_aspectarchive_aspectarchive_claim_valuerestore_claim_versioncreate_linkupdate_linkarchive_linkmerge_entitiessupersede_claim_value- policy, action type, and interface operations
These handlers are the preferred path for explicit ontology maintenance because they validate inputs, preserve provenance, update version lineage, and leave an audit row.
Source: platform/daemon/src/pipeline/graph-traversal.ts
Traversal resolves focal entities, walks a bounded subgraph, and returns memory IDs plus structural metadata for recall.
resolveFocalEntities gathers entities in this order:
- pinned entities, unless disabled;
- checkpoint entity IDs, when supplied;
- project-path matches against project entities;
- query-token matches using
entities_ftswhen available, with LIKE fallback; - session-key fallback as source metadata when no entity resolves.
Pinned entities are merged into the focal set, not used as a replacement for query or project matches.
TraversalConfig controls the walk:
| Field | Meaning |
|---|---|
scope |
Optional memory scope filter |
maxAspectsPerEntity |
Active aspects per entity, ordered by weight |
maxAttributesPerAspect |
Attribute memory IDs per aspect |
maxDependencyHops |
Historical config field; current walk uses branching and path budgets |
minDependencyStrength |
Minimum combined confidence * strength |
maxBranching |
Max outgoing edges per focal entity |
maxTraversalPaths |
Total memory ID budget |
minConfidence |
Minimum edge confidence |
timeoutMs |
Hard deadline |
aspectFilter |
Optional aspect-name filter for on-demand expansion |
For each entity, traversal:
- collects active constraints across all active aspects;
- fetches top active aspects by
weight DESC; - collects active attribute
memory_idvalues byimportance DESC; - falls back to
memory_entity_mentionsif attributes do not yield enough memory IDs; - follows qualifying outgoing dependencies from the focal entity set;
- records memory paths for feedback propagation and telemetry.
The result includes:
memoryIdsmemoryScoresmemoryPathsconstraintsentityCounttimedOutactiveAspectIdsfocalEntityIds
Recall merges this graph result with vector, FTS, hint, structured-evidence, reranker, dampening, and context-construction stages.
Source: platform/daemon/src/pipeline/aspect-feedback.ts
Aspect feedback is driven by session outcomes. FTS overlap can increase aspect weights when previously injected memories later match full-text searches. Aspect decay lowers stale weights toward a configured floor.
Source: platform/daemon/src/pipeline/supersession.ts
Supersession detects and marks conflicting active sibling attributes. Structured remember does this at write time for matching claim slots. Maintenance can also catch older contradictions. Constraints are not automatically superseded by this heuristic.
Source: platform/daemon/src/knowledge-graph-hygiene.ts
Hygiene reporting is read-only. It surfaces suspicious entities, duplicate canonical groups, missing group/claim/source fields, and safe known-entity mention candidates.
Read-oriented graph endpoints live in platform/daemon/src/routes/knowledge-routes.ts.
| Endpoint | Method | Purpose |
|---|---|---|
/api/knowledge/entities |
GET | List active entities with structural counts |
/api/knowledge/navigation/entities |
GET | Alias for paginated entity navigation |
/api/knowledge/navigation/entity |
GET | Resolve an entity by name |
/api/knowledge/navigation/tree |
GET | Entity -> aspect -> group -> claim outline |
/api/knowledge/navigation/aspects |
GET | List aspects for an entity |
/api/knowledge/navigation/groups |
GET | List groups under an entity/aspect |
/api/knowledge/navigation/claims |
GET | List claims under an entity/aspect/group |
/api/knowledge/navigation/attributes |
GET | List attributes for a claim path |
/api/knowledge/entities/:id |
GET | Entity detail and counts |
/api/knowledge/entities/:id/aspects |
GET | Aspect counts |
/api/knowledge/entities/:id/aspects/:aspectId/attributes |
GET | Attributes for an aspect |
/api/knowledge/entities/:id/dependencies |
GET | Incoming and outgoing dependencies |
/api/knowledge/entities/:id/pin |
POST | Pin an entity, requires modify |
/api/knowledge/entities/:id/pin |
DELETE | Unpin an entity, requires modify |
/api/knowledge/entities/pinned |
GET | List pinned entities |
/api/knowledge/entities/health |
GET | Predictor comparison health by entity |
/api/knowledge/hygiene |
GET | Read-only hygiene report |
/api/knowledge/stats |
GET | Graph coverage and feedback stats |
/api/knowledge/communities |
GET | Community summaries |
/api/knowledge/traversal/status |
GET | Last traversal telemetry |
/api/knowledge/constellation |
GET | Dashboard graph payload |
/api/knowledge/expand |
POST | Entity expansion with related memory/session context |
/api/knowledge/expand/session |
POST | Session-summary expansion |
Ontology-control endpoints live in platform/daemon/src/routes/ontology-routes.ts.
| Endpoint family | Purpose |
|---|---|
/api/ontology/operations/* |
Apply, dry-run, or batch explicit ontology operations |
/api/ontology/proposals/* |
List, create, apply, reject, and inspect proposals |
/api/ontology/proposals/repair/* |
Duplicate and merge-plan helpers |
/api/ontology/claims/* |
Claim evidence, versions, and version reads |
/api/ontology/links/* |
Link evidence |
/api/ontology/assertions/* |
Epistemic assertion CRUD and lifecycle |
/api/ontology/extract |
Extract proposals/assertions from a source |
/api/ontology/consolidate |
Consolidate proposals with optional provider support |
Mutation endpoints require modify permission. Read endpoints require recall
permission when auth is enabled.
Recall-related endpoints also use graph data:
| Endpoint | Method | Graph role |
|---|---|---|
/api/memory/recall |
POST | Merges traversal candidates with recall candidates |
/api/memory/search |
GET | Search with entity context |
/api/embeddings/projection |
GET | Dashboard memory projection; graph overlay comes from /api/knowledge/constellation |
Read navigation:
signet knowledge entities
signet knowledge tree <entity>
signet knowledge aspects <entity>
signet knowledge groups <entity> <aspect>
signet knowledge claims <entity> <aspect> <group>
signet knowledge attributes <entity> <aspect> <group> <claim>
signet knowledge hygieneControl plane:
signet ontology entity ...
signet ontology claim ...
signet ontology aspect ...
signet ontology link ...
signet ontology stream apply ...
signet ontology assertion ...
signet ontology proposals ...
signet ontology extract ...
signet ontology consolidate ...Use --json on either command family for automation.
getKnowledgeGraphForConstellation in platform/daemon/src/knowledge-graph.ts
builds the dashboard graph. It fetches active entities, aspects, attributes,
dependencies, proposal overlays, and dreaming summaries within bounded limits.
The dashboard then converts that payload into entity, aspect, attribute, memory,
proposal, and relationship nodes.
Every graph read or write must be scoped by agent_id. Existing route defaults
to "default" are compatibility defaults at the boundary; internal logic should
thread the resolved agent ID through queries and mutations rather than relying
on a global graph.