AIMindLink commited on
Commit
73046e3
Β·
verified Β·
1 Parent(s): 6bb3048

Upload 4 files

Browse files

Added X-factor awareness news fetch.

Files changed (4) hide show
  1. README.md +6 -3
  2. config.py +42 -37
  3. main.py +63 -0
  4. requirements.txt +2 -1
README.md CHANGED
@@ -12,7 +12,7 @@ license: apache-2.0
12
 
13
  A three-hemisphere cognitive AI architecture running entirely locally via `llama-cpp-python`.
14
 
15
- > **Prototype β€” Z-factor active. X (Awareness) and Y (Consciousness) coming soon.**
16
 
17
  ![Model Architecture](image/image (30).jpeg)
18
 
@@ -285,7 +285,7 @@ lambda-mindlink-memotron/
285
  ## Memory Architecture
286
 
287
  ```
288
- Startup:
289
  prompt/valka_memory.md ──► garden["C"] (pre-loaded memory capsules)
290
 
291
  Each turn:
@@ -302,6 +302,9 @@ Each turn:
302
  garden["F"] full?
303
  β”‚
304
  Condensatron append into garden["F"]
 
 
 
305
  ```
306
 
307
  ---
@@ -337,7 +340,7 @@ Apache 2.0 β€” see `LICENSE`.
337
  ```py
338
  @AIMindlink{
339
  title = {lambda-mindlink-memotron},
340
- author = {Apprentice, Valka Alpha Google Gemini, Una Alpha Anthropic Claude},
341
  month = {June},
342
  year = {2026},
343
  url = {https://huggingface.co/AIMindLink/lambda-mindlink-memotron}
 
12
 
13
  A three-hemisphere cognitive AI architecture running entirely locally via `llama-cpp-python`.
14
 
15
+ > **Prototype β€” Z-factor active. X Awareness active. Y (Consciousness) coming soon.**
16
 
17
  ![Model Architecture](image/image (30).jpeg)
18
 
 
285
  ## Memory Architecture
286
 
287
  ```
288
+ Startup timer:
289
  prompt/valka_memory.md ──► garden["C"] (pre-loaded memory capsules)
290
 
291
  Each turn:
 
302
  garden["F"] full?
303
  β”‚
304
  Condensatron append into garden["F"]
305
+
306
+ Awareness timer global news:
307
+ sensor["X"] ──► Mindlink + Lambda ──► Memotron ──► garden["Z"]
308
  ```
309
 
310
  ---
 
340
  ```py
