The research behind NFramework.

Separate from the Neos application, PNP Compute is a formal framework for composable agentic systems — pre-alpha research into typed primitives, categorical composition, and the Trinity architecture.

/// Language

NeuroLang

Typed Python DSL. Primitives: Neuro, Flow, Plan, Memory, Effect, Budget. Composition operators. Categorically grounded.

/// Program

NeuroNet

A composed network of neuros — authored in NeuroLang, packaged as a runnable, shareable artifact. The thing you ship.

/// Environment

PNP Compute

The formal execution environment that hosts NeuroNets. The runtime model, memory graph, and composition semantics live here.

Neos is the practical application built on these ideas. See Neos →

Mathematics meets intelligence.

NeuroLang is not a wrapper. It is the systematic exploitation of a sixty-year-old mathematical insight — that grammar, computation, and tensor networks share a common structure — for the design of a programming framework. The categorical research is the language's bones.

3
Identified Towers
∞
Dimensional Ladder
η · ε
Adjunction (NL ↔ Code)

A NeuroLang program is four things at once.

Symbolic. Neural. Categorical. Linguistic. Same object, different views — because the higher-categorical formalism and the tensor-network formalism are mathematically identified.

Symbolic

Typed, inspectable, composable, deterministic where it matters. mypy-checked phantom types. Effects in types. Plans as values.

Neural

Differentiable, integrable, learnable end-to-end. Where flows are differentiable, JAX wires them through.

Categorical

Higher-dimensional, structurally sound, composable at every level. Lambek, Curry-Howard-Lambek, Coecke et al. — the formalism is established.

Linguistic

Addressable in natural language (Hindi, English, …) with a cached bidirectional compiler realised as the unit and counit of an adjunction.

A framework whose primitives are typed at definite categorical dimensions, whose composition operators are the canonical monoidal-categorical operations, whose effects are tracked as morphism kinds, and whose natural-language authoring surface is realised as the unit/counit of an adjunction with the formal layer, will dominate the design of agentic systems for the next two decades.

Grammar. Category theory. Tensor networks.

Three apparently distinct domains turn out to be the same mathematical structure. Establishing this is the work of sixty years; exploiting it is the work of NeuroLang.

Natural Language Category Theory Computation / Tensor Network
NounObject (dim 0)Tensor index / vector slot
VerbMorphism (dim 1)Linear map / tensor contraction
AdverbNatural transformation (dim 2)Higher-order tensor operation
SentenceComposed arrow / commutative diagramComputation graph
ParagraphDiagram in a categoryModule of computation
TranslationEquivalence of categoriesReparameterisation
Grammar itselfCategory of grammatical types (Lambek)Type system of the network
Meta-theorem (three-tower). The category of grammatical compositions in a residuated monoid (Lambek), the category of types in a Curry-Howard system, and the category of pre-tensor-networks under monoidal composition (Penrose / Joyal-Street) are equivalent up to coherence.

Every primitive lives at a dimension.

A primitive may not be introduced unless its dimension is justified. The ladder runs from Dim 0 (substrate) to Dim ∞ (reflection).

Dim 0
Substrate. Values, tensors, hyperdimensional vectors (Kanerva-style 10⁴-dim with binding/bundling), memory cells, atomic propositions.
NN counterpart: Weights, activations, embeddings, attention scores.
Dim 1
Arrows. Functions, differentiable maps, state transitions, Boolean and fuzzy implications. Effects (pure, llm, tool, human, time) — each effect is an arrow in a sub-category.
NN counterpart: Individual layers (Linear, Conv, Attention head), activation functions.
Dim 2
Functors and Naturals. Higher-order functions, generics, monads. Adverbial modifiers. Plans-as-values. Memory scopes (functorial constraints). Compositional flows.
NN counterpart: Multi-head attention (functor over heads), residual connections (η : Id ⇒ F), layer normalisation.
Dim 3
2-Categories. Plan transformations. Protocol transformations between agents. Effect handlers that reinterpret effects. Optimisation passes — gradient-based or symbolic refactoring of programs as 2-arrows.
NN counterpart: Architecture search (NAS), pruning, knowledge distillation.
Dim ∞
Reflection. Meta-neuros that read, transform, and emit other neuros. The compiler itself as a NeuroLang program. Learning loops that modify the language's own primitives.
NN counterpart: Self-modifying architectures, learned optimisers, neural architecture search.
Design rule: A primitive may be added at dimension n only if it cannot be expressed cleanly at dimension n−1 without loss of structure.

No translation. No two systems. One object.

The fundamental lemma — established by Penrose (1971) and formalised by Joyal-Street (1991): a morphism in a monoidal category, drawn as a string diagram, is the same mathematical object as a tensor network.

What this gives you

When you compose neuros into a flow, the diagram you construct is literally a tensor network. When the system trains, gradients flow through that network. When you inspect, the same network is rendered as a categorical diagram.

