IICSM local AI brain starter — 1 November 2026 (UTC)
Guide: https://iicsm.org/aidevel/ai-brain.html

Target: Ubuntu 24.04 LTS x86_64, Python 3.12, modern CPU, 16 GB RAM minimum
planning target / 32 GB preferred. No dedicated GPU is required for this CPU path.
Actual latency depends on your machine. Start in English with short turns.

Archive files: companion.py, requirements.txt, README.txt.
Model weights, Linux packages and Ollama are separate downloads.
This is a terminal companion, not a web service or robot controller.

Follow the full guide for prerequisites, download/checksum, installation, audio
device selection, model downloads, tests, troubleshooting, backup and references.

Quick sequence after reviewing the guide and installing Ollama:
  ollama pull qwen3:4b
  cd ~/ai-brain
  python3 -m venv .venv
  source .venv/bin/activate
  python -m pip install -r requirements.txt
  mkdir -p models data
  chmod 700 data
  cd models
  python -m piper.download_voices en_US-lessac-medium
  cd ..
  python companion.py --text
  python companion.py

In voice mode: press Enter at You> to record six seconds, wait for transcript,
then type y to send or Enter to discard. Type a message instead at any time.
Recording stops before model inference or speech output. No wake word/listening
service is included. Input silence gating is a heuristic; verify every transcript.
--seconds 10 changes the recording length. --device 3 selects input device ID 3.
--rate 48000 works with microphones that reject 16000 Hz.

Commands (keyboard only for reliable control):
  /remember preferred_name = Alex
  /facts
  /forget preferred_name
  /reset
  /quit

Only /remember saves durable facts. Ordinary conversation lives in process RAM
and is limited to the last six question/answer turns. Saved facts are capped at
20, 300 characters per value, supplied to the model as data. Facts can be wrong
and are not model training. /forget clears current conversation too. /reset only
clears temporary conversation. Close all copies before backing up the SQLite DB.

Privacy: API endpoint is fixed to http://127.0.0.1:11434/api/chat. Use locally
downloaded qwen3:4b, not a cloud model. Downloads need Internet initially. After
downloads, test a conversation without network. Ollama may retain its own server
logs; inspect those separately. The app does not save chat logs or raw audio.
Temporary WAV files are removed on normal cleanup, not securely erased; disk
encryption and backups matter. Private file permissions do not replace encryption.

The program has no shell execution, external tools, purchases, browser actions,
autonomous work or robot controls. subprocess is used only for fixed Piper and
ffplay invocations with argument lists. Model text cannot choose executables.
No cloud API key, paid subscription, training or fine-tuning is needed.

Verification: Python logic and mocked HTTP/CLI behavior are tested by the author.
Linux package installation, microphone/speaker operation and real model inference
must be tested on your own machine. Do not assume real-time performance.
Piper, Whisper, Qwen and voices retain their own licenses. Check voice model card
and intended use; the download does not grant voice/likeness rights to other voices.
