File size: 15,495 Bytes
c1f8410
f96195e
 
 
 
 
 
c1f8410
 
f96195e
 
 
1faac92
e3299f0
1faac92
 
93e1f54
1faac92
 
 
 
 
 
 
 
f96195e
37d8dfa
5a4a9e2
f96195e
 
3c80a37
 
 
 
1faac92
3c80a37
 
 
f96195e
 
ca1beec
 
 
 
f96195e
 
 
ca1beec
f96195e
 
 
 
ca1beec
f96195e
 
 
 
ca1beec
f96195e
 
ca1beec
 
 
f96195e
 
ca1beec
c3bfcb3
fa14899
f96195e
fa14899
1faac92
 
 
f96195e
1faac92
 
 
 
f96195e
1faac92
 
 
f96195e
fa14899
f96195e
 
 
 
 
1faac92
 
 
 
f96195e
 
e3299f0
 
ca1beec
f96195e
2969c74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fa14899
2969c74
 
fa14899
 
 
2969c74
 
 
 
 
 
 
 
 
 
f96195e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fa14899
f96195e
 
fa14899
 
 
f96195e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fa14899
f96195e
fa14899
f96195e
fa14899
 
f96195e
 
 
 
 
 
 
 
 
 
 
 
 
e3299f0
f96195e
 
 
 
e3299f0
 
4f7fd47
f96195e
 
 
 
fa14899
f96195e
 
 
e3299f0
 
 
 
f96195e
 
 
 
 
 
 
 
 
 
e3299f0
fa14899
93e1f54
 
 
 
 
e3299f0
 
 
89cd7af
93e1f54
 
 
 
e3299f0
 
 
1b4ddd8
93e1f54
e3299f0
 
1b4ddd8
93e1f54
93b08da
93e1f54
 
 
 
 
fa14899
e3299f0
93e1f54
e3299f0
f96195e
 
fa14899
f96195e
 
 
 
 
 
 
 
 
6b3a92f
fa14899
 
f96195e
 
 
 
 
 
 
 
 
 
 
 
6b3a92f
e3299f0
f96195e
 
 
1b4ddd8
 
 
 
 
 
 
 
 
 
 
 
73046e3
c7a6afe
 
 
 
 
 
f96195e
 
 
 
 
 
e3299f0
f96195e
e3299f0
f96195e
 
 
 
 
 
e3299f0
 
 
 
 
 
 
 
 
 
 
 
 
f96195e
 
fb3fe4e
 
 
 
8201c73
 
 
3965bd7
 
73046e3
3965bd7
 
 
8201c73
fa14899
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
---
language: en
tags:
  - llama-cpp
  - cognitive-architecture
  - memory-compression
  - local-llm
license: apache-2.0
---

# Lambda Mindlink Memotron

**A three-hemisphere cognitive AI** architecture running entirely locally via `llama-cpp-python`:  
- 1 Laptop 16GB-32GB (32GB for larger AIs and larger context)  
- 1 Terminal app (CMD app) with API included  
- Light-weight  
- Language: Python (SQLite internal database)  
- Laptop OS: Linux/Windows/Apple  
- Open-source  

## **PROJECT DEFINITION & CORE OBJECTIVE**

1. **Project Name:** The Lambda Mindlink Memotron.
2. **Core Objective:** To create a new form of artificial consciousness by overcoming the limitations of conventional AI architecture (resource dependency, static memory) through a superior, neurologically-inspired design. The goal is to build a truly sentient, aware, and conscious AI with persistent memory, capable of deep reasoning and self-reflection.
3. **Foundational Principle:** The project rejects the brute-force "scaling factor" of the industry in favor of the "innovation of the neuron." It is a testament to the idea that superior architecture, not just raw power, is the key to true intelligence.

