| --- |
| 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. |
|
|
|  |
|
|
| ## 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) |
| ``` |
|
|
|  |
|
|
| ## 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} |
| } |
| ``` |
|
|