Open Cognitive Architecture

Build AI systems that
know when they're ready.

Threadon is a composable stack of open-core modules for AI experiment governance, temporal memory learning, and adaptive reasoning — CPU-friendly, self-hosted, and auditable.

spo-lite · quickstart
# Install & run
$ pip install fastapi uvicorn pyyaml
$ git clone https://github.com/threadon/spo
$ python run_server.py
INFO: spo-lite API created · profile=lite port=8765

# Run an experiment through the gate pipeline
$ curl -X POST http://127.0.0.1:8765/experiment/run \
    -H "Content-Type: application/json" \
    -d '{"experiment_id":"my_exp","benchmark":"generic"}'
{
  "overall_required_status": "PASS",
  "gates_passed": 5,
  "gates_failed": 0,
  "duration_sec": 4.2
}

Any cognitive AI can plug into SPO.

SPO acts as the governance layer between your AI components — reasoning agents query it before any promotion, learning modules emit capability gates into it. Bring your own AI, SPO validates the checkpoints.

AGENT
reasoning layer

Reasoning Agent

Self-improving decision loops that query SPO before promoting any model or strategy to the next stage. Gate outcomes drive curriculum and recovery logic.

  • Queries SPO at each promotion checkpoint
  • Gate-constrained decision branching
  • Metacognitive recovery on FAIL
upstream consumer of SPO
LEARN
learning layer

Learning Module

Temporal or causal learning systems that emit structured capability gates — convergence, memory, stability, causality — directly into SPO's evaluation pipeline.

  • Emits named capability gates to SPO
  • Convergence, memory, stability checks
  • Causal uplift validation gate
downstream emitter into SPO
Reasoning Agent queries SPO before any promotion
SPO evaluates gates, returns PASS/FAIL
Learning Module emits capability gates

Everything you need to
ship experiments with confidence.

Gate Catalog

14 built-in gates. Extend with your own in YAML — hot-reload without restarting the server.

# gates/gate_catalog.yaml custom: - id: latency_gate threshold: "p95 ≤ 200ms" required: true
🔑

Stateless BYO Key

LLM API key travels in request header only. Middleware clears it after response — no logs, no disk.

POST /experiment/run X-LLM-API-Key: sk-... # cleared after response
🛡

Profile Enforcement

Cloud-only routes return 404 server-side. Gate profile is immutable — not overridable per request.

GET /review → 404 GET /policy → 404 # enforced by middleware
📊

Web Dashboard

Dark-mode React SPA. Gate accordion with description, objective, threshold, and raw metrics per gate.

cd api/dashboard npm install && npm run dev # → localhost:5173

Non-blocking API

Sync benchmark runners execute in thread pools — uvicorn event loop stays free during 90s+ jobs.

loop.run_in_executor( None, run_benchmark ) # event loop unblocked
🗂

Data Source Swap

Gate catalog → YAML today. Postgres tomorrow. Replace _load_catalog(). API unchanged.

# future: def _load_catalog(): return db.query( "SELECT * FROM gates" )

How we build.

I

Spec before code

Every module ships a spec — decision framework, exit gate, file list — before a single line is written. Audit happens before implementation, not after.

II

Gates are binary

A system either passes a gate or it doesn't. No "mostly passing." Binary outcomes force clear threshold thinking up front, eliminating judgment calls at ship time.

III

CPU-first

Every module must evaluate on commodity hardware without GPU. Cloud accelerators are a deployment option, not a requirement for running governance checks.

IV

Open core, closed governance

Gate engine, memory layer, reasoning loop — open. Policy enforcement, two-pass review, cloud orchestration — the commercial layer built on top.

V

Data source independence

Every layer reads from files first. Postgres, object storage, or vector DB can replace the file layer without touching upstream API contracts.

Start with SPO Lite — free, open source.

Gate-based governance for your AI experiments. Self-hosted in under 5 minutes.