Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nightbrain

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):

  1. 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.
  2. 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.
  3. 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.
  4. 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.

Models: local-first, frontier-optional

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:

  1. Claude Code subscription (claude setup-token — no API costs)
  2. Anthropic API
  3. Any OpenAI-compatible endpoint

Install

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 work

Vault layout

Any 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.

Philosophy

  • 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.

License

MIT.

About

Wake up to a briefing your second brain wrote overnight — local-first (ollama), stdlib-only Python, honest empty days. MIT.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages