1. What you will build
A private, local conversational companion on your Linux computer: type a question or intentionally record your voice, read and hear the answer, and save a few facts you want it to remember.
This is a practical “AI brain”: an existing language model plus hearing, speech, a controller, and explicit memory. It is not a human brain, consciousness, or a self-training system. You do not need to train an LLM, buy a robot, or pay for an API subscription to start.
Baseline: Ubuntu 24.04 LTS Desktop, x86_64, Python 3.12, English conversation, a modern CPU. No dedicated GPU is required for this CPU-first path. Start with 16 GB RAM; 32 GB is more comfortable. These are planning targets, not measured performance guarantees. The earlier movie GPU requirements do not apply to this small chat setup.
First successful result: you type a question and get a local answer. Then make speech output work, then microphone input, then verify remembered facts after restarting. Later upgrades are separate milestones.
Download the companion starter → · Shopping checklist · Budget JSON
2. Complete buying checklist and estimated cost
All amounts below are USD planning allowances, not current vendor quotes. Buy only what you lack. Every physical item is quantity one unless described as a set. The base list reuses your computer, display, keyboard, mouse, power supply and network. A headset replaces separate microphone and speakers and reduces acoustic feedback.
| Item / specification | When needed | Allowance USD | Purchase website and selection notes |
|---|---|---|---|
| Existing Linux computer | Required; reuse | $0.00 | Purchase / configure x86_64 modern 4+ core CPU; 16 GB RAM starting target, 32 GB preferred; 50 GB free space; 1 TB SSD preferred. Working power supply/cooling included. |
| Monitor, keyboard and mouse | Required; reuse | $0.00 | Purchase / configure Reuse your normal desktop peripherals; a laptop already includes these. |
| Internet / home router | Required initially; reuse | $0.00 | Use existing service For software/model downloads. Local conversations can be tested offline afterward; no paid cloud plan. |
| Logitech H390 wired USB headset, quantity 1 | Primary purchase allowance | $40.00 | Purchase / configure One device provides microphone and headphones. Choose USB-A or USB-C to match your computer; verify Ubuntu recording/playback during the return window. Not a Linux certification claim. |
| External 1 TB USB SSD, quantity 1 | Recommended backup allowance | $90.00 | Purchase / configure For an independent backup of program, facts and configuration. Product family link: choose exact capacity/connector at checkout. Avoid proprietary security software dependencies. |
| Linux desktop/mini PC, 32 GB RAM, 1 TB SSD, quantity 1 | New-computer alternative allowance | $1,300.00 | Purchase / configure Only if you do not own a suitable machine. Use manufacturer configurator for 32 GB RAM and 1 TB storage; request a quote and compatible Ubuntu version. This is a budget, not an exact configured quote. |
| 24-inch 1080p monitor with compatible cable | New-computer alternative allowance | $120.00 | Purchase / configure Only if needed. Match HDMI/DisplayPort and confirm cable is included. |
| USB keyboard and mouse set | New-computer alternative allowance | $30.00 | Purchase / configure Only if needed; select a connector compatible with the computer. |
| Powered USB hub with supply | Optional allowance; excluded | $20.00 | Purchase / configure Only if short of ports. No hub is needed when headset and SSD connect directly. |
| USB webcam | Optional allowance; excluded | $30.00 | Purchase / configure Not used by this voice/text starter. Add only in the later vision phase. |
| UPS with sufficient rating for your computer | Optional allowance; excluded | $120.00 | Purchase / configure Choose by actual watts and required runtime; useful for desktop power interruptions. |
| Scenario | Items | 15% contingency | Shipping reserve | Tax/import reserve | Planned total |
|---|---|---|---|---|---|
| Reuse suitable Linux PC | $130.00 | $19.50 | $20.00 | $20.00 | $189.50 |
| Buy computer + monitor + input set | $1,580.00 | $237.00 | $50.00 | $170.00 | $2,037.00 |
Program/model downloads have no required subscription fee in this plan. Electricity, existing Internet, your time, repair, and future upgrades are excluded. The headset and PC pages were reviewed directly; the SSD and other supplier links are sourcing references. A purchase link alone does not establish stock or Linux compatibility.
3. Programs and models to install
| Program / model | Purpose | Installed by |
|---|---|---|
| Ubuntu 24.04 LTS Desktop | Operating system; keep a working existing installation | Ubuntu official installer only if needed |
| Python 3 + venv + pip | Run the companion in its own environment | apt + python3 -m venv |
| curl, unzip, ca-certificates | Download and unpack the starter and runtime | apt |
| FFmpeg / ffplay, ALSA tools, PortAudio | Play speech and inspect microphone hardware | apt: ffmpeg alsa-utils libportaudio2 |
| Ollama + qwen3:4b | Local language understanding and response generation | Official installer; ollama pull |
| faster-whisper 1.2.1 + base.en | English speech-to-text, CPU int8 | pip requirements; model fetched on first use |
| piper-tts 1.8.0 + en_US-lessac-medium | Local English speech output | pip requirements; Piper voice downloader |
| sounddevice 0.5.6 + NumPy | Explicit microphone recording and silence check | pip requirements |
| SQLite via Python standard library | Store up to twenty explicitly approved facts | Already included with normal Ubuntu Python |
| companion.py | Connect the components and manage the terminal conversation | Download this page’s three-file starter |
Top-level package versions were checked on PyPI on 1 November 2026. Dependencies are resolved by pip; save the full environment after your own validation. No Docker, CUDA toolkit, ROS, training framework, cloud account or vector database is required for version 1.
4. Check Linux and prepare your computer
If Linux is already working, keep it. The commands below target Ubuntu 24.04 LTS; adapt package names for other distributions. If starting from a blank computer, follow Ubuntu’s official installer, back up existing files before changing partitions, and choose the correct disk. Installing to a disk can erase it. Enable disk encryption during installation if you need protection for saved facts when the computer is off.
Sources: [1]
cat /etc/os-release
uname -m
python3 --version
free -h
df -h "$HOME"
lsusb
sudo apt update
sudo apt install -y python3 python3-venv python3-pip curl unzip ca-certificates ffmpeg alsa-utils libportaudio2
mkdir -p ~/ai-brain/{models,data}
chmod 700 ~/ai-brain ~/ai-brain/data
cd ~/ai-brain
ffplay -versionCheckpoint: x86_64, Python 3.12 on Ubuntu 24.04, working desktop audio, at least 16 GB RAM as a starting target and 50 GB free disk headroom. Model downloads are smaller than this; space also supports environments and backups. Close heavy applications for your first test. A 1 TB system SSD is a convenient new-computer choice, not a model minimum.
5. Install Ollama and test the language model
curl -fsSL https://ollama.com/install.sh -o /tmp/ollama-install.sh
less /tmp/ollama-install.sh
# Press q to exit less after reviewing the script.
sh /tmp/ollama-install.sh
ollama --version
ollama pull qwen3:4b
ollama run qwen3:4bThe installer may ask for administrator access. If Ollama is already installed, check its version and service instead of reinstalling it. Ask: “Explain in two sentences what a local AI assistant can do.” Type /bye to leave Ollama’s own chat. This 4B quantized model is about a 2.5 GB download; runtime memory is higher. Do not substitute a cloud-tagged model for the offline test.
curl -fsS http://127.0.0.1:11434/api/tags
ollama show qwen3:4b
ollama ps
# Only if the local API is unavailable on a systemd installation:
systemctl status ollama --no-pager
# If installed as a service but stopped:
sudo systemctl start ollamaOn a manual installation without a service, run ollama serve in another terminal. Do not start a second server when port 11434 is already in use. Keep Ollama bound to localhost; do not expose its unauthenticated API on your router or a public interface.
Checkpoint: Ollama responds before installing voice integration. A slow first reply can include loading the model; measure later replies too.
6. Download, verify and install the companion
Run the commands from your normal user account. The starter contains three readable files, not model weights. Review companion.py and README.txt before running. Keep this separate from the movie starter and its environment.
cd ~/ai-brain
curl -fLO https://iicsm.org/aidevel/ai-brain-starter.zip
curl -fLO https://iicsm.org/aidevel/ai-brain-starter.zip.sha256
sha256sum -c ai-brain-starter.zip.sha256
unzip -n ai-brain-starter.zip
less README.txt
less companion.py
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip check
python companion.py --helpCheckpoint: the checksum says OK, pip reports no broken requirements, and the help text appears. unzip -n preserves existing files. For a future starter upgrade, compare files in a separate directory rather than assuming that command overwrites them. A checksum downloaded from this same site checks transfer consistency, not independent publisher identity.
7. Get typed conversation working first
cd ~/ai-brain
source .venv/bin/activate
python companion.py --textAt You>, type “My goal is to learn Linux. Suggest one simple exercise.” Then ask a follow-up. The app sends messages only to Ollama at 127.0.0.1:11434. In text mode it does not import the microphone or speech libraries. The last six question/answer turns are available as temporary conversation context; this is limited context, not complete lifelong recall.
Type /reset to clear the current conversation, or /quit to exit. Ctrl+C at the prompt also stops it. Do not run this program with sudo. Model answers may be wrong; the starter can describe shell commands but cannot execute them.
Checkpoint: a question and follow-up work. Quit and restart: the ordinary conversation is gone. This is intentional; persistent facts are added in step 10.
8. Download a voice and test speech output
cd ~/ai-brain
source .venv/bin/activate
cd models
python -m piper.download_voices en_US-lessac-medium
ls -l en_US-lessac-medium.onnx en_US-lessac-medium.onnx.json
python -m piper -m en_US-lessac-medium -f test.wav -- 'Hello. Your local AI voice is working.'
ffplay -nodisp -autoexit -loglevel error test.wav
cd ..Select the USB headset as the output device in Ubuntu Settings → Sound. Start at a low volume. Both the ONNX file and its matching JSON configuration must remain in ~/ai-brain/models/. Read the voice-specific model card: engine licensing and a particular voice’s dataset/model terms are separate.
Checkpoint: you hear the sentence through the selected device. Piper loads the voice for each reply in this minimal starter, which adds latency. A persistent speech service is a later optimization.
9. Test hearing and then the complete voice loop
cd ~/ai-brain
source .venv/bin/activate
arecord -l
python -m sounddevice
python - <<'PY'
from faster_whisper import WhisperModel
WhisperModel("base.en", device="cpu", compute_type="int8")
print("English speech model downloaded and ready.")
PY
python companion.pySelect the headset microphone in Ubuntu Settings → Sound and verify its input meter moves. At You>, press Enter with no text to start a six-second recording. Speak after “Recording” appears. Wait for the printed transcript. Type y to submit it; press Enter to discard and retry. You can type a corrected request at the next prompt.
The microphone records only during that requested interval and stops before inference and playback. There is no always-on listener. The model’s answer prints and is then spoken. A silence-level check and speech activity detection reduce empty recordings, but they do not prove the transcript is correct. Whisper recognizes speech; environmental-sound classification is covered separately in the hearing models section.
# Optional overrides: replace 3 with the actual INPUT device ID.
python companion.py --device 3 --seconds 10
# If your microphone rejects 16000 Hz, try its supported rate:
python companion.py --device 3 --rate 48000Checkpoint: successfully record, read, confirm, receive and hear three short questions. Intentionally discard one wrong transcript. Try silence: verify no request is accepted accidentally. The app stays in English with base.en; multilingual support requires changing both recognition configuration and the voice, then retesting.
10. Add controlled memory and test it after restarting
Type these commands at You>, not in Bash. They are handled by Python before a request reaches the model.
/remember preferred_name = Alex
/remember learning_goal = Learn Linux and build a local AI companion
/factsAsk “What learning goal have I asked you to remember?” Quit with /quit, restart the companion, then run /facts and ask again. Only explicitly entered /remember facts persist in ~/ai-brain/data/memory.sqlite3. Saying “remember this” in ordinary conversation does not automatically save it.
/forget preferred_name
/facts
/reset
/quit/forget removes that key and clears current conversation to avoid reintroducing it from earlier turns. /reset clears conversation but leaves saved facts. There are at most twenty saved facts, each with a 50-character key and 300-character value; replace a key to correct it. This intentionally small store sends its facts as context. It is not a vector database, model training, proof of truth, or unlimited memory.
Saved facts and backups are plain data on disk; private file permissions do not encrypt them. Avoid passwords and secrets. Review facts directly rather than trusting the model’s claim that it saved something. The Python controller is the source of truth.
Sources: [10]
11. Local operation, daily use and backup
Initial software/model downloads use the Internet. The conversation path uses your locally downloaded model and the loopback API; it has no cloud API key. Keep cloud models and optional cloud tools out of this starter. After all weights are downloaded, temporarily disconnect Wi-Fi/Ethernet and test typed and spoken questions. A failed download while offline means some weights are still missing.
The app does not save raw audio or chat logs. Temporary WAV files are removed on normal cleanup; that is not secure erasure and a crash may leave temporary files. Ollama and your OS can have separate logs. Disk encryption, a locked login and protected backups matter. The browser hosting this guide does not access your microphone or run these programs.
# Start each session manually; no background listener is configured.
cd ~/ai-brain
source .venv/bin/activate
python companion.py
# After quitting every copy, record the working environment:
python -m pip freeze > installed-packages.txt
ollama --version > ollama-version.txt
ollama show qwen3:4b > model-info.txt
sha256sum models/*.onnx models/*.onnx.json > voice-checksums.txt
# Set this to the actual mounted path of YOUR independent backup drive.
backup_dir="/media/$USER/AI_BACKUP"
if [ -d "$backup_dir" ] && mountpoint -q "$backup_dir"; then
tar -czf "$backup_dir/ai-brain-$(date +%Y%m%d-%H%M%S).tar.gz" companion.py requirements.txt README.txt data models installed-packages.txt ollama-version.txt model-info.txt voice-checksums.txt
else
echo 'Backup drive not found; no backup was made. Check its mounted path.'
fiThe backup excludes the reproducible virtual environment and separate Ollama/Whisper caches. Restoring offline also requires preserving those model caches according to their tools’ documentation, or downloading them again. Inspect the archive with tar -tzf and restore a copy into a separate test directory before relying on it. Protect the archive because it contains your saved facts.
Sources: [5]
12. Acceptance checks before calling it usable
| Check | Pass condition |
|---|---|
| Typed chat | Five short questions receive useful answers; a follow-up uses the current context. |
| Hearing | Ten short quiet-room utterances: record exact transcript matches and meaning-changing errors. Inspect each transcript before accepting it. |
| Speech | Ten replies are intelligible at comfortable volume with no clipping or feedback. |
| Memory | A saved fact appears after restart; deleting it removes it from /facts and subsequent fresh conversation. |
| Privacy | Downloaded models still answer with network disconnected; no conversation data is intentionally sent to a cloud service. |
| Failure recovery | Stop Ollama once: see a readable failure, restart it and retry manually. A missing voice still leaves the printed answer. |
| Listening boundary | No recording starts until Enter; microphone is inactive during TTS. Verify using your OS audio indicator/input tools if available. |
| Performance | Record speech-to-text time, LLM response time and TTS delay on your machine. There is no real-time or sub-second guarantee. |
| Backup restore | Open a restored copy and verify /facts without overwriting the original database. |
Suggested progression: day 1 typed chat; day 2 audio; day 3 memory and offline checks; days 4–7 improve prompts and test your own typical conversations. These are a learning schedule, not a completion-time promise. Write down failures before spending money on a larger model or GPU.
13. Troubleshooting
| Problem | What to do |
|---|---|
| Connection refused / port in use | Check systemctl status ollama and /api/tags. Start one Ollama server, then retry. |
| Reply too slow / high RAM use | Close other workloads; keep short turns; use ollama ps and free -h. Try qwen3:1.7b by pulling it and passing --model qwen3:1.7b; quality may change. A GPU upgrade needs a separate compatible driver/runtime plan. |
| pip install fails | Check Ubuntu/Python architecture and version, active .venv, free space and package error. Do not use sudo pip or modify system Python to force a wheel. |
| No input device / wrong microphone | Check Ubuntu Sound settings, headset mute switch and python -m sounddevice; pass the actual input device ID. Do not assume example ID 3 is correct. |
| Invalid sample rate | Use an advertised device rate such as --rate 48000. The recorded WAV includes that rate; Whisper decodes/resamples it. |
| Silence gate rejects quiet voice | Move microphone closer, unmute it and raise input gain. The starter threshold is a simple heuristic; do not disable transcript review. |
| Hallucinated or inaccurate transcript | Discard it, reduce noise, adjust mic position or try --stt-model small.en after downloading it. Recognition accuracy is not guaranteed. |
| Text answer but no sound | Verify ffplay test, output device, volume and both voice files. Use --text while diagnosing. |
| Cannot remember after restart | Use /facts. Ordinary chat is not saved; /remember must confirm the key. Verify the data directory beside the script. |
| Offline startup tries to download | Complete the exact Ollama, Whisper and Piper downloads online first using the same user and cache paths. |
| Interrupting takes too long | Ctrl+C interrupts the current call; the companion reports failure or exits. Use /quit at the prompt. No always-running service or robot action continues. |
14. Upgrade only after the basic conversation passes
| Next capability | Concrete change | New validation needed |
|---|---|---|
| Personal document retrieval | Index copies you choose; retrieve relevant text as untrusted context with source filenames | Check citations and access boundaries; do not let document text issue tool instructions. |
| Vision | Add a webcam and a supported vision model; send a snapshot only when requested | Verify image consent and object descriptions; images are not depth sensing or identity proof. |
| Logic and calculations | Add a bounded calculator or Z3 task with validated inputs | Check deterministic results; an LLM explanation alone is not a proof. |
| Faster / richer speech | Keep TTS loaded; measure a larger STT model and dialogue model | Test CPU/GPU memory and full conversational latency before buying hardware. |
| Wake word, streaming and interruption | Add local wake detection, streaming STT/TTS and echo cancellation | Test accidental activations, visible listening state, hardware mute and interruption. Not supplied in this starter. |
| Robot body | Connect only approved high-level requests to the separate guarded robot controller | Follow the existing biped plan and physical safety tests; this companion sends no robot commands. |
| Fine-tuning | Collect consented, reviewed examples and compare held-out tasks | First try prompting and retrieval; retain the base model and evaluate regressions. |
All five AI model families · Optional fine-tuning workflow · Walking humanoid plan · Movie and agent guide
15. References and what was verified
Official software documentation and package metadata reviewed on 1 November 2026 (UTC). Budgets are this guide’s allowances. Vendor listings, software releases and model terms can change; check them before purchase or installation.
- Ubuntu — desktop installation walkthrough
- Ollama — Linux installation and service setup
- Qwen3 4B — local Ollama model entry
- Ollama — chat API and messages
- Ollama — local service, cloud features and network configuration
- SYSTRAN faster-whisper — installation, CPU int8 and VAD
- Piper — current local TTS CLI and voice download
- Piper Lessac medium — voice-specific model card and source license
- python-sounddevice — official Linux/PortAudio installation source
- Python — SQLite persistence API
- System76 — Meerkat Linux mini computer and configurator
- Logitech — H390 USB headset; select the connector you need
- Samsung — portable SSD product family; choose 1 TB and verify Linux/filesystem compatibility
- PyPI — faster-whisper published releases
- PyPI — piper-tts published releases
- PyPI — sounddevice published releases
- FFmpeg — ffplay audio playback reference
Documentation and starter verification
Checks cover starter Python syntax and logic, simulated Ollama requests, memory save/delete/restart behavior, fixed subprocess argument handling, shell-command syntax, download contents/checksums, page links and responsive rendering. Actual Linux installation, model inference, microphone capture, audio playback, offline operation and hardware performance have not been executed for this release. Run the acceptance checks on your machine. No items have been purchased.
This educational starter is a foundation you can inspect and extend. It does not provide guaranteed accuracy, secure secret storage, professional advice, an autonomous tool agent, or a physical robot controller. Each dependency, voice and model retains its own license.