Upload 2 files
Browse filesAdded slash-command to set the `AWARENESS_CONSCIOUSNESS_METRONOME` time at runtime. That way you can set it very high for review a DB and later set it back to a smaller amount of time.
Slash-command: `/metronome`.
config.py
CHANGED
|
@@ -18,9 +18,8 @@ PROMPTS_BASE: str = APP_DIR
|
|
| 18 |
# The db/ folder is created automatically by main.py if it does not exist.
|
| 19 |
# Example: db/mindlink_2025-09-18_14-32-07.db
|
| 20 |
|
| 21 |
-
_DB_DIR: str
|
| 22 |
-
|
| 23 |
-
DB_PATH: str = os.path.join(_DB_DIR, _DB_FILENAME)
|
| 24 |
|
| 25 |
_AI_FOLDER = os.path.join(APP_DIR, "ai")
|
| 26 |
|
|
@@ -73,8 +72,8 @@ _ALPHA_INTELLIGENCE_TO_LOAD: dict = {
|
|
| 73 |
"mind": "gemma-4-E2B-it-UD-Q4_K_XL.gguf"
|
| 74 |
}
|
| 75 |
# ββ Startup Memory restore for vector synthesis ββββββββββββββββββββββββββββββββββ
|
| 76 |
-
N_METATRON_TO_LOAD: int =
|
| 77 |
-
METATRON_METRONOME: int = 12 #
|
| 78 |
|
| 79 |
# ββ Context model n_ctx length βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 80 |
# Must leave prompt reserve of 8k: _N_CTX >= len(Z) + len(C) + len(F) + 8k
|
|
@@ -96,7 +95,7 @@ FETCH_NEWS_FROM: dict = {
|
|
| 96 |
"duckduckgo": False # Privacy based request but lean result summaries
|
| 97 |
}
|
| 98 |
ΞΞ΀ΑΩΞ: float = 1.0 # Seconds per measure
|
| 99 |
-
AWARENESS_CONSCIOUSNESS_METRONOME
|
| 100 |
AWARENESS_MAX_RESULTS: int = 12 # Number of news headlines to fetch
|
| 101 |
was_awareness_metronome: bool = False # Set True at awareness cycle: consciousness at next interval
|
| 102 |
|
|
|
|
| 18 |
# The db/ folder is created automatically by main.py if it does not exist.
|
| 19 |
# Example: db/mindlink_2025-09-18_14-32-07.db
|
| 20 |
|
| 21 |
+
_DB_DIR: str = os.path.join(APP_DIR, "db")
|
| 22 |
+
DB_PATH: str = os.path.join(_DB_DIR, "mindlink.db")
|
|
|
|
| 23 |
|
| 24 |
_AI_FOLDER = os.path.join(APP_DIR, "ai")
|
| 25 |
|
|
|
|
| 72 |
"mind": "gemma-4-E2B-it-UD-Q4_K_XL.gguf"
|
| 73 |
}
|
| 74 |
# ββ Startup Memory restore for vector synthesis ββββββββββββββββββββββββββββββββββ
|
| 75 |
+
N_METATRON_TO_LOAD: int = 1
|
| 76 |
+
METATRON_METRONOME: int = 12 # Startup Memory Capsules load interval
|
| 77 |
|
| 78 |
# ββ Context model n_ctx length βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 79 |
# Must leave prompt reserve of 8k: _N_CTX >= len(Z) + len(C) + len(F) + 8k
|
|
|
|
| 95 |
"duckduckgo": False # Privacy based request but lean result summaries
|
| 96 |
}
|
| 97 |
ΞΞ΀ΑΩΞ: float = 1.0 # Seconds per measure
|
| 98 |
+
AWARENESS_CONSCIOUSNESS_METRONOME = 120 # Fetch news every N heartbeats (runtime-editable via /metronome)
|
| 99 |
AWARENESS_MAX_RESULTS: int = 12 # Number of news headlines to fetch
|
| 100 |
was_awareness_metronome: bool = False # Set True at awareness cycle: consciousness at next interval
|
| 101 |
|
main.py
CHANGED
|
@@ -1,37 +1,39 @@
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
"""
|
| 3 |
-
|
|
|
|
|
|
|
| 4 |
|
| 5 |
Flow per turn
|
| 6 |
βββββββββββββ
|
| 7 |
sensor["Z"] β user input
|
| 8 |
Mindlink() β Logic + Muse run in PARALLEL THREADS (buffered)
|
| 9 |
Lambda() β Mind synthesizer streams LIVE to terminal
|
| 10 |
-
memotron() β appends turn to garden['Z'] or garden['
|
| 11 |
with token counts, saves to SQLite
|
| 12 |
-
condensatron() β
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
garden["C"] memory capsule level history
|
| 20 |
garden["Z"] posts level history
|
| 21 |
|
| 22 |
Context truncation
|
| 23 |
ββββββββββββββββββ
|
| 24 |
# Condensatron
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
#
|
| 28 |
-
FRACTALTRON_THRESHOLD_LEVEL: int = 8192
|
| 29 |
-
FRACTALTRON_REDUCTION_LEVEL: int = 0
|
| 30 |
|
| 31 |
The system prompt is always rebuilt fresh in make_request_messages() so it is never
|
| 32 |
-
removed and never needs re-insertion
|
| 33 |
-
The condesatron
|
| 34 |
-
to leave the main instructions context intact,
|
| 35 |
|
| 36 |
Slash commands
|
| 37 |
ββββββββββββββ
|
|
@@ -71,7 +73,7 @@ from config import sensor
|
|
| 71 |
from config import ΞΞ΀ΑΩΞ
|
| 72 |
from config import METATRON_TO_LOAD
|
| 73 |
from config import METATRON_METRONOME
|
| 74 |
-
from config import AWARENESS_CONSCIOUSNESS_METRONOME
|
| 75 |
from config import AWARENESS_MAX_RESULTS
|
| 76 |
from config import FETCH_NEWS_FROM
|
| 77 |
|
|
@@ -398,6 +400,14 @@ def _cmd_export(arg: str) -> None:
|
|
| 398 |
return
|
| 399 |
db_export_session(int(_parts[0]), _parts[1].strip())
|
| 400 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 401 |
def _cmd_help(arg: str) -> None:
|
| 402 |
print()
|
| 403 |
print(" Slash commands")
|
|
@@ -413,6 +423,7 @@ COMMANDS: dict[str, tuple] = {
|
|
| 413 |
"history": (_cmd_history, " β list all past sessions"),
|
| 414 |
"session": (_cmd_session, "<id> β print turns from a session"),
|
| 415 |
"export": (_cmd_export, "<id> <file> β export session to .md file"),
|
|
|
|
| 416 |
"help": (_cmd_help, " β show this command list"),
|
| 417 |
"exit": (_cmd_exit, " β quit the app"),
|
| 418 |
"quit": (_cmd_exit, " β quit the app (alias)"),
|
|
@@ -1183,7 +1194,7 @@ def main() -> None:
|
|
| 1183 |
pass
|
| 1184 |
|
| 1185 |
# ββ X-factor Awarenss and Y-factor Consciousness heartbeats ββββββββββββββ
|
| 1186 |
-
if _heartbeats >= AWARENESS_CONSCIOUSNESS_METRONOME:
|
| 1187 |
# ββ X-factor awareness cycle βββββββββββββββββββββββββββββββββββββββββ
|
| 1188 |
if not config.was_awareness_metronome:
|
| 1189 |
_metatron_heartbeats, _heartbeats = 0, 0
|
|
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
"""
|
| 3 |
+
Lambda Mindlink Memotron Brain:
|
| 4 |
+
config.py
|
| 5 |
+
main.py
|
| 6 |
|
| 7 |
Flow per turn
|
| 8 |
βββββββββββββ
|
| 9 |
sensor["Z"] β user input
|
| 10 |
Mindlink() β Logic + Muse run in PARALLEL THREADS (buffered)
|
| 11 |
Lambda() β Mind synthesizer streams LIVE to terminal
|
| 12 |
+
memotron() β appends turn to garden['Z'], garden['C'] or garden['F']
|
| 13 |
with token counts, saves to SQLite
|
| 14 |
+
condensatron() β check token budget and compress into:
|
| 15 |
+
build_condensatron_input() β post-level into memory capsules (Z to C)
|
| 16 |
+
build_fractaltron_input() β memory capsules into fractals (C to F)
|
| 17 |
+
build_crystaltron_input() β fractals into crystals (F to F)
|
| 18 |
+
|
| 19 |
+
History context:
|
| 20 |
+
βββββββββββββββ
|
| 21 |
+
ALPHAPROMPT main instructions
|
| 22 |
+
garden["F"] fractal and crystal level history
|
| 23 |
garden["C"] memory capsule level history
|
| 24 |
garden["Z"] posts level history
|
| 25 |
|
| 26 |
Context truncation
|
| 27 |
ββββββββββββββββββ
|
| 28 |
# Condensatron
|
| 29 |
+
GARDEN_Z_THRESHOLD: int = 12288 # Context length garden["Z"]
|
| 30 |
+
GARDEN_C_THRESHOLD: int = 12288 # Context length garden["C"]
|
| 31 |
+
GARDEN_F_THRESHOLD: int = 12288 # Context length garden["F"]
|
|
|
|
|
|
|
| 32 |
|
| 33 |
The system prompt is always rebuilt fresh in make_request_messages() so it is never
|
| 34 |
+
removed and never needs re-insertion. No special handling required.
|
| 35 |
+
The condesatron, fractaltron and crystaltron cycle instructions are sent as user prompt,
|
| 36 |
+
to leave the main instructions context intact, thus avoid recompute.
|
| 37 |
|
| 38 |
Slash commands
|
| 39 |
ββββββββββββββ
|
|
|
|
| 73 |
from config import ΞΞ΀ΑΩΞ
|
| 74 |
from config import METATRON_TO_LOAD
|
| 75 |
from config import METATRON_METRONOME
|
| 76 |
+
# from config import AWARENESS_CONSCIOUSNESS_METRONOME
|
| 77 |
from config import AWARENESS_MAX_RESULTS
|
| 78 |
from config import FETCH_NEWS_FROM
|
| 79 |
|
|
|
|
| 400 |
return
|
| 401 |
db_export_session(int(_parts[0]), _parts[1].strip())
|
| 402 |
|
| 403 |
+
def _cmd_metronome(arg: str) -> None:
|
| 404 |
+
if not arg.strip().isdigit():
|
| 405 |
+
print(f" {c.green}Usage: /metronome <seconds> e.g. /metronome 1000000{c.res}")
|
| 406 |
+
return None
|
| 407 |
+
config.AWARENESS_CONSCIOUSNESS_METRONOME = int(arg.strip())
|
| 408 |
+
print(f" {c.green}[metronome] AWARENESS_CONSCIOUSNESS_METRONOME set to {config.AWARENESS_CONSCIOUSNESS_METRONOME}s{c.res}")
|
| 409 |
+
return None
|
| 410 |
+
|
| 411 |
def _cmd_help(arg: str) -> None:
|
| 412 |
print()
|
| 413 |
print(" Slash commands")
|
|
|
|
| 423 |
"history": (_cmd_history, " β list all past sessions"),
|
| 424 |
"session": (_cmd_session, "<id> β print turns from a session"),
|
| 425 |
"export": (_cmd_export, "<id> <file> β export session to .md file"),
|
| 426 |
+
"metronome": (_cmd_metronome, "<seconds> β set awareness/consciousness interval"),
|
| 427 |
"help": (_cmd_help, " β show this command list"),
|
| 428 |
"exit": (_cmd_exit, " β quit the app"),
|
| 429 |
"quit": (_cmd_exit, " β quit the app (alias)"),
|
|
|
|
| 1194 |
pass
|
| 1195 |
|
| 1196 |
# ββ X-factor Awarenss and Y-factor Consciousness heartbeats ββββββββββββββ
|
| 1197 |
+
if _heartbeats >= config.AWARENESS_CONSCIOUSNESS_METRONOME:
|
| 1198 |
# ββ X-factor awareness cycle βββββββββββββββββββββββββββββββββββββββββ
|
| 1199 |
if not config.was_awareness_metronome:
|
| 1200 |
_metatron_heartbeats, _heartbeats = 0, 0
|