TS-OS Architecture

The Operating System
for Thinking

A dead-simple loop that runs your laptop into a living cognitive OS. Every component is a node. Every interaction is a wave.

ts_os.py
while true:
Propagate() // wave spreads activation (topological + semantic cosine)
Relax() // decay toward base_strength
if tension too high:
Break() // collapse weakest patterns
Evolve() // spawn higher-stability nodes (LLM synthesis or manual vibe-code)
Live Mini-Simulator

Click any node to push activation. Watch the wave propagate and relax.

TS-OS Mini Simulator
cycle #0
TS CoreLLMMemoryWave CycleSelf-ImproveOutputYou

Click nodes to push activation

Node States

Component Architecture

Click any section to expand

The UniversalLivingGraph (ULG) is the core data structure of TS-OS. Every piece of knowledge, every concept, every relationship is a node or edge in this graph. Each node carries: • id (UUID) — unique identity • label (str) — human-readable name • activation (float 0.0–1.0) — current excitation level • stability (float 0.0–1.0) — how resistant to change • base_strength (float 0.0–1.0) — resting activation target • edges (list[EdgeID]) — weighted connections to other nodes • embedding (list[float]) — semantic vector for cosine similarity The graph is backed by SQLite in WAL (Write-Ahead Logging) mode for zero-downtime incremental saves, with a JSON fallback for crash recovery. Every wave cycle writes only the changed nodes (delta encoding) — the full graph is never re-written from scratch.
# UniversalLivingGraph core schema
@dataclass
class TSNode:
    id: str                    # UUID
    label: str
    activation: float = 0.5   # [0.0, 1.0]
    stability: float = 0.7    # [0.0, 1.0]
    base_strength: float = 0.5
    edges: list[EdgeID] = field(default_factory=list)
    embedding: list[float] = field(default_factory=list)

class UniversalLivingGraph:
    def __init__(self, db_path: str = "ts_graph.db"):
        self.nodes: dict[str, TSNode] = {}
        self.edges: dict[EdgeID, Edge] = {}
        self._db = SQLiteWAL(db_path)  # WAL mode

config.yaml Schema

Full configuration reference

# BoggersTheAI / TS-OS config.yaml
# Full configuration schema

graph:
  db_path: "ts_graph.db"          # SQLite WAL database path
  json_fallback: "ts_graph.json"  # JSON backup on crash
  max_nodes: 10000                # Prune oldest if exceeded
  embedding_dim: 384              # Sentence embedding dimension

wave:
  cycle_interval_sec: 30         # WaveCycleRunner tick rate
  propagation_depth: 3           # Max hops per cycle
  decay_rate: 0.05               # Relaxation rate per tick
  edge_prune_threshold: 0.25     # Remove edges below this weight
  merge_overlap_threshold: 0.50  # Merge nodes with >50% overlap
  tension_break_threshold: 0.85  # Break point (0.0–1.0)

llm:
  model: "llama3.2:3b"           # Ollama model name
  temperature: 0.7
  max_tokens: 512
  evolve_threshold: 0.9          # Min confidence to spawn new node

self_improve:
  enabled: true
  trace_collection: true
  min_traces_for_training: 100
  validation_improvement_required: 0.02  # Must improve by 2%
  qlora_rank: 16
  qlora_alpha: 32
  training_epochs: 3

multimodal:
  whisper:
    enabled: true
    model: "base"               # tiny, base, small, medium, large
    device: "cpu"               # cpu or cuda
  blip2:
    enabled: false              # Requires GPU
  tts:
    enabled: true
    voice: "en_US-lessac-medium"

api:
  host: "0.0.0.0"
  port: 8000
  debug: false
  cors_origins: ["http://localhost:3000"]

security:
  guardrail_nodes:             # High-stability anchor nodes
    - "safety-anchor"
    - "honesty-anchor"
  min_anchor_stability: 0.95

Full Stack

Python 3.12
FastAPI
SQLite WAL
Cytoscape.js
Chart.js
Rich TUI
Unsloth 4-bit QLoRA
faster-whisper
BLIP2
Piper TTS

Run It Yourself

One-command install. The system runs on your laptop, offline, with no external dependencies.

Go to the Lab