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.
Three names, one spec. NeuroLang is the agentic-programming layer. NeuroNet is the AI training & inference layer. NSDK ships them all together.
The typed DSL for agents. @neuro decorator, composition operators, plans as values. Ships inside NSDK — no separate install.
The grammar-typed models of NFramework. Auditable AI training & inference — every weight a named mathematical operation.
The Software Kit that bundles NeuroLang, NeuroNet, and the whole spec into one runnable SDK. Build any software — generic or agentic.
NeuroLang surfaces what most languages bury — deliberation, cost, memory scope, effects, recovery — as first-class primitives.
| sequential, & / + parallel, DAG, loop. Categorical morphism composition.pure / llm / tool / human / time / voice. Tracked by the runtime.fallback, retry, escalate as language primitives. Composable.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()
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 |
|---|---|
| Web | skill.web.scrape, skill.web.search, skill.web.fetch_html |
| Voice | skill.voice.call, skill.voice.message, skill.voice.transcribe, skill.voice.synthesize |
skill.email.read, skill.email.send, skill.email.draft | |
| Calendar | skill.calendar.read, skill.calendar.create, skill.calendar.find_slot |
| Files | skill.files.read, skill.files.write, skill.files.search |
| Reasoning | skill.reason.brainstorm, deep_research, classify, summarize |
| Code | skill.code.read, diff, write, test |
| Memory | memory.store, memory.recall, memory.search |
| Models | model.llm.openai, model.llm.anthropic, model.llm.local, model.embed.* |
| Flows | flow.dag, flow.parallel, flow.loop, flow.race |
| Agents | agent.delegate, agent.escalate, agent.handoff |
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.
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 |
|---|---|---|
| Persistent | Saved to ~/.neurolang/neuros/; loaded every run | A neuro you want to reuse forever |
| Project-scoped | Lives in the project repo; checked into git | A neuro tied to one app or thesis |
| Session-scoped | In-memory only; flushed when the process ends | AI generates for a single complex task |
| Ephemeral | Built mid-flow, lives only for that flow's execution | One-off transformations |
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.
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 programs | untyped | partial | partial | categorical |
| NL authoring surface | — | partial (signatures) | — | bidirectional cached |
| Plans as first-class values | — | — | — | ✓ |
| Effects in types | — | — | partial | ✓ |
| Budget annotations | — | — | — | ✓ |
| Recovery as primitive | library | library | library | language-level |
| Memory hierarchy with scoping | flat | flat | flat | ✓ (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+) |
Aggressive but achievable. Phase 1 is shipping. Phase 2 starts when reviewer trust is earned.
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.
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.
WebGL string-diagram rendering. Voice input → flow generation. Drag manipulation → Python source mutation. Episodic + semantic + procedural memory. Decomposable logic library.
The compiler is itself a NeuroLang program. Standard neuro library expands. Community contribution model. Plugin / theme ecosystem for the IDE.
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