Wake up to a briefing your second brain wrote overnight — and one lesson it picked from your own notes.
nightbrain is a ~400-line, stdlib-only Python pipeline that runs every night on any box you own (a home server, a $5 VPS, a Raspberry Pi with patience):
- Collects signals — every executable in
collectors/prints JSON: failed services, yesterday's commits, your leads file, your sales snapshot, whatever you wire in. Two examples included. - Writes a morning briefing grounded only in those signals and your
vault's
GLOBAL.md(north star, rhythm, open loops). House rule enforced in the prompt: an empty day is reported as an empty day. No invented wins — a briefing you can't trust is worse than none. - Teaches you one lesson from your own vault — rotates through the sources you list, skips anything taught in the last 7 days, and ends with a single 15-minute drill.
- Delivers — commits both to your vault (if it's a git repo, it pushes; pair with a wiki that rebuilds on post-receive) and sends both to your Telegram.
Works fully offline with ollama — measured usable on a
CPU-only laptop-class box with qwen3:1.7b, hard-falling back to gemma3:1b
(a small-model briefing beats no briefing). If you configure a frontier layer
it's tried first and fails silently down the chain, so a dead API key
degrades quality, never availability:
- Claude Code subscription (
claude setup-token— no API costs) - Anthropic API
- Any OpenAI-compatible endpoint
git clone https://github.com/nhantour/nightbrain && cd nightbrain
mkdir -p ~/.nightbrain && cp config.env.example ~/.nightbrain/config.env
$EDITOR ~/.nightbrain/config.env # set BRAIN_VAULT at minimum
cp -r vault-template/* "$YOUR_VAULT/" # or wire an existing vault
./install.sh # systemd timer (or prints the cron line)
./nightbrain.py # run once now to see it workAny directory of markdown. nightbrain reads GLOBAL.md and
lessons-sources.txt, and writes briefings/YYYY-MM-DD.md +
lessons/YYYY-MM-DD.md. It plays perfectly with an Obsidian vault or a bare
git repo with a wiki on top.
- Your data never leaves your box unless you configure a frontier key.
- Honest empty days. The prompt forbids dressing up a quiet day. This is the feature.
- Files, not apps. Briefings are markdown in your vault, greppable forever.
- Boring dependencies. Python stdlib. Nothing to
pip install, nothing to rot.
MIT.