NeuroLang.
Write what you mean.

NeuroLang is the agentic-programming layer of NFramework, bundled inside NSDK. Write agents in natural language; the library compiles your prompts into typed, composable, inspectable Python programs. Plans are first-class values. Memory has scope. Effects have types. Budgets are enforced. Recovery is a language primitive.

NeuroLang. NeuroNet. PNP Compute.

Three names, one spec. NeuroLang is the agentic-programming layer. NeuroNet is the AI training & inference layer. NSDK ships them all together.

Language

NeuroLang

The typed DSL for agents. @neuro decorator, composition operators, plans as values. Ships inside NSDK — no separate install.

AI Layer

NeuroNet

The grammar-typed models of NFramework. Auditable AI training & inference — every weight a named mathematical operation.

The Kit

NSDK

The Software Kit that bundles NeuroLang, NeuroNet, and the whole spec into one runnable SDK. Build any software — generic or agentic.

Primitives general-purpose languages don't have.

NeuroLang surfaces what most languages bury — deliberation, cost, memory scope, effects, recovery — as first-class primitives.

Neuro
Typed, composable unit (identity + behaviour + optional prompt surface). The atom.
Flow
Composition. | sequential, & / + parallel, DAG, loop. Categorical morphism composition.
Plan
First-class value. Inspect, modify, replay, diff, hash. Survives the run for audit.
Memory
Scoped read/write. Discrete, differentiable, hyperdimensional, episodic, semantic, procedural.
Context
Typed memory + prompt assembly slice, declared per neuro.
Effect
pure / llm / tool / human / time / voice. Tracked by the runtime.
Budget
Latency + cost bounds. Statically warned. Runtime enforced.
Recovery
fallback, retry, escalate as language primitives. Composable.
Mailbox
Multi-agent message-passing. No shared mutable state. Erlang-style isolation.
Agent
Long-lived neuro with mailbox, memory, role, identity. A 2-categorical object.

A flow reads like a sentence.

Define neuros with declared effect and budget. Compose them with operators. Inspect the resulting flow. Run it. Replay it.

from neurolang import neuro, Flow, Memory, Budget
from neurolang.stdlib import web, reason, memory_neuros

@neuro(effect="tool")
def extract_book_metadata(url: str) -> dict:
    """Scrape title, author, summary from URL."""
    ...

@neuro(effect="llm", budget=Budget(cost_usd=0.02))
def summarize(emails: list[Email]) -> str:
    """Produce a short paragraph summary."""
    ...

# A flow reads like a sentence
research_flow: Flow = (
    web.search                     # find candidate URLs
    | extract_book_metadata        # extract per URL
    | reason.summarize             # condense findings
    | memory_neuros.store          # save for later
)

# Inspect
research_flow.render(format="mermaid")
research_flow.cost_estimate()
research_flow.effect_signature()

# Run
plan = research_flow.plan(query="category theory")
result = plan.run(memory=Memory.discrete())

# Replay (deterministic)
plan.serialize()  # → plan.json
plan.replay()
A flow composed of differentiable primitives is itself differentiable, automatically and provably. A flow containing a non-differentiable primitive cannot be inserted into a gradient-based learning loop without an explicit handler.

High-quality neuros for the common surface.

Ships with neuros for web, voice, email, calendar, files, reasoning, code, memory, models, flows, and agents. They are not magic — they are well-typed neuros built from the same primitives as user neuros.

Domain Standard neuros
Webskill.web.scrape, skill.web.search, skill.web.fetch_html
Voiceskill.voice.call, skill.voice.message, skill.voice.transcribe, skill.voice.synthesize
Emailskill.email.read, skill.email.send, skill.email.draft
Calendarskill.calendar.read, skill.calendar.create, skill.calendar.find_slot
Filesskill.files.read, skill.files.write, skill.files.search
Reasoningskill.reason.brainstorm, deep_research, classify, summarize
Codeskill.code.read, diff, write, test
Memorymemory.store, memory.recall, memory.search
Modelsmodel.llm.openai, model.llm.anthropic, model.llm.local, model.embed.*
Flowsflow.dag, flow.parallel, flow.loop, flow.race
Agentsagent.delegate, agent.escalate, agent.handoff

AI proposes a composition of typed primitives.

Not "let an LLM hallucinate code" — the AI sees the entire toolbox and composes intelligently. Every registered neuro carries its own docs, types, effects, and budget. The AI's prompt always has the live catalogue.

USER: "I need to write my thesis on microplastics in marine life.
       Help me build a research workflow."

