PRIMUS is a high-performance AGI (Artificial General Intelligence) substrate built on Julia, implementing the MeTTa language and OpenCog Hyperon cognitive architecture.
- Full MeTTa evaluator — S-expression language with pattern matching, non-deterministic evaluation, and type checking
- Cognitive algorithms — PLN, MOSES, ECAN, MetaMo, WILLIAM, TransWeave
- Julia-native tensor operations —
t-add,t-matmul,t-reshape,metta-grad! - CLP(FD) constraints —
#+,#-,#*,#<,#>,#= - ECAN attention —
decimate-importance!,get-neighbors - EGraph equality saturation —
saturate!,theory-size - HPC federation —
broadcast!,hpc-map,federate! - Automatic differentiation — via Enzyme/Zygote
PRIMUS is a monorepo of 9 Julia packages under packages/. The bootstrap
script handles the clean-clone workflow in one command.
# Clone
git clone https://github.com/Shivaji1012/PRIMUS.git
cd PRIMUS
# Bootstrap — idempotent, safe to re-run after `git pull`
./scripts/bootstrap.shBootstrap walks all 9 packages, runs Pkg.develop + Pkg.instantiate +
Pkg.precompile, seeds data/primus_state/, and verifies the substrate
health gate (5/5). A re-run on a working install is a ~1-minute no-op
(Julia cold-start overhead plus cache checks). First-time bootstrap is
slower (~10-30 min) because deps compile from scratch.
Flags: --skip-health (CI bring-up), --quiet (terse), --force
(re-instantiate even if Manifest is current), -h (help).
./bin/primus doctor # human-readable repo status
./bin/primus doctor --json # structured output for diff-over-time tooling
./bin/primus doctor --health # also run the 5/5 health gate (slow)Doctor reports julia version, PRIMUS version, git HEAD, per-package
Project.toml + precompile cache status, data/primus_state/ presence,
and server state. Read-only.
git pull
./scripts/bootstrap.sh # re-runs against new Manifest if deps changedNo separate install.sh / uninstall.sh / update commands — the repo
itself is the install (git clone = install, rm -rf PRIMUS/ =
uninstall), and git pull && bootstrap is the update.
; Define a function
(: factorial (-> Number Number))
(= (factorial 0) 1)
(= (factorial $n) (* $n (factorial (- $n 1))))
; Evaluate
!(factorial 5) ; -> [120]
; Pattern matching
(parent Alice Bob)
(parent Bob Charlie)
!(match &self (parent Alice $child) $child) ; -> [Bob]
; Tensor operations (PRIMUS-native)
!(t-matmul (tensor ((1 2) (3 4))) (tensor ((5 6) (7 8))))MeTTa Programs (.metta)
|
PRIMUS_Core Evaluator
MorkAdapter -> LogicBridge -> MM2Engine -> AxiomCompiler
|
+---------+---------+-----------+
| ECAN | PLN | MOSES |
| Attn. | Infer. | Evolve |
+---------+---------+-----------+
|
PRIMUS_Metagraph (MORK Storage)
PathTrie - SplitStore - UnifiedSpace
|
Julia Runtime (JIT + Enzyme)
| Algorithm | Maturity | Status |
|---|---|---|
| Logic Core | 95% | Production Hardened |
| MOSES | 95% | Production Hardened |
| ECAN | 95% | Importance Stabilized |
| PLN | 92% | Canonical Logic Fuel |
| TransWeave | 90% | Production Ready |
# Start the server (port 7701)
julia --project=. tools/metta_server.jl
# Evaluate via curl
curl -X POST http://localhost:7701/eval \
-H "Content-Type: application/json" \
-d '{"expr": "!(+ 1 2)"}'Full MeTTa language support with Tree-sitter parsing, 241-builtin hover docs, and server-backed completions: vscode-metta
Build the documentation site:
julia --project=docs docs/make.jl
# Open docs/build/index.htmlOr browse the source docs in docs/src/.
PRIMUS/
packages/ # Julia packages
PRIMUS_Core/ # Main substrate (evaluator, runtime, cognitive engines)
PRIMUS_Metagraph/ # MORK storage layer
PRIMUS_Interfaces/# Shared interfaces
PRIMUS_Neural/ # Neural-symbolic bridge
PRIMUS_HPC/ # Distributed computing
...
tests/ # Test suites
integration/ # Health gate (5/5 required)
docs/ # Documenter.jl site (47 pages)
tools/ # Eval server, REPL, CLI
examples/ # MeTTa example programs
bin/ # PRIMUS CLI
MIT