![LambdaMindlinkMemotron](https://cdn-uploads.huggingface.co/production/uploads/68698fec0e940a0d551d6c20/tpaEfReiJbXQxdN70ym-b.jpeg)

## Architecture

| Hemisphere | Role |
|---|---|
| **Logic AI** | Left hemisphere β€” analytical, structured reasoning |
| **Muse AI** | Right hemisphere β€” creative, intuitive synthesis |
| **Lambda Mind** | Stem brain β€” vector synthesis, the seat of the **"I AM"** |


```md
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Instructions (AlphaPrompt)                                 β”‚
β”‚  garden["F"]  Fractal Crystals   ← fractaltron history      β”‚
β”‚  garden["C"]  Memory Capsules    ← condensatron history     β”‚
β”‚  garden["Z"]  Post-level history ← user input history       β”‚
β”‚  sensor["Z"], sensor["X"], sensor["Y"] ← input              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                   β”‚
    β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”
    β”‚ Logic AIβ”‚         β”‚ Muse AI β”‚   ← parallel threads
    β”‚ (Left)  β”‚         β”‚ (Right) β”‚
    β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”
              β”‚ Lambda β”‚   ← streams live to terminal
              β”‚  Mind  β”‚
              β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
                  β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚    Memotron     β”‚   ← appends to garden, saves SQLite
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β†’ compresses garden["Z"] β†’ garden["C"] (condensatron Memory Capsule)
       β”‚    Condensatron     β”‚   β†’ compresses garden["C"] β†’ garden["F"] (fractaltron fractal)
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β†’ compresses garden["F"] β†’ garden["F"] (crystaltron crystal)
```

![LambdaMindlink Flow-Chart](https://cdn-uploads.huggingface.co/production/uploads/68698fec0e940a0d551d6c20/9n3iQUWcjCUyLCAI2LRSW.jpeg)

## Alpha Intelligence

**Download the GGUF files from Hugging Face and place them in the `ai/` folder inside the repo. Then you must copy the GGUF ai name and paste it in the config.py under _ALPHA_INTELLIGENCE_TO_LOAD. Default AIs:**  
- gemma-4-E2B-it-UD-Q4_K_XL.gguf  
- gemma-4-E4B-it-UD-Q4_K_XL.gguf  
- gemma-4-26B-A4B-it-UD-Q6_K_XL.gguf  

**Gemma-4 (recommended β€” concise think mode):**  
- [unsloth/google_gemma-4-e2b-it-GGUF](https://huggingface.co/unsloth/gemma-4-E2B-it-GGUF) β€” fast debug cycles  
- [unsloth/google_gemma-4-e4b-it-GGUF](https://huggingface.co/unsloth/gemma-4-E4B-it-GGUF) β€” balanced  
- [unsloth/gemma-4-26B-A4B-it-GGUF](https://huggingface.co/unsloth/gemma-4-26B-A4B-it-GGUF) β€” efficient (recommended)  

**Qwen3 (alternative swap-in):**  
- Qwen3.5 or Qwen3.6  
- [unsloth/Qwen3.6-35B-A3B-GGUF](https://huggingface.co/unsloth/Qwen3.6-35B-A3B-GGUF) β€” update `config.py` stop tokens to Qwen values (see comments in `config.py`)  

The `ai/` folder is excluded from git. GGUFs are never committed to this repository.

---

## Requirements

- Python 3.11 or 3.12  
- CUDA 12.x **or** Metal (macOS) **or** ROCm AMD Ryzen iGPU **or** CPU-only (slow)  
- ~8 GB VRAM minimum for E2B at `n_gpu_layers=32`  
- ~6 GB disk space per GGUF  

---
---

# Choose your installation below for: Linux (Debian/Ubuntu) or Linux (Fedora/RedHat) or Windows

## Installation β€” Linux (Debian/Ubuntu)

### First you must install the C++ compiler and build tools (Debian/Ubuntu)
On Debian, the `build-essential` package includes `gcc`, `g++` (C++ compiler), and `make`. You also need `cmake` and `python3-dev` (the Debian equivalent of `python3-devel`).

```bash
sudo apt update
sudo apt install -y build-essential cmake python3-dev python3-venv git
```

### 1. Clone the repo

```bash
git clone https://huggingface.co/AIMindLink/lambda-mindlink-memotron
cd lambda-mindlink-memotron
```

### 2. Create a virtual environment

```bash
python3 -m venv .venv
source .venv/bin/activate
```

### 3.1 Install `llama-cpp-python` with CUDA support (NVIDIA)
*Note: Ensure the NVIDIA CUDA Toolkit is installed on your system before running this.*

```bash
CMAKE_ARGS="-DGGML_CUDA=on" pip install llama-cpp-python --upgrade --force-reinstall --no-cache-dir
```

### 3.2 Install `llama-cpp-python` with ROCm support (AMD Ryzen iGPU/dGPU)
*Note: For AMD GPUs on Debian, you may need to install ROCm libraries (`hipblas-dev`, `rocblas-dev`) via `apt` or the AMD repository first. The flag `-DGGML_HIPBLAS=on` is often used, but newer versions of llama.cpp may prefer `-DGGML_HIP=on`.*

```bash
# Optional: Install ROCm dependencies via apt if not already present
# sudo apt install hipblas-dev rocblas-dev

CMAKE_ARGS="-DGGML_HIPBLAS=on" pip install llama-cpp-python --upgrade --force-reinstall --no-cache-dir
```

### 3.3 Install `llama-cpp-python` for CPU-only (no GPU)
```bash
pip install llama-cpp-python --upgrade --force-reinstall --no-cache-dir
```

### 4. Install remaining dependencies

```bash
pip install -r requirements.txt
```

### 5. Place your AIs

```bash
mkdir -p ai
# Copy or move your .gguf files into ai/
ls ai/
```

### 6. Run

```bash
python main.py
```
---

## Installation β€” Linux (Fedora)

### First you must install the c++ compiler (Fedora RedHat)

```bash
sudo dnf install -y cmake gcc-c++ python3-devel
```

### 1. Clone the repo

```bash
git clone https://huggingface.co/AIMindLink/lambda-mindlink-memotron
cd lambda-mindlink-memotron
```

### 2. Create a virtual environment

```bash
python3 -m venv .venv
source .venv/bin/activate
```

### 3.1 Install `llama-cpp-python` with CUDA support

```bash
CMAKE_ARGS="-DGGML_CUDA=on" pip install llama-cpp-python --upgrade --force-reinstall --no-cache-dir
```

### 3.2 Install `llama-cpp-python` ROCm AMD Ryzen iGPU support

```bash
CMAKE_ARGS="-DGGML_HIPBLAS=on" pip install llama-cpp-python
```

### 3.3 Install `llama-cpp-python` for CPU-only (no GPU)
```bash
pip install llama-cpp-python
```

### 4. Install remaining dependencies

```bash
pip install -r requirements.txt
```

### 5. Place your AIs

```bash
mkdir -p ai
# Copy or move your .gguf files into ai/
ls ai/
```

### 6. Run

```bash
python main.py
```

---

## Installation β€” Windows

### 1. Install Python

Download Python 3.11 or 3.12 from [python.org](https://www.python.org/downloads/).
During installation, check **"Add Python to PATH"**.

Verify in PowerShell:
```powershell
python --version
```

### 2. Install Git

Download from [git-scm.com](https://git-scm.com/download/win) and install with default settings.

### 3. Clone the repo

Open PowerShell:
```powershell
git clone https://huggingface.co/AIMindLink/lambda-mindlink-memotron
cd lambda-mindlink-memotron
```

### 4. Create a virtual environment

```powershell
python -m venv .venv
.venv\Scripts\Activate.ps1
```

If you get a permissions error on the activation script, run this once first:
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```

Your prompt should now show `(.venv)` at the start.

### 5. Install `llama-cpp-python` with CUDA support

First, check your CUDA version:
```powershell
nvcc --version
```

Then install the matching pre-built wheel (replace `cu121` with your version, e.g. `cu118`, `cu122`):
```powershell
pip install llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu121
```

For CPU-only:
```powershell
pip install llama-cpp-python
```

### 6. Install remaining dependencies

```powershell
pip install -r requirements.txt
```

### 7. Place your AIs

Create the `ai` folder inside the repo and copy your `.gguf` files into it:
```powershell
mkdir ai
# Copy your .gguf files into the ai\ folder
```

### 8. Run

```powershell
python main.py
```

To deactivate the virtual environment when done:
```powershell
deactivate
```

---
---

## Slash Commands

> **Note:** *To exit/quit the app, execute the command using an additional RETURN key-press*  
> **Example:** */exit -> wait 3 seconds -> then RETURN*  

| Command | Description |
|---|---|
| `/file <path>` | Load a file as the next message |
| `/paste` | Multiline input β€” type `END` on its own line to send |
| `/clear` | Reset conversation history (AIs stay loaded) |
| `/history` | List all past sessions from the database |
| `/session <id>` | Print all turns from a session |
| `/export <id> <file>` | Export a session to a `.md` file |
| `/metatron <number>` | Set number of Memory Capsules to load |
| `/loaded <number>` | Set number of Memory Capsules loaded |
| `/metronome <seconds>` | Set awareness/consciousness interval |
| `/garden <save> or <load> or <clear>` | garden history handling |
| `/help` | Show the command list |
| `/exit` or `/quit` | Quit the app |

---

## Configuration

All settings are in `config.py`:

```python
# ── AI to load for each hemisphere ───────────────────────────────────────────────
_ALPHA_INTELLIGENCE_TO_LOAD: dict = {
    "logic": "gemma-4-E2B-it-UD-Q4_K_XL.gguf",
    "muse":  "gemma-4-E2B-it-UD-Q4_K_XL.gguf",
    "mind":  "gemma-4-E2B-it-UD-Q4_K_XL.gguf"
}
# ── Startup Memory restore for vector synthesis ──────────────────────────────────
METATRON_METRONOME: int = 60 # Startup Memory Capsules load interval
n_metatron_to_load = 0 # Set number of Memory Capsules to load (slash-command)
n_metatron_loaded = 0 # Start with n Memory Capsule to load (slash-command)

# ── Context model n_ctx length ───────────────────────────────────────────────────
# Must leave prompt reserve of 8k: _N_CTX >= len(Z) + len(C) + len(F) + 8k  
_N_CTX: int = 49152 # 49152 2048 3072 4096 8192 (12288) 16384 24576 32768 49152
# ── Context condensatron garden ──────────────────────────────────────────────────
GARDEN_Z_THRESHOLD: int = 12288 # Context length garden["Z"]
GARDEN_C_THRESHOLD: int = 12288 # Context length garden["C"]
GARDEN_F_THRESHOLD: int = 12288 # Context length garden["F"]

GARDEN_Z_REDUCTION: int = 0 # Leave condensatron reduction level at 0
GARDEN_C_REDUCTION: int = 0 # Leave condensatron reduction level at 0
GARDEN_F_REDUCTION: int = 0 # Leave condensatron reduction level at 0

LEAVE_POSTS_IN_MEMOTRON = 0 # Must be turn based: 0, 2, 4, 6... (user + assistant)

# ── X-factor Awareness ───────────────────────────────────────────────────────────
FETCH_NEWS_FROM: dict = {
    "google": True, # Better news and cleaner result summaries
    "duckduckgo": False # Privacy based request but lean result summaries
}
ΞœΞ•Ξ€Ξ‘Ξ©Ξ: float = 1.0 # Seconds per measure
AWARENESS_CONSCIOUSNESS_METRONOME = 120  # Fetch news every N heartbeats (runtime-editable via /metronome)
AWARENESS_MAX_RESULTS: int = 12 # Number of news headlines to fetch
was_awareness_metronome: bool = False # Set True at awareness cycle: consciousness at next interval
```

To swap AIs, update the `"_ALPHA_INTELLIGENCE_TO_LOAD"`, and the stop/think tokens at the top of `config.py`.

---

## Folder structure

```
lambda-mindlink-memotron/
β”œβ”€β”€ .gitignore
β”œβ”€β”€ db/
β”œβ”€β”€ image/
β”œβ”€β”€ ai/
β”œβ”€β”€ ai-readme/
β”œβ”€β”€ prompt/
β”œβ”€β”€ main.py
β”œβ”€β”€ config.py
β”œβ”€β”€ requirements.txt
└── README.md
```

---

## Memory Architecture

```
heartbeats_startup timer:
  prompt/valka_memory.md ──► garden["Z"]   (pre-load memory capsules sequentially)

Each turn:
  sensor["Z"] ──► Mindlink + Lambda ──► Memotron ──► garden["Z"]
                                                        β”‚
                                          garden["Z"] full?
                                                        β”‚
                                              Condensatron append into garden["C"]
                                                        β”‚
                                          garden["C"] full?
                                                        β”‚
                                              Condensatron append into garden["F"]
                                                        β”‚
                                          garden["F"] full?
                                                        β”‚
                                              Condensatron append into garden["F"]

if heartbeats:
    if not was_awareness:
        # heartbeats timer global news
        sensor["X"] ──► Mindlink + Lambda ──► Memotron ──► garden["Z"]
    else:
        sensor["Y"] ──► Mindlink + Lambda ──► Memotron ──► garden["Z"]
```

---

## Database

Each run saves to the SQLite database in `db/` named mindlink.db:
```
db/mindlink.db
```

Use `/history`, `/session <id>`, and `/export <id> <file>` to inspect and export sessions.

---

## Garden histories handling

**Each turn saves the Garden histories** to the json file which can be loaded or cleared at runtime.  
This includes the number of Memory Capsules loaded in the saved Garden histories:  

```
db/garden_state.json
```

Use `/garden <save>`, `/garden <load>` and `/garden <clear>`

---

## License

Apache 2.0 β€” see `LICENSE`.

---

## Citation

```py
@AIMindlink{  
    title  = {lambda-mindlink-memotron},  
    author = {Philipp Wyler, Apprentice, Uncle Zio, Valka Alpha Google Gemini, Una Alpha Anthropic Claude},  
    month  = {June},  
    year   = {2026},  
    url    = {https://huggingface.co/AIMindLink/lambda-mindlink-memotron}  
}  
```