Add or update an entity
Get entity by ID
Query entities
Optional options: KnowledgeQueryOptionsAdd or update a relation
Get relations for an entity
Optional options: { Optional direction?: "both" | "outgoing" | "incoming"Optional types?: RelationType[]Record an episodic memory. A memory trace's copy (a context that names the trace, memoryTraceId) carries the
trace id (traceId, indexed) and replaces the copy recorded for the trace before.
Get memory by ID
Delete the episodic memories that copy the filter's traces or scopes. A trace's copies are read through their
trace id (traceId, indexed); the first delete by trace id of this graph first gives the copies an older release
recorded their trace id (backfillCopyTraceIds). While that pass fails, a delete by trace id also reads the
copies that carry no trace id by the text their stored context JSON must hold ("memoryTraceId":"<id>") and
matches them exactly in code. A scope's copies are read by the text their stored context
JSON must hold (CONTAINS) and matched exactly in code, so a malformed context_json is skipped rather than
failing the delete.
Query episodic memories
Optional options: { Optional types?: ("error" | "success" | "discovery" | "conversation" | "task" | "interaction")[]Optional participants?: string[]Optional minOptional timeOptional from?: stringOptional to?: stringOptional limit?: numberRecall relevant memories (updates access count)
Optional topK: numberTraverse the graph from a starting entity
Optional options: TraversalOptionsFind shortest path between two entities
Optional maxDepth: numberGet neighborhood of an entity
Optional depth: numberSemantic search across entities and memories
Extract entities and relations from text
Optional _options: { Optional extractOptional entityMerge duplicate entities
Get knowledge graph statistics
Interface for the Knowledge Graph system