This paper introduces Fractal Behavioral Grammar (FBG), a hypothesis for compressing behavioral interaction patterns in local large language models into compact, reusable rulesets without fine-tuning or cloud infrastructure. We propose that individual interaction patterns with LLMs exhibit fractal self-similarity across sessions — recurring at multiple scales of abstraction — and that these patterns can be extracted, compressed, and reinjected as structured behavioral context. We present a five-layer compression architecture combining MinHash LSH deduplication, hyperdimensional computing (HDC) encoding at D=10,000 dimensions, HDBSCAN clustering, fractal grammar extraction, and AssociativeMemory storage. Empirical stress testing demonstrates an 82:1 compression ratio versus raw conversation history, with AssociativeMemory footprint remaining flat at 39KB regardless of event count up to n=10,000. We further present fg-sync, a concrete CLI implementation integrating FBG extraction with Ollama via a thin HTTP proxy, configurable cron-based pipeline execution, and automatic system prompt injection. The full implementation is released as open source under Apache 2.0.
Ryan Moore (Sun,) studied this question.