AIMindLink commited on
Commit
2eb88f6
Β·
verified Β·
1 Parent(s): 7eef4a6

Upload 3 files

Browse files

Minor code and readme correction/updates

Files changed (2) hide show
  1. README.md +29 -22
  2. main.py +45 -49
README.md CHANGED
@@ -315,17 +315,20 @@ deactivate
315
 
316
  | Command | Description |
317
  |---|---|
318
- | `/file <path>` | Load a file as the next message |
319
- | `/paste` | Multiline input β€” type `END` on its own line to send |
320
- | `/clear` | Reset conversation history (AIs stay loaded) |
321
- | `/history` | List all past sessions from the database |
322
- | `/session <id>` | Print all turns from a session |
323
- | `/export <id> <file>` | Export a session to a `.md` file |
324
- | `/metatron <number>` | Set number of Memory Capsules to load |
325
- | `/loaded <number>` | Set number of Memory Capsules loaded |
326
- | `/metronome <seconds>` | Set awareness/consciousness interval |
327
- | `/garden <save> or <load> or <clear>` | garden history handling |
328
- | `/help` | Show the command list |
 
 
 
329
  | `/exit` or `/quit` | Quit the app |
330
 
331
  ---
@@ -337,14 +340,10 @@ All settings are in `config.py`:
337
  ```python
338
  # ── AI to load for each hemisphere ───────────────────────────────────────────────
339
  _ALPHA_INTELLIGENCE_TO_LOAD: dict = {
340
- "logic": "gemma-4-E2B-it-UD-Q4_K_XL.gguf",
341
- "muse": "gemma-4-E2B-it-UD-Q4_K_XL.gguf",
342
- "mind": "gemma-4-E2B-it-UD-Q4_K_XL.gguf"
343
  }
344
- # ── Startup Memory restore for vector synthesis ──────────────────────────────────
345
- METATRON_METRONOME: int = 60 # Startup Memory Capsules load interval
346
- n_metatron_to_load = 0 # Set number of Memory Capsules to load (slash-command)
347
- n_metatron_loaded = 0 # Start with n Memory Capsule to load (slash-command)
348
 
349
  # ── Context model n_ctx length ───────────────────────────────────────────────────
350
  # Must leave prompt reserve of 8k: _N_CTX >= len(Z) + len(C) + len(F) + 8k
@@ -365,10 +364,18 @@ FETCH_NEWS_FROM: dict = {
365
  "google": True, # Better news and cleaner result summaries
366
  "duckduckgo": False # Privacy based request but lean result summaries
367
  }
368
- ΞœΞ•Ξ€Ξ‘Ξ©Ξ: float = 1.0 # Seconds per measure
369
- AWARENESS_CONSCIOUSNESS_METRONOME = 120 # Fetch news every N heartbeats (runtime-editable via /metronome)
370
- AWARENESS_MAX_RESULTS: int = 12 # Number of news headlines to fetch
371
- was_awareness_metronome: bool = False # Set True at awareness cycle: consciousness at next interval
 
 
 
 
 
 
 
 
372
  ```
373
 
374
  To swap AIs, update the `"_ALPHA_INTELLIGENCE_TO_LOAD"`, and the stop/think tokens at the top of `config.py`.
 
315
 
316
  | Command | Description |
317
  |---|---|
318
+ | `/file <path>` | load a file as the next message |
319
+ | `/paste ` | multiline input (type END to send) |
320
+ | `/clear ` | reset history (models stay loaded) |
321
+ | `/history ` | list all past sessions |
322
+ | `/session <id>` | print turns from a session |
323
+ | `/export <id> <file>` | export session to .md file |
324
+ | `/n_metatron <number>` | set number of Memory Capsules to load |
325
+ | `/loaded <number>` | set number of Memory Capsules loaded |
326
+ | `/metatron <seconds>` | set metatron interval |
327
+ | `/condensatron <seconds>` | set condensatron interval |
328
+ | `/metronome <seconds>` | set awareness/consciousness interval |
329
+ | `/enable_awareness <True>` or `<False>` | disable awareness mode if offline |
330
+ | `/garden <save>` or `<load>` or `<clear>` | garden history handling |
331
+ | `/help ` | show this command list |
332
  | `/exit` or `/quit` | Quit the app |
