cognitive architecture · rust

coggy

A small cognitive architecture — hypergraph knowledge store, probabilistic reasoning, and attention allocation, in ~900 lines of safe Rust.

what it is

An OpenCog-inspired cognitive architecture compressed to its load-bearing parts. Coggy maintains an AtomSpace — a typed hypergraph of concepts, predicates, and links. Every atom carries a truth value (strength, confidence) and an attention value (short-term importance).

On every input it runs the cognitive loop: parse natural language into atoms, ground them against the existing knowledge base, spread attention through the graph, run probabilistic forward-chaining inference, and reflect on what changed. Inference correctly degrades confidence through chains. Attention decays.

The system is epistemically honest. It shows you exactly what it knows, what it derived, and how confidently — so you can trust the trace.

cognitive loop

input ─▶ parse   ─▶ atoms (concept · predicate · link)
         ground  ─▶ ∈ AtomSpace?  · novel?
         attend  ─▶ ECAN: spread STI  · decay
         infer   ─▶ PLN forward-chain ⊢ new atoms
         reflect ─▶ delta · peak attention · trace
                                   │
                                   ▼
                            updated AtomSpace

quick start

$ git clone https://github.com/uprootiny/coggy
$ cargo run

◈ COGGY — Cognitive Architecture (Rust)
  37 atoms loaded from base ontology.

coggy [0]> cat is-a pet
+2 atoms │ 39 total │ turn 1
── COGGY TRACE ──────────────────────────────
  parsed   → (is-a cat pet)
  grounded → cat (novel) · pet (novel)
  attend   → cat .82 · pet .74
  inferred → ⊢ (animal cat) ⊢ (mortal cat)

design decisions

language
Rust · zero unsafe
size
~900 lines of cognitive surface area
tests
73 passing · cargo test
ontology
typed hypergraph · provenance · retract cascade
persistence
~/.coggy/atomspace.json on demand