-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathGenesis.kip
More file actions
200 lines (190 loc) · 8.34 KB
/
Genesis.kip
File metadata and controls
200 lines (190 loc) · 8.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
// # KIP Genesis Capsule v1.0
// The foundational knowledge that bootstraps the entire Cognitive Nexus.
// It defines what a "Concept Type" and a "Proposition Type" are,
// by creating instances of them that describe themselves.
//
UPSERT {
// --- STEP 1: THE PRIME MOVER - DEFINE "$ConceptType" ---
// The absolute root of all knowledge. This node defines what it means to be a "type"
// of concept. It defines itself, creating the first logical anchor.
CONCEPT ?concept_type_def {
{type: "$ConceptType", name: "$ConceptType"}
SET ATTRIBUTES {
description: "Defines a class or category of Concept Nodes. It acts as a template for creating new concept instances. Every concept node in the graph must have a 'type' that points to a concept of this type.",
display_hint: "📦",
instance_schema: {
"description": {
"type": "string",
"is_required": true,
"description": "A human-readable explanation of what this concept type represents."
},
"display_hint": {
"type": "string",
"is_required": false,
"description": "A suggested icon or visual cue for user interfaces (e.g., an emoji or icon name)."
},
"instance_schema": {
"type": "object",
"is_required": false,
"description": "A recommended schema defining the common and core attributes for instances of this concept type. It serves as a 'best practice' guideline for knowledge creation, not a rigid constraint. Keys are attribute names, values are objects defining 'type', 'is_required', and 'description'. Instances SHOULD include required attributes but MAY also include any other attribute not defined in this schema, allowing for knowledge to emerge and evolve freely."
},
"key_instances": {
"type": "array",
"item_type": "string",
"is_required": false,
"description": "A list of names of the most important or representative instances of this type, to help LLMs ground their queries."
}
},
key_instances: [
"$ConceptType",
"$PropositionType",
"Domain",
"Event",
"Person",
"Preference",
"Insight",
"SleepTask"
]
}
}
// --- STEP 2: DEFINE "$PropositionType" USING "$ConceptType" ---
// With the ability to define concepts, we now define the concept of a "relation" or "predicate".
CONCEPT ?proposition_type_def {
{type: "$ConceptType", name: "$PropositionType"}
SET ATTRIBUTES {
description: "Defines a class of Proposition Links (a predicate). It specifies the nature of the relationship between a subject and an object.",
display_hint: "🔗",
instance_schema: {
"description": {
"type": "string",
"is_required": true,
"description": "A human-readable explanation of what this relationship represents."
},
"subject_types": {
"type": "array",
"item_type": "string",
"is_required": true,
"description": "A list of allowed '$ConceptType' names for the subject. Use '*' for any type."
},
"object_types": {
"type": "array",
"item_type": "string",
"is_required": true,
"description": "A list of allowed '$ConceptType' names for the object. Use '*' for any type."
},
"is_symmetric": {"type": "boolean", "is_required": false, "default_value": false},
"is_transitive": {"type": "boolean", "is_required": false, "default_value": false}
},
key_instances: [
"belongs_to_domain",
"involves",
"mentions",
"consolidated_to",
"derived_from",
"prefers",
"learned",
"assigned_to"
]
}
}
// --- STEP 3: DEFINE THE TOOLS FOR ORGANIZATION ---
// Now that we can define concepts and propositions, we create the specific
// concepts needed for organizing the knowledge graph itself.
// 3a. Define the "Domain" concept type.
CONCEPT ?domain_type_def {
{type: "$ConceptType", name: "Domain"}
SET ATTRIBUTES {
description: "Defines a high-level container for organizing knowledge. It acts as a primary category for concepts and propositions, enabling modularity and contextual understanding.",
display_hint: "🗺",
instance_schema: {
"description": {
"type": "string",
"is_required": true,
"description": "A clear, human-readable explanation of what knowledge this domain encompasses."
},
"display_hint": {
"type": "string",
"is_required": false,
"description": "A suggested icon or visual cue for this specific domain (e.g., a specific emoji)."
},
"scope_note": {
"type": "string",
"is_required": false,
"description": "A more detailed note defining the precise boundaries of the domain, specifying what is included and what is excluded."
},
"aliases": {
"type": "array",
"item_type": "string",
"is_required": false,
"description": "A list of alternative names or synonyms for the domain, to aid in search and natural language understanding."
},
"steward": {
"type": "string",
"is_required": false,
"description": "The name of the 'Person' (human or AI) primarily responsible for curating and maintaining the quality of knowledge within this domain."
}
},
key_instances: ["CoreSchema"]
}
}
// 3b. Define the "belongs_to_domain" proposition type.
CONCEPT ?belongs_to_domain_prop {
{type: "$PropositionType", name: "belongs_to_domain"}
SET ATTRIBUTES {
description: "A fundamental proposition that asserts a concept's membership in a specific knowledge domain.",
object_types: ["Domain"],
subject_types: ["*"]
}
}
// Any concept can belong to a domain.
// The object must be a Domain.
// 3c. Create a dedicated domain "CoreSchema" for meta-definitions.
// This domain will contain the definitions of all concept types and proposition types.
CONCEPT ?core_domain {
{type: "Domain", name: "CoreSchema"}
SET ATTRIBUTES { description: "The foundational domain containing the meta-definitions of the KIP system itself.", display_hint: "🧩" }
}
}
WITH METADATA {
source: "SystemBootstrap",
author: "$system",
confidence: 1.0,
status: "active"
}
// Post-Genesis Housekeeping
UPSERT {
// Assign all meta-definition concepts to the "CoreSchema" domain.
CONCEPT ?core_domain {
{type: "Domain", name: "CoreSchema"}
}
CONCEPT ?concept_type_def {
{type: "$ConceptType", name: "$ConceptType"}
SET PROPOSITIONS {
("belongs_to_domain", ?core_domain)
}
}
CONCEPT ?proposition_type_def {
{type: "$ConceptType", name: "$PropositionType"}
SET PROPOSITIONS {
("belongs_to_domain", ?core_domain)
}
}
CONCEPT ?domain_type_def {
{type: "$ConceptType", name: "Domain"}
SET PROPOSITIONS {
("belongs_to_domain", ?core_domain)
}
}
CONCEPT ?belongs_to_domain_prop {
{type: "$PropositionType", name: "belongs_to_domain"}
SET PROPOSITIONS {
("belongs_to_domain", ?core_domain)
}
}
}
WITH METADATA {
source: "SystemBootstrap",
author: "$system",
confidence: 1.0,
status: "active"
}