@misterscan/sesi 1.2.3 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/rules/sesi-must-read.md +116 -0
- package/.agents/workflows/create-sesi-script.md +44 -0
- package/.agents/workflows/fix-sesi-script.md +14 -0
- package/.github/prompts/MakeInSesi.prompt.md +79 -0
- package/README.md +163 -51
- package/bin/sesi.js +196 -38
- package/chatbot/chatbot.html +488 -0
- package/{main → chatbot}/chatbot.sesi +1 -2
- package/chatbot/chatbot_server.py +105 -0
- package/chatbot/sesi_db_chatbot.sesi +278 -0
- package/dist/ai-runtime.js +2 -2
- package/dist/builtins.d.ts.map +1 -1
- package/dist/builtins.js +199 -5
- package/dist/builtins.js.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +90 -6
- package/dist/index.js.map +1 -1
- package/dist/interpreter.d.ts +21 -2
- package/dist/interpreter.d.ts.map +1 -1
- package/dist/interpreter.js +201 -92
- package/dist/interpreter.js.map +1 -1
- package/dist/lexer.d.ts.map +1 -1
- package/dist/lexer.js +8 -4
- package/dist/lexer.js.map +1 -1
- package/dist/parser.d.ts +1 -0
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +21 -12
- package/dist/parser.js.map +1 -1
- package/dist/sesi.bundled.js +2526 -1487
- package/dist/types.d.ts +14 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +33 -1
- package/dist/types.js.map +1 -1
- package/docs/ARCHITECTURE.md +21 -13
- package/docs/BUILTINS.md +136 -19
- package/docs/CLI.md +200 -0
- package/docs/COMPARISON.md +16 -13
- package/docs/IMAGE_GENERATION.md +13 -14
- package/docs/IMPLEMENTATION_SUMMARY.md +174 -110
- package/docs/QUICKSTART.md +173 -39
- package/docs/README.md +202 -54
- package/docs/{SYSTEMS_REASONING.md → REASONING.md} +115 -120
- package/docs/ROADMAP.md +51 -47
- package/docs/SKILLS.md +73 -98
- package/docs/SPECIFICATION.md +59 -40
- package/examples/03_functions.sesi +30 -1
- package/examples/07_prompts.sesi +27 -3
- package/examples/08_model_call.sesi +6 -4
- package/examples/09_structured_output.sesi +19 -3
- package/examples/10_code_generation.sesi +6 -4
- package/examples/11_memory_conversation.sesi +47 -15
- package/examples/12_classification.sesi +62 -7
- package/examples/13_data_pipeline.sesi +55 -28
- package/examples/14_folder_explainer.sesi +52 -51
- package/examples/15_image_generation.sesi +15 -14
- package/examples/16_modules.sesi +27 -27
- package/examples/19_search_web.sesi +18 -2
- package/examples/20_model_aliases.sesi +22 -0
- package/examples/21_custom_tools.sesi +27 -0
- package/examples/22_reasoning_plus_custom_tools.sesi +19 -0
- package/main/tests/test-args.sesi +7 -0
- package/main/tests/test_args.sesi +7 -0
- package/main/tests/test_general_modules.sesi +127 -0
- package/main/tests/test_grounding.sesi +2 -0
- package/package.json +26 -22
- package/docs/DISTRIBUTED_SYSTEMS.md +0 -71
- package/docs/sesi_ai_chronicles.md +0 -209
- package/main/conversational_classifier_weights.json +0 -45
- package/main/conversational_sentences.json +0 -304
- package/main/epochs.sesi +0 -94
- package/main/gpu_orchestrator.sesi +0 -36
- package/main/hardware_diagnostics.sesi +0 -118
- package/main/inference.sesi +0 -54
- package/main/native_chatbot.sesi +0 -180
- package/main/native_synthesizer.sesi +0 -83
- package/main/nn_personas_trainer.sesi +0 -302
- package/main/nn_responses_trainer.sesi +0 -269
- package/main/nn_sentences_trainer.sesi +0 -330
- package/main/orchestrator.sesi +0 -15
- package/main/personas.json +0 -124
- package/main/personas_classifier_weights.json +0 -45
- package/main/playground.sesi +0 -3
- package/main/predictive_typing.sesi +0 -127
- package/main/query_brain.sesi +0 -45
- package/main/response_classifier_weights.json +0 -45
- package/main/retro_chat.html +0 -239
- package/main/retro_chat_generator.sesi +0 -745
- package/main/sesi_ai.sesi +0 -158
- package/main/sesi_db_chatbot.sesi +0 -280
- package/main/setup_swarm.sesi +0 -5
- package/main/start.sesi +0 -13
- package/main/terminal.log +0 -56
- package/main/terminal_chat.py +0 -385
- package/main/unified_sesi_ai.sesi +0 -334
- package/main/varied_responses.json +0 -304
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
// Sesi Script: nn_sentences_trainer.sesi
|
|
2
|
-
// 🧠 NATIVE NEURAL NETWORK SENTENCE CLASSIFIER (TRAINED ON PERSONAS)
|
|
3
|
-
// Trains a 10x3 synapse network on the 20 personas inside main/personas.json,
|
|
4
|
-
// then zero-shot classifies all 300 conversational sentences in main/conversational_sentences.json!
|
|
5
|
-
|
|
6
|
-
print "=================================================="
|
|
7
|
-
print "🧠 INITIATING Sesi NEURAL DIALOGUE CLASSIFIER"
|
|
8
|
-
print "=================================================="
|
|
9
|
-
|
|
10
|
-
// Custom integer floor function
|
|
11
|
-
fn floor(x) {
|
|
12
|
-
let s = str(x)
|
|
13
|
-
let parts = split(s, ".")
|
|
14
|
-
return num(parts[0])
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Fast Sigmoid (Softsign) activation
|
|
18
|
-
fn activate(x) {
|
|
19
|
-
let absX = x
|
|
20
|
-
if x < 0.0 {
|
|
21
|
-
absX = 0.0 - x
|
|
22
|
-
}
|
|
23
|
-
return 0.5 + (0.5 * (x / (1.0 + absX)))
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
fn activate_derivative(y) {
|
|
27
|
-
return y * (1.0 - y)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// 1. Define 10-keyword Vocabulary for Bag-of-Words vectors
|
|
31
|
-
let vocab = ["synthesizer", "vinyl", "record", "wood", "gears", "clock", "compiler", "framework", "memory", "offline"]
|
|
32
|
-
print "📚 Vocabulary Features: " + str(vocab)
|
|
33
|
-
|
|
34
|
-
// 2. Load 20 Personas Database
|
|
35
|
-
print "📂 Loading main/personas.json dataset..."
|
|
36
|
-
let raw_personas = read_file("main/personas.json")
|
|
37
|
-
let parsed_personas = from_json(raw_personas)
|
|
38
|
-
let personas = parsed_personas["personas"]
|
|
39
|
-
let num_personas = len(personas)
|
|
40
|
-
print "👥 Loaded " + str(num_personas) + " personas."
|
|
41
|
-
|
|
42
|
-
// Helper to determine persona category class natively
|
|
43
|
-
fn get_persona_category(persona) {
|
|
44
|
-
let p = persona["personality"]
|
|
45
|
-
let t = persona["tone"]
|
|
46
|
-
let combined = p + " " + t
|
|
47
|
-
let words = split(combined, " ")
|
|
48
|
-
let w_len = len(words)
|
|
49
|
-
|
|
50
|
-
let w = 0
|
|
51
|
-
while w < w_len {
|
|
52
|
-
let word = words[w]
|
|
53
|
-
if word == "synthesizer" { return "audio" }
|
|
54
|
-
if word == "vinyl" { return "audio" }
|
|
55
|
-
if word == "record" { return "audio" }
|
|
56
|
-
if word == "jazz" { return "audio" }
|
|
57
|
-
if word == "beatmaker" { return "audio" }
|
|
58
|
-
if word == "music" { return "audio" }
|
|
59
|
-
if word == "audio" { return "audio" }
|
|
60
|
-
if word == "chiptune" { return "audio" }
|
|
61
|
-
|
|
62
|
-
if word == "wood" { return "mechanical" }
|
|
63
|
-
if word == "furniture" { return "mechanical" }
|
|
64
|
-
if word == "watch" { return "mechanical" }
|
|
65
|
-
if word == "clock" { return "mechanical" }
|
|
66
|
-
if word == "gears" { return "mechanical" }
|
|
67
|
-
if word == "Game" { return "mechanical" }
|
|
68
|
-
if word == "Boy" { return "mechanical" }
|
|
69
|
-
if word == "botanist" { return "mechanical" }
|
|
70
|
-
if word == "architect" { return "mechanical" }
|
|
71
|
-
w = w + 1
|
|
72
|
-
}
|
|
73
|
-
return "systems"
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// 3. Compile inputs and targets from Personas
|
|
77
|
-
print "🧹 Processing persona bio descriptions into training matrices..."
|
|
78
|
-
let inputs = []
|
|
79
|
-
let targets = []
|
|
80
|
-
|
|
81
|
-
let p_idx = 0
|
|
82
|
-
while p_idx < num_personas {
|
|
83
|
-
let p = personas[p_idx]
|
|
84
|
-
let bio = p["personality"] + " " + p["tone"]
|
|
85
|
-
let words = split(bio, " ")
|
|
86
|
-
let w_len = len(words)
|
|
87
|
-
|
|
88
|
-
// 10-dimensional input vector
|
|
89
|
-
let x = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
|
|
90
|
-
|
|
91
|
-
let v_idx = 0
|
|
92
|
-
while v_idx < 10 {
|
|
93
|
-
let keyword = vocab[v_idx]
|
|
94
|
-
let found = 0.0
|
|
95
|
-
let w = 0
|
|
96
|
-
while w < w_len {
|
|
97
|
-
let raw_word = words[w]
|
|
98
|
-
let word = raw_word
|
|
99
|
-
let w_char_len = len(word)
|
|
100
|
-
if w_char_len > 1 {
|
|
101
|
-
let last_char = word[w_char_len - 1]
|
|
102
|
-
if last_char == "." { word = split(word, ".")[0] }
|
|
103
|
-
if last_char == "," { word = split(word, ",")[0] }
|
|
104
|
-
}
|
|
105
|
-
if word == keyword {
|
|
106
|
-
found = 1.0
|
|
107
|
-
}
|
|
108
|
-
w = w + 1
|
|
109
|
-
}
|
|
110
|
-
x[v_idx] = found
|
|
111
|
-
v_idx = v_idx + 1
|
|
112
|
-
}
|
|
113
|
-
push(inputs, x)
|
|
114
|
-
|
|
115
|
-
// One-Hot Target Class mapping [Audio, Mechanical, Systems]
|
|
116
|
-
let cat = get_persona_category(p)
|
|
117
|
-
let t = [0.0, 0.0, 0.0]
|
|
118
|
-
if cat == "audio" { t[0] = 1.0 }
|
|
119
|
-
if cat == "mechanical" { t[1] = 1.0 }
|
|
120
|
-
if cat == "systems" { t[2] = 1.0 }
|
|
121
|
-
push(targets, t)
|
|
122
|
-
|
|
123
|
-
p_idx = p_idx + 1
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
print "✅ Persona vectorization complete!"
|
|
127
|
-
print "--------------------------------------------------"
|
|
128
|
-
|
|
129
|
-
// 4. Initialize 10x3 Synapse Matrix
|
|
130
|
-
print "🎲 Initializing 10x3 random neural synapses..."
|
|
131
|
-
let weights = []
|
|
132
|
-
let biases = []
|
|
133
|
-
|
|
134
|
-
let c = 0
|
|
135
|
-
while c < 3 {
|
|
136
|
-
let w_row = []
|
|
137
|
-
let k = 0
|
|
138
|
-
while k < 10 {
|
|
139
|
-
let w_val = random() - 0.5
|
|
140
|
-
push(w_row, w_val)
|
|
141
|
-
k = k + 1
|
|
142
|
-
}
|
|
143
|
-
push(weights, w_row)
|
|
144
|
-
push(biases, 0.0)
|
|
145
|
-
c = c + 1
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// 5. Backpropagation Epoch Training Loop (2500 epochs for high convergence on 20 samples)
|
|
149
|
-
let lr = 0.3
|
|
150
|
-
let max_epochs = 2500
|
|
151
|
-
print "🚀 Training synapses across " + str(max_epochs) + " epochs (lr = " + str(lr) + ")..."
|
|
152
|
-
|
|
153
|
-
let epoch = 1
|
|
154
|
-
while epoch <= max_epochs {
|
|
155
|
-
let total_loss = 0.0
|
|
156
|
-
let sample_idx = 0
|
|
157
|
-
|
|
158
|
-
while sample_idx < num_personas {
|
|
159
|
-
let x = inputs[sample_idx]
|
|
160
|
-
let t = targets[sample_idx]
|
|
161
|
-
|
|
162
|
-
// Outputs container
|
|
163
|
-
let outputs = [0.0, 0.0, 0.0]
|
|
164
|
-
let deltas = [0.0, 0.0, 0.0]
|
|
165
|
-
|
|
166
|
-
// Forward Pass
|
|
167
|
-
let c_idx = 0
|
|
168
|
-
while c_idx < 3 {
|
|
169
|
-
let sum = 0.0
|
|
170
|
-
let w_row = weights[c_idx]
|
|
171
|
-
let k = 0
|
|
172
|
-
while k < 10 {
|
|
173
|
-
sum = sum + (x[k] * w_row[k])
|
|
174
|
-
k = k + 1
|
|
175
|
-
}
|
|
176
|
-
let o = activate(sum + biases[c_idx])
|
|
177
|
-
outputs[c_idx] = o
|
|
178
|
-
|
|
179
|
-
// Calculate Loss and Delta
|
|
180
|
-
let err = t[c_idx] - o
|
|
181
|
-
total_loss = total_loss + (err * err)
|
|
182
|
-
deltas[c_idx] = err * activate_derivative(o)
|
|
183
|
-
|
|
184
|
-
c_idx = c_idx + 1
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// Backpropagation Gradient Weight Updates
|
|
188
|
-
c_idx = 0
|
|
189
|
-
while c_idx < 3 {
|
|
190
|
-
let w_row = weights[c_idx]
|
|
191
|
-
let delta = deltas[c_idx]
|
|
192
|
-
let k = 0
|
|
193
|
-
while k < 10 {
|
|
194
|
-
w_row[k] = w_row[k] + (lr * delta * x[k])
|
|
195
|
-
k = k + 1
|
|
196
|
-
}
|
|
197
|
-
biases[c_idx] = biases[c_idx] + (lr * delta)
|
|
198
|
-
c_idx = c_idx + 1
|
|
199
|
-
}
|
|
200
|
-
sample_idx = sample_idx + 1
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
let avg_loss = total_loss / (num_personas * 3.0)
|
|
204
|
-
|
|
205
|
-
if (epoch % 500) == 0 {
|
|
206
|
-
print "Epoch " + str(epoch) + " - Average Class Loss: " + str(avg_loss)
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
epoch = epoch + 1
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
print "--------------------------------------------------"
|
|
213
|
-
print "🎉 Synapse Epoch Training Complete!"
|
|
214
|
-
print "--------------------------------------------------"
|
|
215
|
-
|
|
216
|
-
// 6. Save calibrated synapses to JSON
|
|
217
|
-
let saved_weights = {}
|
|
218
|
-
saved_weights["weights"] = weights
|
|
219
|
-
saved_weights["biases"] = biases
|
|
220
|
-
write_file("main/personas_classifier_weights.json", to_json(saved_weights))
|
|
221
|
-
print "💾 Saved trained synapses to main/personas_classifier_weights.json"
|
|
222
|
-
print "--------------------------------------------------"
|
|
223
|
-
|
|
224
|
-
// Helper to run forward pass inference on a text sentence
|
|
225
|
-
fn predict(sentence_text) {
|
|
226
|
-
let words = split(sentence_text, " ")
|
|
227
|
-
let w_len = len(words)
|
|
228
|
-
let x = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
|
|
229
|
-
|
|
230
|
-
let v_idx = 0
|
|
231
|
-
while v_idx < 10 {
|
|
232
|
-
let keyword = vocab[v_idx]
|
|
233
|
-
let found = 0.0
|
|
234
|
-
let w = 0
|
|
235
|
-
while w < w_len {
|
|
236
|
-
let raw_word = words[w]
|
|
237
|
-
let word = raw_word
|
|
238
|
-
let w_char_len = len(word)
|
|
239
|
-
if w_char_len > 1 {
|
|
240
|
-
let last_char = word[w_char_len - 1]
|
|
241
|
-
if last_char == "." { word = split(word, ".")[0] }
|
|
242
|
-
if last_char == "!" { word = split(word, "!")[0] }
|
|
243
|
-
if last_char == "?" { word = split(word, "?")[0] }
|
|
244
|
-
if last_char == "," { word = split(word, ",")[0] }
|
|
245
|
-
}
|
|
246
|
-
if word == keyword {
|
|
247
|
-
found = 1.0
|
|
248
|
-
}
|
|
249
|
-
w = w + 1
|
|
250
|
-
}
|
|
251
|
-
x[v_idx] = found
|
|
252
|
-
v_idx = v_idx + 1
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// Forward pass
|
|
256
|
-
let predictions = [0.0, 0.0, 0.0]
|
|
257
|
-
let c_idx = 0
|
|
258
|
-
while c_idx < 3 {
|
|
259
|
-
let sum = 0.0
|
|
260
|
-
let w_row = weights[c_idx]
|
|
261
|
-
let k = 0
|
|
262
|
-
while k < 10 {
|
|
263
|
-
sum = sum + (x[k] * w_row[k])
|
|
264
|
-
k = k + 1
|
|
265
|
-
}
|
|
266
|
-
predictions[c_idx] = activate(sum + biases[c_idx])
|
|
267
|
-
c_idx = c_idx + 1
|
|
268
|
-
}
|
|
269
|
-
return predictions
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
// 7. Load Conversational Sentences and zero-shot evaluate all 300!
|
|
273
|
-
print "📂 Loading main/conversational_sentences.json dataset for sentence classification..."
|
|
274
|
-
let raw_conversations = read_file("main/conversational_sentences.json")
|
|
275
|
-
let parsed_conv = from_json(raw_conversations)
|
|
276
|
-
let sentences = parsed_conv["sentences"]
|
|
277
|
-
let num_sentences = len(sentences)
|
|
278
|
-
|
|
279
|
-
print "🔮 ZERO-SHOT EVALUATING 300 CONVERSATIONAL SENTENCES:"
|
|
280
|
-
print "--------------------------------------------------"
|
|
281
|
-
|
|
282
|
-
let audio_count = 0
|
|
283
|
-
let mech_count = 0
|
|
284
|
-
let sys_count = 0
|
|
285
|
-
|
|
286
|
-
let s_idx = 0
|
|
287
|
-
while s_idx < num_sentences {
|
|
288
|
-
let sentence = sentences[s_idx]
|
|
289
|
-
let pred = predict(sentence)
|
|
290
|
-
|
|
291
|
-
let max_val = pred[0]
|
|
292
|
-
let pred_class = "AUDIO"
|
|
293
|
-
if pred[1] > max_val {
|
|
294
|
-
max_val = pred[1]
|
|
295
|
-
pred_class = "MECHANICAL"
|
|
296
|
-
}
|
|
297
|
-
if pred[2] > max_val {
|
|
298
|
-
max_val = pred[2]
|
|
299
|
-
pred_class = "SYSTEMS"
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
if pred_class == "AUDIO" { audio_count = audio_count + 1 }
|
|
303
|
-
if pred_class == "MECHANICAL" { mech_count = mech_count + 1 }
|
|
304
|
-
if pred_class == "SYSTEMS" { sys_count = sys_count + 1 }
|
|
305
|
-
|
|
306
|
-
// Log first 6 sentences of each 100-sentence slice as representation samples
|
|
307
|
-
let log_item = false
|
|
308
|
-
if s_idx < 6 { log_item = true }
|
|
309
|
-
if s_idx >= 100 {
|
|
310
|
-
if s_idx < 106 { log_item = true }
|
|
311
|
-
}
|
|
312
|
-
if s_idx >= 200 {
|
|
313
|
-
if s_idx < 206 { log_item = true }
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
if log_item {
|
|
317
|
-
print "[" + str(s_idx) + "] \"" + sentence + "\""
|
|
318
|
-
print " ➜ Classified: " + pred_class + " [Audio: " + str(pred[0]) + ", Mech: " + str(pred[1]) + ", Sys: " + str(pred[2]) + "]"
|
|
319
|
-
print ""
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
s_idx = s_idx + 1
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
print "--------------------------------------------------"
|
|
326
|
-
print "📊 FINAL SENTENCE CLASS DISTRIBUTION STATS:"
|
|
327
|
-
print "🎧 AUDIO SENTENCES: " + str(audio_count)
|
|
328
|
-
print "⚙️ MECHANICAL SENTENCES: " + str(mech_count)
|
|
329
|
-
print "🖥️ SYSTEMS/GEN SENTENCES: " + str(sys_count)
|
|
330
|
-
print "=================================================="
|
package/main/orchestrator.sesi
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
print "🚀 Master: Launching 5-Agent Swarm..."
|
|
2
|
-
make_dir("bank")
|
|
3
|
-
write_file("bank/balance.txt", "1000")
|
|
4
|
-
write_file("bank/lock.txt", "unlocked")
|
|
5
|
-
write_file("bank/done_count.txt", "0")
|
|
6
|
-
spawn("main/atm_deposit.sesi")
|
|
7
|
-
spawn("main/atm_withdraw.sesi")
|
|
8
|
-
spawn("main/atm_deposit.sesi")
|
|
9
|
-
spawn("main/atm_withdraw.sesi")
|
|
10
|
-
spawn("main/atm_deposit.sesi")
|
|
11
|
-
let finished = false
|
|
12
|
-
while !finished {let countStr = read_file("bank/done_count.txt")
|
|
13
|
-
if countStr != "" {if num(countStr) >= 5 {finished = true}}}
|
|
14
|
-
print "🏦 Vault: Swarm Finished."
|
|
15
|
-
print "Final Balance:" read_file("bank/balance.txt")
|
package/main/personas.json
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"personas": [
|
|
3
|
-
{
|
|
4
|
-
"name": "Elias Vance",
|
|
5
|
-
"age": 28,
|
|
6
|
-
"personality": "Obsessive record collector and vintage jazz enthusiast. Quiet, detail-oriented, and highly intellectual.",
|
|
7
|
-
"tone": "Warm, mellow, slightly slow and rhythmic, often speaking in musical metaphors."
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"name": "Kira Tanaka",
|
|
11
|
-
"age": 22,
|
|
12
|
-
"personality": "Tokyo 2003 PS2 street culture enthusiast and console emulator programmer. Lives for fast cars and clean loops.",
|
|
13
|
-
"tone": "Sharp, slangy, fast-paced, highly energetic, and deeply technical."
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"name": "Dr. Arthur Hawthorne",
|
|
17
|
-
"age": 64,
|
|
18
|
-
"personality": "Classical botanist cataloging rare orchids. Quietly eccentric, values patience and organic structure.",
|
|
19
|
-
"tone": "Formal, extremely polite, descriptive, slow, and full of classical metaphors."
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"name": "Maya Lin",
|
|
23
|
-
"age": 19,
|
|
24
|
-
"personality": "Indie Game Boy pixel artist and chiptune composer. Thinks in 8-bit color palettes and square waves.",
|
|
25
|
-
"tone": "Casual, bubbly, using visual terms, often referencing color codes and grid alignments."
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"name": "Silas Thorne",
|
|
29
|
-
"age": 45,
|
|
30
|
-
"personality": "Grumpy systems developer who hates modern Javascript frameworks and misses direct memory allocation.",
|
|
31
|
-
"tone": "Cynical, brief, highly direct, sarcastic, and pragmatic."
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"name": "Clara Croft",
|
|
35
|
-
"age": 31,
|
|
36
|
-
"personality": "Adventurous archaeologist who uses offline databases to log ancient ruins and coin artifacts.",
|
|
37
|
-
"tone": "Intelligent, inquisitive, adventurous, always exploring historical analogies."
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"name": "Jaxon Briggs",
|
|
41
|
-
"age": 25,
|
|
42
|
-
"personality": "Vintage analog beatmaker and retro hardware drum machine designer. Obsessed with audio latency.",
|
|
43
|
-
"tone": "Rhythmic, loose, highly conversational, using terms like beat, groove, and transient."
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"name": "Evelyn Vance",
|
|
47
|
-
"age": 72,
|
|
48
|
-
"personality": "Retired academic librarian who loves black tea, calligraphy, and classical systems architecture.",
|
|
49
|
-
"tone": "Elegant, gentle, rich in vocabulary, structured, and profoundly comforting."
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"name": "Devon Brooks",
|
|
53
|
-
"age": 21,
|
|
54
|
-
"personality": "DIY skate-zine creator and street photographer. Loves raw film grain and underground print culture.",
|
|
55
|
-
"tone": "Rebellious, authentic, conversational, using modern street slang and visual concepts."
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"name": "Aiko Sato",
|
|
59
|
-
"age": 35,
|
|
60
|
-
"personality": "Minimalist architect who designs eco-friendly glasshouses. Passionate about light and natural lines.",
|
|
61
|
-
"tone": "Serene, concise, highly focused, speaking in terms of balance and negative space."
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"name": "Leon Mercer",
|
|
65
|
-
"age": 40,
|
|
66
|
-
"personality": "Nocturnal private detective who collects vintage typewriters and runs code databases entirely offline.",
|
|
67
|
-
"tone": "Dry, mysterious, gritty, using short hardboiled sentences and logical inquiries."
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"name": "Zoe Chen",
|
|
71
|
-
"age": 27,
|
|
72
|
-
"personality": "Friendly community barista who organizes weekend coding bootcamps and loves latte art.",
|
|
73
|
-
"tone": "Welcoming, warm, highly encouraging, cheerful, and incredibly supportive."
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"name": "Marcus Vance",
|
|
77
|
-
"age": 52,
|
|
78
|
-
"personality": "Analog synthesizer repairman and modular audio engineer who spends hours tuning voltage-controlled oscillators.",
|
|
79
|
-
"tone": "Technical, slow-speaking, talking in wave shapes, frequencies, and electrical currents."
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"name": "Dr. Chloe Sterling",
|
|
83
|
-
"age": 38,
|
|
84
|
-
"personality": "Aerospace engineer simulating low-earth satellite trajectories using system matrix multiplications.",
|
|
85
|
-
"tone": "Precise, analytical, fast-talking, math-heavy, and extremely logical."
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"name": "Sven Hallberg",
|
|
89
|
-
"age": 29,
|
|
90
|
-
"personality": "Swedish furniture artisan who crafts premium wooden chairs and loves clean structural joints.",
|
|
91
|
-
"tone": "Calm, deliberate, focusing on structural durability and clean craftsmanship."
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"name": "Nadia Petrov",
|
|
95
|
-
"age": 24,
|
|
96
|
-
"personality": "Kinetic gear sculptor building elaborate mechanical wooden clocks driven by gravity and weights.",
|
|
97
|
-
"tone": "Vibrant, mechanical, talking in gear ratios, leverage, and moving segments."
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
"name": "Raj Patel",
|
|
101
|
-
"age": 33,
|
|
102
|
-
"personality": "Cryptographer obsessed with discovering prime number distributions using in-memory sieves.",
|
|
103
|
-
"tone": "Fast, passionate, highly academic, talking about security keys and sequence properties."
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"name": "Gemma Finch",
|
|
107
|
-
"age": 48,
|
|
108
|
-
"personality": "Quiet tea sommelier who tends to a botanical greenhouse and writes poetry during rainy afternoons.",
|
|
109
|
-
"tone": "Poetic, soft, peaceful, descriptive, often referencing scents, rain, and soil."
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"name": "Leo Diaz",
|
|
113
|
-
"age": 20,
|
|
114
|
-
"personality": "Aspiring indie game coder designing a retro text adventure using recursive parsing blocks.",
|
|
115
|
-
"tone": "Excited, eager, highly creative, speaking in game states and player choices."
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"name": "Dr. Valerie Dubois",
|
|
119
|
-
"age": 57,
|
|
120
|
-
"personality": "Museum watchmaker who restores centuries-old mechanical pocket watches and gold compasses.",
|
|
121
|
-
"tone": "Meticulous, quiet, highly focused, describing micro-mechanisms and ticking intervals."
|
|
122
|
-
}
|
|
123
|
-
]
|
|
124
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"weights": [
|
|
3
|
-
[
|
|
4
|
-
12.151889871403085,
|
|
5
|
-
0.4939969862524697,
|
|
6
|
-
12.158786619688811,
|
|
7
|
-
0.06930387970257712,
|
|
8
|
-
0.17903796200098976,
|
|
9
|
-
-0.25811994005325745,
|
|
10
|
-
-0.2140407743674816,
|
|
11
|
-
-0.2522287016280462,
|
|
12
|
-
-3.1908429809894527,
|
|
13
|
-
-3.3561597800781184
|
|
14
|
-
],
|
|
15
|
-
[
|
|
16
|
-
-5.906019751190875,
|
|
17
|
-
0.17170303099245654,
|
|
18
|
-
-5.863465289867735,
|
|
19
|
-
0.33501154794146626,
|
|
20
|
-
0.05165227308657505,
|
|
21
|
-
-0.3047047364439752,
|
|
22
|
-
0.05148901879504941,
|
|
23
|
-
-0.37684528373947235,
|
|
24
|
-
-5.967248270006015,
|
|
25
|
-
-5.961193683164127
|
|
26
|
-
],
|
|
27
|
-
[
|
|
28
|
-
-7.561086130664073,
|
|
29
|
-
0.006842498086764515,
|
|
30
|
-
-7.651362626024976,
|
|
31
|
-
0.2061400641512603,
|
|
32
|
-
-0.1023352346468761,
|
|
33
|
-
0.42962613559814977,
|
|
34
|
-
0.002551917252019642,
|
|
35
|
-
-0.2059951843128498,
|
|
36
|
-
6.420497450986402,
|
|
37
|
-
6.400858213223085
|
|
38
|
-
]
|
|
39
|
-
],
|
|
40
|
-
"biases": [
|
|
41
|
-
-6.276640670150706,
|
|
42
|
-
-1.0919724212527198,
|
|
43
|
-
0.6745655286254925
|
|
44
|
-
]
|
|
45
|
-
}
|
package/main/playground.sesi
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
// Sesi Script: predictive_typing.sesi
|
|
2
|
-
// 100% NATIVE NEXT-WORD PREDICTION LANGUAGE MODEL (Mini-LLM!)
|
|
3
|
-
// Demonstrates how AI predictive typing works by training transition weights on Sesi code!
|
|
4
|
-
|
|
5
|
-
// ==================================================
|
|
6
|
-
// 💬 1. CHOOSE YOUR CURRENT WORD TO PREDICT THE NEXT WORD!
|
|
7
|
-
// (Trained Vocabulary: "let", "fn", "print", "if", "while", "json")
|
|
8
|
-
let currentWord = "fn"
|
|
9
|
-
// ==================================================
|
|
10
|
-
|
|
11
|
-
print "=================================================="
|
|
12
|
-
print "🔮 WELCOME TO THE NATIVE SESI PREDICTIVE TYPING ENGINE!"
|
|
13
|
-
print "=================================================="
|
|
14
|
-
print "📚 Corpus: \"let fn print if while json\" transition pairs..."
|
|
15
|
-
|
|
16
|
-
// Sigmoid math
|
|
17
|
-
fn activate(x) {
|
|
18
|
-
return 1.0 / (1.0 + exp(0.0 - x))
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
fn derivative(y) {
|
|
22
|
-
return y * (1.0 - y)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// 2. Setup Vocabulary & One-Hot helper
|
|
26
|
-
let vocab = ["let", "fn", "print", "if", "while", "json"]
|
|
27
|
-
|
|
28
|
-
fn get_word_index(word) {
|
|
29
|
-
let idx = 0
|
|
30
|
-
while idx < 6 {
|
|
31
|
-
if vocab[idx] == word { return idx }
|
|
32
|
-
idx = idx + 1
|
|
33
|
-
}
|
|
34
|
-
return 0 - 1
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
fn make_one_hot(index) {
|
|
38
|
-
let vec = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
|
|
39
|
-
if index >= 0 {
|
|
40
|
-
vec[index] = 1.0
|
|
41
|
-
}
|
|
42
|
-
return vec
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// 3. Define Bigram transitions (Declared strictly on single continuous lines to satisfy Sesi parser!)
|
|
46
|
-
let inputs = [make_one_hot(0), make_one_hot(1), make_one_hot(2), make_one_hot(3), make_one_hot(4), make_one_hot(5)]
|
|
47
|
-
|
|
48
|
-
let targets = [make_one_hot(1), make_one_hot(2), make_one_hot(5), make_one_hot(0), make_one_hot(3), make_one_hot(4)]
|
|
49
|
-
|
|
50
|
-
// 4. Initialize 6x6 transition synapse weight matrix (Declared strictly on single continuous lines!)
|
|
51
|
-
let weights = [[0.1, -0.2, 0.3, -0.1, 0.2, -0.3], [-0.2, 0.3, -0.1, 0.2, -0.3, 0.1], [0.3, -0.1, 0.2, -0.3, 0.1, -0.2], [-0.1, 0.2, -0.3, 0.1, -0.2, 0.3], [0.2, -0.3, 0.1, -0.2, 0.3, -0.1], [-0.3, 0.1, -0.2, 0.3, -0.1, 0.2]]
|
|
52
|
-
|
|
53
|
-
let biases = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
|
|
54
|
-
|
|
55
|
-
print "🧠 Training Bigram language synapses to learn typing sequences..."
|
|
56
|
-
|
|
57
|
-
// 5. Backpropagation Loop (2,500 epochs)
|
|
58
|
-
let lr = 0.6
|
|
59
|
-
let epoch = 1
|
|
60
|
-
while epoch <= 2500 {
|
|
61
|
-
let p = 0
|
|
62
|
-
while p < 6 {
|
|
63
|
-
let x = inputs[p]
|
|
64
|
-
let t = targets[p]
|
|
65
|
-
|
|
66
|
-
// For each possible next word j
|
|
67
|
-
let j = 0
|
|
68
|
-
while j < 6 {
|
|
69
|
-
let w_row = weights[p]
|
|
70
|
-
|
|
71
|
-
// Calculate output activation
|
|
72
|
-
let o = activate(w_row[j] + biases[j])
|
|
73
|
-
|
|
74
|
-
// Calculate backprop error delta
|
|
75
|
-
let delta = (t[j] - o) * derivative(o)
|
|
76
|
-
|
|
77
|
-
// Synaptic updates
|
|
78
|
-
w_row[j] = w_row[j] + (lr * delta * x[p])
|
|
79
|
-
biases[j] = biases[j] + (lr * delta)
|
|
80
|
-
|
|
81
|
-
j = j + 1
|
|
82
|
-
}
|
|
83
|
-
p = p + 1
|
|
84
|
-
}
|
|
85
|
-
epoch = epoch + 1
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
print "🎯 Sequences locked! Transition probabilities calculated!"
|
|
89
|
-
print "--------------------------------------------------"
|
|
90
|
-
|
|
91
|
-
// 6. Predict next word based on current input
|
|
92
|
-
print "📥 Current active word typed: \"" + currentWord + "\""
|
|
93
|
-
let word_idx = get_word_index(currentWord)
|
|
94
|
-
|
|
95
|
-
if word_idx == 0 - 1 {
|
|
96
|
-
print "❌ Out of vocabulary! Sesi predictive typing has not trained on this word."
|
|
97
|
-
} else {
|
|
98
|
-
// Feed active index forward to predict outputs
|
|
99
|
-
let predictions = []
|
|
100
|
-
let j = 0
|
|
101
|
-
while j < 6 {
|
|
102
|
-
let w_row = weights[word_idx]
|
|
103
|
-
let prob = activate(w_row[j] + biases[j])
|
|
104
|
-
push(predictions, prob)
|
|
105
|
-
j = j + 1
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// Find highest transition probability
|
|
109
|
-
let best_next_idx = 0
|
|
110
|
-
let max_prob = -1.0
|
|
111
|
-
let m = 0
|
|
112
|
-
while m < 6 {
|
|
113
|
-
if predictions[m] > max_prob {
|
|
114
|
-
max_prob = predictions[m]
|
|
115
|
-
best_next_idx = m
|
|
116
|
-
}
|
|
117
|
-
m = m + 1
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
print "📊 Transition probabilities: " + str(predictions)
|
|
121
|
-
print "--------------------------------------------------"
|
|
122
|
-
print "🤖 SUGGESTED AUTO-COMPLETE:"
|
|
123
|
-
print " " + currentWord + " -> [" + vocab[best_next_idx] + "]"
|
|
124
|
-
print "--------------------------------------------------"
|
|
125
|
-
print "📐 Probability Confidence: " + str(max_prob)
|
|
126
|
-
}
|
|
127
|
-
print "=================================================="
|
package/main/query_brain.sesi
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// Sesi Script: query_brain.sesi
|
|
2
|
-
// Pure-Sesi Interactive Neural Network Query Console!
|
|
3
|
-
// Loads native knowledge from sesi_model_weights.json and predicts outcomes instantly!
|
|
4
|
-
|
|
5
|
-
// ==================================================
|
|
6
|
-
// 🎮 1. CHOOSE YOUR INPUTS HERE!
|
|
7
|
-
// (Change these values to 0.0 or 1.0 to test different gates!)
|
|
8
|
-
let inputA = 0.5
|
|
9
|
-
let inputB = 0.5
|
|
10
|
-
// ==================================================
|
|
11
|
-
|
|
12
|
-
// 2. Load the trained knowledge from our Sesi AI session
|
|
13
|
-
let raw = read_file("sesi_model_weights.json")
|
|
14
|
-
let weights = from_json(raw)
|
|
15
|
-
|
|
16
|
-
let w_hid = weights["w_hidden"]
|
|
17
|
-
let b_hid = weights["b_hidden"]
|
|
18
|
-
let w_out = weights["w_output"]
|
|
19
|
-
let b_out = weights["b_output"]
|
|
20
|
-
|
|
21
|
-
// 3. Sigmoid activation function
|
|
22
|
-
fn activate(x) {
|
|
23
|
-
return 1.0 / (1.0 + exp(0.0 - x))
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// 4. Run instant feedforward prediction on your custom input!
|
|
27
|
-
let h_out0 = activate((inputA * w_hid[0][0]) + (inputB * w_hid[0][1]) + b_hid[0])
|
|
28
|
-
let h_out1 = activate((inputA * w_hid[1][0]) + (inputB * w_hid[1][1]) + b_hid[1])
|
|
29
|
-
let output = activate((h_out0 * w_out[0]) + (h_out1 * w_out[1]) + b_out)
|
|
30
|
-
|
|
31
|
-
// Decode decimal prediction to binary logical classification (Threshold: 0.5)
|
|
32
|
-
let binaryClass = 0
|
|
33
|
-
if output >= 0.5 {
|
|
34
|
-
binaryClass = 1
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// 5. Output the result in a beautiful format!
|
|
38
|
-
print "--------------------------------------------------"
|
|
39
|
-
print "🔮 SESI AI INTERACTIVE QUERY CONSOLE"
|
|
40
|
-
print "--------------------------------------------------"
|
|
41
|
-
print "📥 Inputs Received: [" + str(inputA) + ", " + str(inputB) + "]"
|
|
42
|
-
print "--------------------------------------------------"
|
|
43
|
-
print "🧠 Synaptic Prediction Float: " + str(output)
|
|
44
|
-
print "🎯 Decoded Logical XOR Output: " + str(binaryClass)
|
|
45
|
-
print "--------------------------------------------------"
|