This is what makes a NeuroLang program a neural network in disguise — but a neural network with typed structure, categorical guarantees, and symbolic inspectability that contemporary ML systems lack.

A B │ │ ▼ ▼ ┌───────┐ ┌───────┐ │ neuro │ │ neuro │ └───┬───┘ └───┬───┘ │ │ └──────┬──────┘ ▼ ┌───────┐ │ neuro │ └───┬───┘ ▼ C String diagram = tensor network (Penrose 1971, Joyal-Street 1991)

An adjoint pair of functors.

The natural-language authoring surface is realised mathematically as a pair of functors between two categories. Caching is no longer a performance optimisation — it is the unit and counit data of the adjunction, made into storage.

              left-adjoint:  L : NL → Formal     (compile)
                                ⊣
              right-adjoint: R : Formal → NL     (summarise)

Unit η : 1NL ⇒ R∘L

Every NL prompt round-trips through formal compilation back to a normalised NL summary. The cache stores η per prompt.

Counit ε : L∘R ⇒ 1Formal

Every formal program round-trips through summarisation back to an executable program. The cache stores ε per program.

Triangle identities

Compile-then-summarise is identity-up-to-cache. Summarise-then-compile is identity-up-to-cache. Self-consistency is enforceable.

Principled invalidation

When the LLM model changes, the cache is invalidated — but only the parts whose adjunction-coherence breaks. Verifiable. Far stronger than "rebuild on new model."

This is not a metaphor. It is the precise mathematical contract that the LLM compiler must satisfy.

Memory is itself a categorical structure.

Each memory layer is a functor into the substrate. They compose: a single read may pass through compressed → semantic → episodic before yielding a vector. Each transition is a typed arrow with cost and effect annotations.

LayerKindProperties
DiscreteKey-value, exactDeterminism, fast lookup, brittle
DifferentiableSoft-attention storeGradient flow through recall
CompressedSparse / low-rank / quantisedCapacity vs precision trade
HyperdimensionalHigh-dim vectors with binding/bundlingCompositional, fault-tolerant, semantic
EpisodicTime-indexedSequence of experiences, retrievable by recency or relevance
SemanticConcept-indexedLong-term abstracted knowledge
ProceduralSkill-as-flowMemory that executes

Decomposable. Multi-valued.

NeuroLang doesn't commit to one logic. It admits a hierarchy. Every logical expression decomposes uniquely (up to canonical isomorphism) into a tree of primitive operators.

LogicTruth valuesUse
Boolean{true, false}Hard constraints, deterministic flow
Fuzzy[0, 1]Soft constraints, partial matches
ProbabilisticdistributionsBayesian inference, uncertainty propagation
Modalpossible-world indexedCounterfactuals, planning
Higher-orderpredicates of predicatesMeta-reasoning
Linearresource-awareEffect tracking, single-use credentials

A consequence: the symbolic and the neural meet in the logic layer. A fuzzy logical formula is differentiable. A probabilistic formula admits gradient-based posterior inference. A Boolean formula is the deterministic limit of these. The user writes one expression; the runtime chooses the appropriate semantics.

The pathway to AGI.

Computing is undergoing a fundamental shift. We are advancing through clearly defined epochs, moving beyond monolithic models into hierarchical intelligence.

1
Software. Hardcoded logic and explicit, rigid rules.
2
Statistical ML. Probabilistic pattern recognition and classification.
3
Generative Models. Transformers predicting structured outputs and tokens.
4
Reasoning Models. Systems that maintain state, plan, and execute Chain-of-Thought.
5
Agentic Systems. Autonomous loops that observe, reason, and act across domains.
6
Agency AI (the Neuro Vision). Hierarchical, modular agencies of shared agents. Abstract, modifiable, capable of infinite scaling.

Foundations on which the framework rests.

Every claim above traces back to established work in category theory, linguistics, type theory, and categorical foundations of machine learning.

Lambek (1958)
Grammatical types form a residuated monoid; parsing is composition in this category.
Curry-Howard (1934, 1969)
Proofs ≅ programs; types ≅ propositions.
Penrose (1971)
String diagrams for tensor algebra are isomorphic to monoidal-category diagrams.
Joyal-Street (1991)
Formalised string-diagrammatic calculus for monoidal categories.
Coecke, Sadrzadeh, Clark (2008+)
DisCoCat — distributional compositional categorical semantics.
Atiyah-Lurie cobordism hypothesis
TQFT is an n-functor between cobordism categories. Physics is higher-categorical.
Cruttwell, Gavranović et al. (2022)
Categorical foundations of gradient-based learning. Backprop is a functor.
Mac Lane (1971), Lurie (2009)
Higher categories as a foundation for compositional structure.
GitHub · coming soon GitHub · coming soon