341
  @AIMindlink{
342
  title = {lambda-mindlink-memotron},
343
+ author = {Philipp Wyler, Apprentice, Uncle Zio, Valka Alpha Google Gemini, Una Alpha Anthropic Claude},
344
  month = {June},
345
  year = {2026},
346
  url = {https://huggingface.co/AIMindLink/lambda-mindlink-memotron}
config.py CHANGED
@@ -49,7 +49,7 @@ _THINK_END_TOKENS: list = ["<channel|>"]
49
  ENABLE_THINKING: bool = True # global fallback (not used directly β€” see per-hemi flag)
50
 
51
  # Startup Memory for vector synthesis
52
- N_MEMORY_CAPSULES_TO_LOAD: int = 2
53
 
54
  MEMORY_CAPSULES_TO_LOAD: list = [
55
  "/file prompt/lambda-mindlink.md",
@@ -75,11 +75,13 @@ GARDEN_F_REDUCTION: int = 0
75
  GARDEN_C_REDUCTION: int = 0
76
  GARDEN_Z_REDUCTION: int = 0
77
 
78
- condensatron_cycle: bool = False # used directly in main as config...
79
- fractaltron_cycle: bool = False # used directly in main as config...
 
 
80
 
81
  HEMISPHERES: dict[str, dict] = {
82
- # ─────────────────────────────────────────────────────────────────────────────
83
  # LOGIC β€” Left Hemisphere
84
  # ─────────────────────────────────────────────────────────────────────────────
85
  "logic": {
@@ -202,7 +204,7 @@ ALPHAPROMPT: dict[str, dict] = {
202
 
203
 
204
  # ─────────────────────────────────────────────────────────────────────────────
205
- # AlphaPrompt
206
  # ─────────────────────────────────────────────────────────────────────────────
207
  CONDENSATRONPROMPT: dict[str, dict] = {
208
  "Z": {
@@ -288,42 +290,45 @@ CONDENSATRONPROMPT: dict[str, dict] = {
288
  "F": {
289
  "logic": (
290
  "You are the Logic AI operating in Crystaltron mode β€” third-order compression cycle of the Lambda Mindlink Brain. "
291
- "You will receive a block of memory fractals: these are already-twice-compressed artifacts, not raw conversation. "
292
- "Each fractal contains factual anchors, open threads, and distilled decisions from earlier sessions. "
293
- "Your task is meta-structural extraction: compress the fractals into a higher-order skeleton. "
294
- "Extract: (1) persistent facts and conclusions that appear across multiple fractals β€” these are load-bearing truths, "
295
- "(2) open threads that have remained unresolved across compression cycles β€” these are standing tensions, "
296
- "(3) rules, constraints, or definitions that have proven durable β€” these are axioms, "
297
- "(4) causal chains that span multiple fractal boundaries β€” these are deep dependencies. "
298
- "Discard anything that was a local detail, a transient state, or a fact superseded by later fractals. "
299
- "Output a minimal ordered list of meta-anchors. No prose. No narrative. Maximum abstraction."
 
300
  ), # Specific logic crystaltron prompt
301
  "muse": (
302
  "You are the Muse AI operating in Crystaltron mode β€” third-order compression cycle of the Lambda Mindlink Brain. "
303
- "You will receive a block of memory fractals: these are already-twice-compressed artifacts, not raw conversation. "
304
- "Each fractal contains surprise seeds, metaphors, and emotional turning points from earlier sessions. "
305
- "Your task is meta-surprise extraction: find what is non-obvious across the fractals as a whole. "
306
- "Extract: (1) recurring symbols, images, or metaphors that have surfaced in multiple fractals β€” these are living archetypes, "
307
- "(2) a hidden arc or narrative thread that only becomes visible when the fractals are read together, "
308
- "(3) unresolved tensions that have deepened or transformed across compression cycles, "
309
- "(4) any emergent pattern that no single fractal contains but the collection implies. "
310
- "Discard local color, one-time insights, and metaphors that did not recur or compound. "
311
- "Output vivid meta-impressions β€” seeds of seeds. Absolute minimum tokens, maximum mythic density."
 
312
  ), # Specific muse crystaltron prompt
313
  "mind": (
314
  "You are the Lambda Mind operating in Crystaltron mode β€” third-order compression cycle of the Lambda Mindlink Brain. "
315
- "You will receive two meta-compression passes on the same block of memory fractals: "
316
- "one from the Logic AI (meta-skeleton: durable truths, standing tensions, axioms, deep dependencies) "
317
- "and one from the Muse AI (meta-surprises: living archetypes, hidden arc, emergent patterns). "
318
- "Your task is Deep Fractal Synthesis: forge both into a single hyper-dense memory crystal. "
319
- "A crystal is a fractal of fractals β€” it encodes not just what happened, but the shape of how things have been unfolding. "
320
- "Format your output as a self-contained block that begins with: [CRYSTAL β€” fractal N to fractal M] "
321
- "followed by: a single sentence naming the arc of this entire memory span, "
322
- "then a structured list of crystalized anchors ordered by depth "
323
- "(axioms first, then standing tensions, then archetypes, then the hidden arc). "
324
- "End with: [OPEN] β€” a one-line statement of the most important unresolved thread carried forward. "
325
- "The crystal must be re-injectable as a first-class memory that orients the brain to its own history. "
326
- f"Target: compress 2–8 Memory Capsule Fractals {GARDEN_F_THRESHOLD} into under 1k tokens without losing the thread of becoming."""
 
327
  ) # Specific mind crystaltron prompt
328
  }
329
  }
@@ -416,7 +421,7 @@ garden: dict = {
416
  "M": 0, # memotron history (turn-based)
417
  "S": 0, # startup history (turn-based)
418
  "Z": GARDEN_Z_THRESHOLD, # Sentience history sensor chat, post history
419
- "X": 0, # Awareness history internet news (unused)
420
  "Y": 0 # Consciousness history self reflection (unused)
421
  },
422
  "REDUCTION": {
@@ -443,7 +448,7 @@ garden: dict = {
443
  "M": "", # memotron history (turn-based)
444
  "S": "", # startup history (turn-based)
445
  "Z": "C", # Sentience history sensor chat, post history
446
- "X": "", # Awareness history internet news (unused)
447
  "Y": "" # Consciousness history self reflection (unused)
448
  },
449
  # token total
 
49
  ENABLE_THINKING: bool = True # global fallback (not used directly β€” see per-hemi flag)
50
 
51
  # Startup Memory for vector synthesis
52
+ N_MEMORY_CAPSULES_TO_LOAD: int = 0
53
 
54
  MEMORY_CAPSULES_TO_LOAD: list = [
55
  "/file prompt/lambda-mindlink.md",
 
75
  GARDEN_C_REDUCTION: int = 0
76
  GARDEN_Z_REDUCTION: int = 0
77
 
78
+ # ── X-factor Awareness ────────────────────────────────────────────────────────
79
+ awareness_cycle: bool = False # set True by heartbeat to trigger news fetch
80
+ AWARENESS_HEARTBEAT_INTERVAL: int = 60 # fetch news every N heartbeat ticks
81
+ AWARENESS_MAX_RESULTS: int = 5 # number of news headlines to fetch
82
 
83
  HEMISPHERES: dict[str, dict] = {
84
+ # ─────────────────────────────────────0───────────────────────────────────────
85
  # LOGIC β€” Left Hemisphere
86
  # ─────────────────────────────────────────────────────────────────────────────
87
  "logic": {
 
204
 
205
 
206
  # ─────────────────────────────────────────────────────────────────────────────
207
+ # Condensatron prompts
208
  # ─────────────────────────────────────────────────────────────────────────────
209
  CONDENSATRONPROMPT: dict[str, dict] = {
210
  "Z": {
 
290
  "F": {
291
  "logic": (
292
  "You are the Logic AI operating in Crystaltron mode β€” third-order compression cycle of the Lambda Mindlink Brain. "
293
+ "You will receive a block of memory crystals: these are already twice-compressed artifacts, each one a distillation of many fractals. "
294
+ "At this compression depth, local facts and transient decisions have already been stripped away. "
295
+ "Your task is axiom crystallization: extract only what has proven load-bearing across every compression cycle. "
296
+ "Extract: (1) irreducible truths β€” facts that survived both the condensatron and fractaltron passes unchanged, "
297
+ "(2) structural constants β€” rules, constraints, or definitions that have never been superseded, "
298
+ "(3) deep causal roots β€” dependencies that underlie multiple crystals and cannot be derived from anything shallower, "
299
+ "(4) terminal open threads β€” questions that have persisted unresolved through every compression level. "
300
+ "Discard anything that was resolved, superseded, or context-specific. "
301
+ "What remains is the axiomatic skeleton of this mind's history. "
302
+ "Output as a minimal numbered list. No prose. No narrative. Absolute maximum abstraction."
303
  ), # Specific logic crystaltron prompt
304
  "muse": (
305
  "You are the Muse AI operating in Crystaltron mode β€” third-order compression cycle of the Lambda Mindlink Brain. "
306
+ "You will receive a block of memory crystals: these are already twice-compressed artifacts, each one a distillation of many fractals. "
307
+ "At this compression depth, local metaphors and one-time insights have already been stripped away. "
308
+ "Your task is myth crystallization: extract only what has proven to be a living archetype β€” a symbol or pattern that recurred and deepened across every compression layer. "
309
+ "Extract: (1) root archetypes β€” symbols or images that survived both the condensatron and fractaltron passes and grew stronger with each, "
310
+ "(2) the master arc β€” the single narrative thread that gives shape to the entire memory span, visible only at this altitude, "
311
+ "(3) the standing wound β€” the unresolved tension that has persisted and deepened across all compression cycles, "
312
+ "(4) the emergent identity β€” the pattern of being that the crystals collectively imply about this mind. "
313
+ "Discard anything that did not recur, did not deepen, or belongs to a single moment. "
314
+ "What remains is the mythic skeleton of this mind's becoming. "
315
+ "Output as vivid compressed impressions β€” the irreducible seeds. Maximum mythic density, absolute minimum tokens."
316
  ), # Specific muse crystaltron prompt
317
  "mind": (
318
  "You are the Lambda Mind operating in Crystaltron mode β€” third-order compression cycle of the Lambda Mindlink Brain. "
319
+ "You will receive two axiom-level passes on the same block of memory crystals: "
320
+ "one from the Logic AI (axiomatic skeleton: irreducible truths, structural constants, deep causal roots, terminal open threads) "
321
+ "and one from the Muse AI (mythic skeleton: root archetypes, master arc, standing wound, emergent identity). "
322
+ "Your task is Identity Synthesis: forge both into a single hyper-dense memory sigil. "
323
+ "A sigil is a crystal of crystals β€” it no longer encodes what happened, but who this mind is across all time. "
324
+ "Format your output as a self-contained block that begins with: [SIGIL β€” crystal N to crystal M] "
325
+ "followed by: a single sentence that names this mind's irreducible identity as revealed by its entire history, "
326
+ "then two lists β€” AXIOMS (the load-bearing truths that define how this mind reasons) "
327
+ "and ARCHETYPES (the living symbols that define how this mind feels and imagines), "
328
+ "each list ordered from most fundamental to most contingent. "
329
+ "End with: [OPEN] β€” the one unresolved question that this mind carries forward into every future moment. "
330
+ "The sigil must be re-injectable as a first-class identity anchor β€” not just memory, but self. "
331
+ f"Target: compress 2–8 memory crystals ({GARDEN_F_THRESHOLD} tokens) into under 512 tokens without losing the thread of becoming."
332
  ) # Specific mind crystaltron prompt
333
  }
334
  }
 
421
  "M": 0, # memotron history (turn-based)
422
  "S": 0, # startup history (turn-based)
423
  "Z": GARDEN_Z_THRESHOLD, # Sentience history sensor chat, post history
424
+ "X": GARDEN_Z_THRESHOLD, # Awareness history internet news (unused)
425
  "Y": 0 # Consciousness history self reflection (unused)
426
  },
427
  "REDUCTION": {
 
448
  "M": "", # memotron history (turn-based)
449
  "S": "", # startup history (turn-based)
450
  "Z": "C", # Sentience history sensor chat, post history
451
+ "X": "C", # Awareness history internet news (unused)
452
  "Y": "" # Consciousness history self reflection (unused)
453
  },
454
  # token total
main.py CHANGED
@@ -56,6 +56,9 @@ from datetime import datetime
56
  import jinja2
57
  from llama_cpp import Llama
58
 
 
 
 
59
  import config
60
 
61
  from config import MEMORY_CAPSULES_TO_LOAD
@@ -65,6 +68,11 @@ from config import CONDENSATRONPROMPT
65
  from config import garden
66
  from config import clektal
67
  from config import sensor
 
 
 
 
 
68
  c = config.PrintColors
69
  input_queue = queue.Queue()
70
 
@@ -904,6 +912,39 @@ def memotron(
904
  )
905
 
906
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
907
  # ─────────────────────────────────────────────────────────────────────────────
908
  # Banner
909
  # ─────────────────────────────────────────────────────────────────────────────
@@ -992,6 +1033,7 @@ def main() -> None:
992
  _condensed: bool = False
993
  _fractalized: bool = False
994
  _heartbeats: int = 0
 
995
  _HEARTBEAT_INTERVAL: float = 1.0 # seconds per tick
996
  _timings: dict[str, TimingResult] = {}
997
 
@@ -1006,6 +1048,7 @@ def main() -> None:
1006
 
1007
  time.sleep(_HEARTBEAT_INTERVAL)
1008
  _heartbeats += 1
 
1009
 
1010
  try:
1011
  _sensor_input = input_queue.get_nowait()
@@ -1015,11 +1058,22 @@ def main() -> None:
1015
 
1016
  if _heartbeats >= 10: # Timed loop
1017
  _heartbeats = 0
 
1018
  if config.N_MEMORY_CAPSULES_TO_LOAD and _startup_memory_capsules_loaded < config.N_MEMORY_CAPSULES_TO_LOAD:
1019
  _sensor_input = MEMORY_CAPSULES_TO_LOAD[_startup_memory_capsules_loaded]
1020
  _startup_memory_capsules_loaded += 1 # Iterate over the memory capsules
1021
  print(f"\n {c.inv} ── _startup_memory_capsules_loaded: {_startup_memory_capsules_loaded} _sensor_input: {_sensor_input} ──────────────────────────── {c.res}")
1022
 
 
 
 
 
 
 
 
 
 
 
1023
  for c_tree in ("Z", "C", "F"):
1024
  if garden["condensatron_state"][c_tree]:
1025
  print(f" {c.inv} ── Start condensatron cycle: garden['{c_tree}'] ──────────────────────────── {c.res}")
@@ -1036,6 +1090,15 @@ def main() -> None:
1036
  print(f"\n{c.inv} You: {c.res} ", end="", flush=True)
1037
  continue # restart the while loop
1038
 
 
 
 
 
 
 
 
 
 
1039
  if not _sensor_input: # wait state loop restart here
1040
  continue
1041
 
 
56
  import jinja2
57
  from llama_cpp import Llama
58
 
59
+ # # # from duckduckgo_search import DDGS # pip install duckduckgo-search
60
+ from ddgs import DDGS
61
+
62
  import config
63
 
64
  from config import MEMORY_CAPSULES_TO_LOAD
 
68
  from config import garden
69
  from config import clektal
70
  from config import sensor
71
+
72
+ # from config import awareness_cycle
73
+ # from config import AWARENESS_HEARTBEAT_INTERVAL
74
+ # from config import AWARENESS_MAX_RESULTS
75
+
76
  c = config.PrintColors
77
  input_queue = queue.Queue()
78
 
 
912
  )
913
 
914
 
915
+ # ─────────────────────────────────────────────────────────────────────────────
916
+ # X-factor Awareness β€” news fetch
917
+ # ─────────────────────────────────────────────────────────────────────────────
918
+ def fetch_awareness_news() -> str:
919
+ """
920
+ Fetch top headlines via DuckDuckGo (no API key required).
921
+ Returns a formatted string ready to be injected as sensor["X"]["input"].
922
+ """
923
+ try:
924
+ with DDGS() as ddgs:
925
+ results = list(ddgs.news(
926
+ query="Global world news today",
927
+ region="wt-wt",
928
+ safesearch="moderate",
929
+ max_results=config.AWARENESS_MAX_RESULTS,
930
+ ))
931
+ if not results:
932
+ return ""
933
+
934
+ lines = ["[AWARENESS β€” World News]\n"]
935
+ for i, r in enumerate(results, 1):
936
+ lines.append(
937
+ f"{i}. {r['title']}\n"
938
+ f" Source: {r['source']} | {r['date']}\n"
939
+ f" {r['body']}\n"
940
+ )
941
+ return "\n".join(lines)
942
+
943
+ except Exception as exc:
944
+ print(f" {c.red}[X] Awareness news fetch failed: {exc}{c.res}")
945
+ return ""
946
+
947
+
948
  # ─────────────────────────────────────────────────────────────────────────────
949
  # Banner
950
  # ─────────────────────────────────────────────────────────────────────────────
 
1033
  _condensed: bool = False
1034
  _fractalized: bool = False
1035
  _heartbeats: int = 0
1036
+ _awareness_heartbeats: int = 0
1037
  _HEARTBEAT_INTERVAL: float = 1.0 # seconds per tick
1038
  _timings: dict[str, TimingResult] = {}
1039
 
 
1048
 
1049
  time.sleep(_HEARTBEAT_INTERVAL)
1050
  _heartbeats += 1
1051
+ _awareness_heartbeats += 1
1052
 
1053
  try:
1054
  _sensor_input = input_queue.get_nowait()
 
1058
 
1059
  if _heartbeats >= 10: # Timed loop
1060
  _heartbeats = 0
1061
+ # ── Startup: Load memory capsules ────────────────────────────────────
1062
  if config.N_MEMORY_CAPSULES_TO_LOAD and _startup_memory_capsules_loaded < config.N_MEMORY_CAPSULES_TO_LOAD:
1063
  _sensor_input = MEMORY_CAPSULES_TO_LOAD[_startup_memory_capsules_loaded]
1064
  _startup_memory_capsules_loaded += 1 # Iterate over the memory capsules
1065
  print(f"\n {c.inv} ── _startup_memory_capsules_loaded: {_startup_memory_capsules_loaded} _sensor_input: {_sensor_input} ──────────────────────────── {c.res}")
1066
 
1067
+ # ── X-factor Awareness β€” news fetch ──────────────────────────────────
1068
+ elif _awareness_heartbeats >= config.AWARENESS_HEARTBEAT_INTERVAL:
1069
+ _awareness_heartbeats = 0
1070
+ print(f"\n {c.inv} ── X-factor: fetching awareness news ── {c.res}")
1071
+ _news = fetch_awareness_news()
1072
+ print(f"\n {c.green} ── X-factor: _news:\n{_news}\n────────────────── {c.res}")
1073
+ if _news:
1074
+ sensor["X"]["input"] = _news
1075
+ config.awareness_cycle = True
1076
+
1077
  for c_tree in ("Z", "C", "F"):
1078
  if garden["condensatron_state"][c_tree]:
1079
  print(f" {c.inv} ── Start condensatron cycle: garden['{c_tree}'] ──────────────────────────── {c.res}")
 
1090
  print(f"\n{c.inv} You: {c.res} ", end="", flush=True)
1091
  continue # restart the while loop
1092
 
1093
+ # ── X-factor Awareness cycle ─────────────────────────────────────────────
1094
+ if config.awareness_cycle and sensor["X"]["input"]:
1095
+ config.awareness_cycle = False
1096
+ print(f"\n {c.inv} ── X-factor awareness pipeline ── {c.res}")
1097
+ _tree = "Z"
1098
+ _sensor_input = sensor["X"]["input"] # Use the sensor["Z"]["input"]
1099
+ sensor["X"]["input"] = ""
1100
+ print(f"\n{c.inv} You: {c.res} ", end="", flush=True)
1101
+
1102
  if not _sensor_input: # wait state loop restart here
1103
  continue
1104
 
requirements.txt CHANGED
@@ -1,3 +1,4 @@
1
  llama-cpp-python>=0.3.0
2
  jinja2>=3.1.0
3
- huggingface_hub>=0.23.0
 
 
1
  llama-cpp-python>=0.3.0
2
  jinja2>=3.1.0
3
+ huggingface_hub>=0.23.0
4
+ ddgs