Loading...
Loading...
Compare original and translation side by side
Entity: { id, type, properties, relations, created, updated }
Relation: { from_id, relation_type, to_id, properties }Entity: { id, type, properties, relations, created, updated }
Relation: { from_id, relation_type, to_id, properties }| Trigger | Action |
|---|---|
| "Remember that..." | Create/update entity |
| "What do I know about X?" | Query graph |
| "Link X to Y" | Create relation |
| "Show all tasks for project Z" | Graph traversal |
| "What depends on X?" | Dependency query |
| Planning multi-step work | Model as graph transformations |
| Skill needs shared state | Read/write ontology objects |
| 触发词 | 对应操作 |
|---|---|
| "Remember that..." | 创建/更新实体 |
| "What do I know about X?" | 查询图 |
| "Link X to Y" | 创建关系 |
| "Show all tasks for project Z" | 图遍历 |
| "What depends on X?" | 依赖查询 |
| 规划多步骤工作 | 建模为图转换 |
| 技能需要共享状态 | 读写本体对象 |
undefinedundefinedundefinedundefinedmemory/ontology/graph.jsonl{"op":"create","entity":{"id":"p_001","type":"Person","properties":{"name":"Alice"}}}
{"op":"create","entity":{"id":"proj_001","type":"Project","properties":{"name":"Website Redesign","status":"active"}}}
{"op":"relate","from":"proj_001","rel":"has_owner","to":"p_001"}memory/ontology/graph.jsonl{"op":"create","entity":{"id":"p_001","type":"Person","properties":{"name":"Alice"}}}
{"op":"create","entity":{"id":"proj_001","type":"Project","properties":{"name":"Website Redesign","status":"active"}}}
{"op":"relate","from":"proj_001","rel":"has_owner","to":"p_001"}python3 scripts/ontology.py create --type Person --props '{"name":"Alice","email":"alice@example.com"}'python3 scripts/ontology.py create --type Person --props '{"name":"Alice","email":"alice@example.com"}'python3 scripts/ontology.py query --type Task --where '{"status":"open"}'
python3 scripts/ontology.py get --id task_001
python3 scripts/ontology.py related --id proj_001 --rel has_taskpython3 scripts/ontology.py query --type Task --where '{"status":"open"}'
python3 scripts/ontology.py get --id task_001
python3 scripts/ontology.py related --id proj_001 --rel has_taskpython3 scripts/ontology.py relate --from proj_001 --rel has_task --to task_001python3 scripts/ontology.py relate --from proj_001 --rel has_task --to task_001python3 scripts/ontology.py validate # Check all constraintspython3 scripts/ontology.py validate # Check all constraintsmemory/ontology/schema.yamltypes:
Task:
required: [title, status]
status_enum: [open, in_progress, blocked, done]
Event:
required: [title, start]
validate: "end >= start if end exists"
Credential:
required: [service, secret_ref]
forbidden_properties: [password, secret, token] # Force indirection
relations:
has_owner:
from_types: [Project, Task]
to_types: [Person]
cardinality: many_to_one
blocks:
from_types: [Task]
to_types: [Task]
acyclic: true # No circular dependenciesmemory/ontology/schema.yamltypes:
Task:
required: [title, status]
status_enum: [open, in_progress, blocked, done]
Event:
required: [title, start]
validate: "end >= start if end exists"
Credential:
required: [service, secret_ref]
forbidden_properties: [password, secret, token] # Force indirection
relations:
has_owner:
from_types: [Project, Task]
to_types: [Person]
cardinality: many_to_one
blocks:
from_types: [Task]
to_types: [Task]
acyclic: true # No circular dependenciesundefinedundefinedundefinedundefinedPlan: "Schedule team meeting and create follow-up tasks"
1. CREATE Event { title: "Team Sync", attendees: [p_001, p_002] }
2. RELATE Event -> has_project -> proj_001
3. CREATE Task { title: "Prepare agenda", assignee: p_001 }
4. RELATE Task -> for_event -> event_001
5. CREATE Task { title: "Send summary", assignee: p_001, blockers: [task_001] }Plan: "Schedule team meeting and create follow-up tasks"
1. CREATE Event { title: "Team Sync", attendees: [p_001, p_002] }
2. RELATE Event -> has_project -> proj_001
3. CREATE Task { title: "Prepare agenda", assignee: p_001 }
4. RELATE Task -> for_event -> event_001
5. CREATE Task { title: "Send summary", assignee: p_001, blockers: [task_001] }undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedreferences/schema.mdreferences/queries.mdreferences/schema.mdreferences/queries.md