k0valik/pi-blackhole

Unified algorithmic compaction + observational memory for Pi. Merges pi-vcc and pi-observational-memory with fallback chains, cooldowns, and per-worker model config.

What it solves

Long engineering sessions degrade because repeated LLM-based summarization loses load-bearing details like why decisions were made or what was clarified early on. pi-blackhole solves this with two complementary mechanisms: algorithmic compaction that extracts structure without calling an LLM, and observational memory that records durable facts and reflections so they survive across compactions.

How it works

It has two main parts. First, algorithmic compaction uses a deterministic compile() pipeline to pull out structured sections—goal, files, commits, preferences, brief transcript—and replaces the old conversation with one compact block. This step costs no tokens. Second, three background workers (Observer → Reflector → Dropper) run during the session as separate billed model calls. They capture timestamped facts and distil durable reflections into a session ledger. Workers have per-model fallback chains with persisted cooldowns, and you can flush manually or let it run automatically. All configuration lives in one JSON file.

Who it’s for

This is an experimental extension for the Pi coding agent. It suits developers who don’t count every token and can run workers on cheap or free models. On expensive models it may cost more than doing nothing, so it’s best for those with access to low-cost or local model fallbacks.

Highlights

  • Replaces Pi’s LLM-based /compact with deterministic, zero-cost algorithmic compaction.
  • Background workers capture durable facts and reflections that survive compactions.
  • Per-worker model fallback chains with persisted cooldowns.
  • Manual flush mode, plus a single JSON config file for all settings.
  • Provides a recall tool for searchable session history (BM25 ranking, regex, file/mode filters).
  • All commands work regardless of the compaction mode (auto, manual, or off).

Related

  • Project
  • Project
  • Project
  • Project