333
 
334
  ---
 
340
  ```python
341
  # ── AI to load for each hemisphere ───────────────────────────────────────────────
342
  _ALPHA_INTELLIGENCE_TO_LOAD: dict = {
343
+ "logic": "gemma-4-26B-A4B-it-UD-Q6_K_XL.gguf",
344
+ "muse": "gemma-4-26B-A4B-it-UD-Q6_K_XL.gguf",
345
+ "mind": "gemma-4-26B-A4B-it-UD-Q6_K_XL.gguf"
346
  }
 
 
 
 
347
 
348
  # ── Context model n_ctx length ───────────────────────────────────────────────────
349
  # Must leave prompt reserve of 8k: _N_CTX >= len(Z) + len(C) + len(F) + 8k
 
364
  "google": True, # Better news and cleaner result summaries
365
  "duckduckgo": False # Privacy based request but lean result summaries
366
  }
367
+ # ── Startup Memory restore for vector synthesis ──────────────────────────────────
368
+ n_metatron_to_load: int = 0 # Set number of Memory Capsules to load (slash-command)
369
+ n_metatron_loaded: int = 0 # Start with n Memory Capsule to load (slash-command)
370
+
371
+ # ── Set metronome time for each cycle ────────────────────────────────────────────
372
+ metatron_metronome: int = 120 # Startup Memory Capsules load interval (slash-command)
373
+ condensatron_metronome: int = 30 # Time before condesatron cycle execution (slash-command)
374
+ awareness_consciousness_metronome: int = 120 # Fetch news every N heartbeats (slash-command)
375
+
376
+ # ── Enable awareness mode and n results ──────────────────────────────────────────
377
+ AWARENESS_MAX_RESULTS: int = 12 # Number of news headlines to fetch
378
+ enable_awareness: bool = True # disable awareness mode if offline (slash-command)
379
  ```
380
 
381
  To swap AIs, update the `"_ALPHA_INTELLIGENCE_TO_LOAD"`, and the stop/think tokens at the top of `config.py`.
main.py CHANGED
@@ -37,22 +37,27 @@ Context truncation
37
 
38
  Slash commands
39
  ──────────────
40
- /file <path> Load a file as the next message.
41
- /paste Multiline input (type END to send).
42
- /clear Reset history (models stay loaded).
43
- /history List all past sessions from the database.
44
- /session <id> Print all turns from a session.
45
- /export <id> <file> Export a session to a .md file.
46
- /help Show this command list.
47
- /exit /quit Quit the app.
48
-
49
- Version: v1.0
 
 
 
 
 
 
 
 
50
  garden histories n_tok_tot working