AI: [searches registered neuros]

  Found these relevant neuros:
   • skill.reason.deep_research  (multi-source synthesis)
   • skill.web.scrape            (extract from URLs)
   • skill.web.search            (semantic + keyword)
   • skill.code.read             (read citation BibTeX)
   • skill.reason.summarize      (compress long text)
   • skill.reason.brainstorm     (divergent ideation)
   • memory.store                (save findings)
   • agent.delegate              (sub-agents per chapter)

  Proposed flow:

    brainstorm_outline
      | for_each_section (
          web.search | web.scrape | reason.summarize | memory.store
        )
      | reason.deep_research
      | code.write_bibliography

  Estimated cost: $1.20–$3.40
  Estimated time: ~20 min for first draft outline.

  Want me to:
   (a) Generate as Python and run it now
   (b) Save as a reusable 'thesis_research' neuro
   (c) Modify the flow first

This is what natural-language coding actually means.

Temporary or permanent.

When the AI generates a neuro, it can choose: ephemeral, session-scoped, project-scoped, or persistent. Defaults make the right choice for you.

Kind Lifecycle Use case
PersistentSaved to ~/.neurolang/neuros/; loaded every runA neuro you want to reuse forever
Project-scopedLives in the project repo; checked into gitA neuro tied to one app or thesis
Session-scopedIn-memory only; flushed when the process endsAI generates for a single complex task
EphemeralBuilt mid-flow, lives only for that flow's executionOne-off transformations

Voice is just an effect.

Every neuro can opt into a voice surface with effect="voice". The standard library wires LiveKit, Twilio/Plivo, ElevenLabs, OpenAI TTS, Whisper, Deepgram, Sarvam — adapters, not magic.

@neuro(effect="voice")
def voice_call(number: str, prompt: str) -> CallResult:
    """Initiate a voice call and conduct the conversation per `prompt`."""
    ...

# A voice flow is just a flow
incoming_call = receive_call | transcribe | classify_intent | dispatch_agent

The IDE shows voice neuros with a cyan highlight; runtime view shows live waveforms in NeuroNet.

vs LangChain · DSPy · Pydantic AI.

We don't pick a fight with all three at once. We complement Pydantic AI's typing rigour, extend DSPy's compositional ideas, and replace LangChain's untyped chains with a categorically grounded equivalent.

Capability LangChain DSPy Pydantic AI NeuroLang
Compositional programsuntypedpartialpartialcategorical
NL authoring surface—partial (signatures)—bidirectional cached
Plans as first-class values———✓
Effects in types——partial✓
Budget annotations———✓
Recovery as primitivelibrarylibrarylibrarylanguage-level
Memory hierarchy with scopingflatflatflat✓ (Phase 2+)
Hyperdimensional substrate———✓ (Phase 2+)
End-to-end differentiable flows—partial—✓ (Phase 2+)
Multi-language NL input———✓
3D IDE / categorical visualisation———✓ (Phase 3+)
Self-hosting compiler—partial—✓ (Phase 4+)

Library first. NL compiler next. IDE after.

Aggressive but achievable. Phase 1 is shipping. Phase 2 starts when reviewer trust is earned.

Phase 1.9 — Shipped

Library MVP

Neuro, Flow, Plan, Memory, Context, Prompt, Effect, Budget, Recovery as Python classes. @neuro decorator. Sequential / parallel composition. Discrete memory backend. 17 stdlib neuros + agent.delegate. 172 tests passing.

Phase 2 — In progress

NL Compiler + Differentiability

LLM-based bidirectional compiler with cache. Schema-constrained decoding. Multi-language NL (English + Hindi). VSCode plugin. JAX backend for differentiable flows. Soft-attention memory. Hyperdimensional substrate.

Phase 3 — Planned

3D IDE + Memory Hierarchy

WebGL string-diagram rendering. Voice input → flow generation. Drag manipulation → Python source mutation. Episodic + semantic + procedural memory. Decomposable logic library.

Phase 4 — Vision

Self-hosting + ecosystem

The compiler is itself a NeuroLang program. Standard neuro library expands. Community contribution model. Plugin / theme ecosystem for the IDE.

Vendored. Ready.

NeuroLang ships inside the PNP Compute repo at ./neurolang/. Editable install picks it up automatically.

# GitHub repo — coming soon
cd neurosdk
python3 -m venv .venv && source .venv/bin/activate
pip install -r neurosdk/requirements.txt
pip install -e ./neurolang   # vendored framework

# Use the nl_dev agent to author flows in natural language
python neurosdk/server.py             # http://127.0.0.1:7000
cd neuro_web && npm run dev                # http://localhost:3000
# switch to the nl_dev agent in the dropdown
→ Architecture Categorical foundations