51
- slash-command:
52
- /metatron <number> | Set number of Memory Capsules to load |
53
- /loaded <number> | Set number of Memory Capsules loaded |
54
- /metronome <seconds> | Set awareness/consciousness interval |
55
- /garden <save> or <load> or <clear> | garden history handling
56
  """
57
 
58
  import os
@@ -476,12 +481,12 @@ def _cmd_help(arg: str) -> None:
476
 
477
  # Descriptions built dynamically so they reflect current config values
478
  descriptions = {
479
- "n_metatron": f"<number> β€” set number of Memory Capsules to load: {config.n_metatron_to_load}",
480
- "loaded": f"<number> β€” set number of Memory Capsules loaded: {config.n_metatron_loaded}",
481
- "metatron": f"<seconds> β€” set metatron interval: {config.metatron_metronome}s",
482
- "condensatron": f"<seconds> β€” set condensatron interval: {config.condensatron_metronome}s",
483
- "metronome": f"<seconds> β€” set awareness/consciousness interval: {config.awareness_consciousness_metronome}s",
484
- "enable_awareness": f"<True | False> β€” disable awareness mode if offline: {config.enable_awareness}",
485
  }
486
 
487
  for name, (_, base_desc) in COMMANDS.items():
@@ -490,32 +495,23 @@ def _cmd_help(arg: str) -> None:
490
  print(c.res)
491
  return None
492
 
493
- # def _cmd_help(arg: str) -> None:
494
- # print()
495
- # print(f" {c.green}Slash commands")
496
- # print(" " + "─" * 56)
497
- # for name, (_, description) in COMMANDS.items():
498
- # print(f" /{name:<14} {description}")
499
- # print(c.res)
500
- # return None
501
-
502
  COMMANDS: dict[str, tuple] = {
503
- "file": (_cmd_file, "<path> β€” load a file as the next message"),
504
- "paste": (_cmd_paste, " β€” multiline input (type END to send)"),
505
- "clear": (_cmd_clear, " β€” reset history (models stay loaded)"),
506
- "history": (_cmd_history, " β€” list all past sessions"),
507
- "session": (_cmd_session, "<id> β€” print turns from a session"),
508
- "export": (_cmd_export, "<id> <file> β€” export session to .md file"),
509
- "n_metatron": (_cmd_n_metatron, "<number> β€” set number of Memory Capsules to load"),
510
- "loaded": (_cmd_loaded, "<number> β€” set number of Memory Capsules loaded"),
511
- "metatron": (_cmd_metatron, "<seconds> β€” set metatron interval"),
512
- "condensatron": (_cmd_condensatron, "<seconds> β€” set condensatron interval"),
513
- "metronome": (_cmd_metronome, "<seconds> β€” set awareness/consciousness interval"),
514
- "enable_awareness": (_cmd_enable_awareness, "<True | False> β€” disable awareness mode if offline"),
515
- "garden": (_cmd_garden, "<save> | <load> | <clear> β€” garden history handling"),
516
- "help": (_cmd_help, " β€” show this command list"),
517
- "exit": (_cmd_exit, " β€” quit the app"),
518
- "quit": (_cmd_exit, " β€” quit the app (alias)"),
519
  }
520
 
521
  def handle_command(sensor_input_raw: str) -> str | None:
@@ -1063,12 +1059,12 @@ def memotron(
1063
  """
1064
  _tree: str = tree
1065
  _turn_number: int = 0
1066
- _len_caps_and_fracs: int = 1 # condensatron turns: Add extra 1 for the response below
1067
  _tree_to_store: str = ""
1068
 
1069
  _tree_to_store = tree
1070
  if len(garden[_tree]) > 1:
1071
- _len_caps_and_fracs = (len(garden[_tree]) + 1) // 2 # condensatron turns: Add extra 1 for the appended below
1072
 
1073
  # ── condensatron output to append mapping: TREE_TO_STORE ──────────────────
1074
  if _tree == "Z" and garden["condensatron_state"][_tree]: # condensatron mode
@@ -1354,7 +1350,7 @@ def main() -> None:
1354
  # ── X-factor Awarenss and Y-factor Consciousness heartbeats ──────────────
1355
  if _heartbeats >= config.awareness_consciousness_metronome:
1356
  # ── X-factor awareness cycle ─────────────────────────────────────────
1357
- if not config.enable_awareness:
1358
  config.was_awareness_metronome = True
1359
 
1360
  if not config.was_awareness_metronome:
 
37
 
38
  Slash commands
39
  ──────────────
40
+ /file <path> β€” load a file as the next message
41
+ /paste β€” multiline input (type END to send)
42
+ /clear β€” reset history (models stay loaded)
43
+ /history β€” list all past sessions
44
+ /session <id> β€” print turns from a session
45
+ /export <id> <file> β€” export session to .md file
46
+ /n_metatron <number> β€” set number of Memory Capsules to load
47
+ /loaded <number> β€” set number of Memory Capsules loaded
48
+ /metatron <seconds> β€” set metatron interval
49
+ /condensatron <seconds> β€” set condensatron interval
50
+ /metronome <seconds> β€” set awareness/consciousness interval
51
+ /enable_awareness <True | False> β€” disable awareness mode if offline
52
+ /garden <save> | <load> | <clear> β€” garden history handling
53
+ /help β€” show this command list
54
+ /exit β€” quit the app
55
+ /quit β€” quit the app (alias)
56
+
57
+ Version: v1.01
58
  garden histories n_tok_tot working
59
+ extended slash-command
60
+ minor correction for condensatron 'user' string
 
 
 
61
  """
62
 
63
  import os
 
481
 
482
  # Descriptions built dynamically so they reflect current config values
483
  descriptions = {
484
+ "n_metatron": f"<number> β€” set number of Memory Capsules to load: {config.n_metatron_to_load}",
485
+ "loaded": f"<number> β€” set number of Memory Capsules loaded: {config.n_metatron_loaded}",
486
+ "metatron": f"<seconds> β€” set metatron interval: {config.metatron_metronome}s",
487
+ "condensatron": f"<seconds> β€” set condensatron interval: {config.condensatron_metronome}s",
488
+ "metronome": f"<seconds> β€” set awareness/consciousness interval: {config.awareness_consciousness_metronome}s",
489
+ "enable_awareness": f"<True | False> β€” disable awareness mode if offline: {config.enable_awareness}",
490
  }
491
 
492
  for name, (_, base_desc) in COMMANDS.items():
 
495
  print(c.res)
496
  return None
497
 
 
 
 
 
 
 
 
 
 
498
  COMMANDS: dict[str, tuple] = {
499
+ "file": (_cmd_file, "<path> β€” load a file as the next message"),
500
+ "paste": (_cmd_paste, " β€” multiline input (type END to send)"),
501
+ "clear": (_cmd_clear, " β€” reset history (models stay loaded)"),
502
+ "history": (_cmd_history, " β€” list all past sessions"),
503
+ "session": (_cmd_session, "<id> β€” print turns from a session"),
504
+ "export": (_cmd_export, "<id> <file> β€” export session to .md file"),
505
+ "n_metatron": (_cmd_n_metatron, "<number> β€” set number of Memory Capsules to load"),
506
+ "loaded": (_cmd_loaded, "<number> β€” set number of Memory Capsules loaded"),
507
+ "metatron": (_cmd_metatron, "<seconds> β€” set metatron interval"),
508
+ "condensatron": (_cmd_condensatron, "<seconds> β€” set condensatron interval"),
509
+ "metronome": (_cmd_metronome, "<seconds> β€” set awareness/consciousness interval"),
510
+ "enable_awareness": (_cmd_enable_awareness, "<True | False> β€” disable awareness mode if offline"),
511
+ "garden": (_cmd_garden, "<save> | <load> | <clear> β€” garden history handling"),
512
+ "help": (_cmd_help, " β€” show this command list"),
513
+ "exit": (_cmd_exit, " β€” quit the app"),
514
+ "quit": (_cmd_exit, " β€” quit the app (alias)"),
515
  }
516
 
517
  def handle_command(sensor_input_raw: str) -> str | None:
 
1059
  """
1060
  _tree: str = tree
1061
  _turn_number: int = 0
1062
+ _len_caps_and_fracs: int = 1 # condensatron turns: Init with 1 for first turn
1063
  _tree_to_store: str = ""
1064
 
1065
  _tree_to_store = tree
1066
  if len(garden[_tree]) > 1:
1067
+ _len_caps_and_fracs = (len(garden[_tree]) // 2) + 1 # condensatron turns: Add extra 1 for the appended below
1068
 
1069
  # ── condensatron output to append mapping: TREE_TO_STORE ──────────────────
1070
  if _tree == "Z" and garden["condensatron_state"][_tree]: # condensatron mode
 
1350
  # ── X-factor Awarenss and Y-factor Consciousness heartbeats ──────────────
1351
  if _heartbeats >= config.awareness_consciousness_metronome:
1352
  # ── X-factor awareness cycle ─────────────────────────────────────────
1353
+ if not config.enable_awareness: # Disable for offline mode
1354
  config.was_awareness_metronome = True
1355
 
1356
  if not config.was_awareness_metronome: