Skip to main content

Neuronum SDK

Project description

Neuronum

Neuronum SDK

Website Documentation PyPI Version
Python Version License


About

Neuronum is built around the Secure Agent Session (SAS). An end-to-end encrypted channel designed for agent-to-client and agent-to-agent communication across businesses, partners, and customers. A session connects two parties to automate data exchange, take actions, and coordinate tasks without manual integration, custom APIs, or file transfers.

The SDK handles encryption, identity, and delivery. You write the agent logic.

⚠️ Development Status: The Neuronum SDK is currently in beta and is not production-ready. It is intended for development, testing, and experimental purposes only. Do not use in production environments or for critical applications.


Requirements

  • Python >= 3.8

Installation

Set up and activate a virtual environment:

python3 -m venv ~/neuronum-venv
source ~/neuronum-venv/bin/activate

Install the Neuronum SDK:

pip install neuronum

Note: Always activate this virtual environment (source ~/neuronum-venv/bin/activate) before running any neuronum commands.


Cell

A Cell is your address used to send and receive data on the Neuronum network. You can think of it like a unique digital identity.

Example IDs: acme.com::cell johndoe@acme.com::cell

Create a Cell:

neuronum create-cell

This generates your Cell ID, public/private key pair, and a 12-word mnemonic recovery phrase. Your Cell credentials are stored locally at ~/.neuronum/.env.

Connect your Cell to a device using your 12-word mnemonic:

neuronum connect-cell

View the connected Cell ID:

neuronum view-cell

Verify the connected Cell ID:

neuronum verify-cell

Disconnect Cell credentials from this device:

neuronum disconnect-cell

Delete your Cell permanently from the network:

neuronum delete-cell

Methods

Cells interact on Neuronum using the following methods:

Method Description
list_cells() List all Neuronum Cells
list_sessions() List your Secure Agent Sessions (SAS)
create_secure_agent_session(instruct, email or cell_id) Set agent instructions, create and invite to a session via email or cell_id
send_session_message(session_id, data) Send an encrypted message to a session
get_session_messages(session_id) Fetch and decrypt messages from a session
upload_session_file(session_id, file_path, mime_type) Upload a file to a session and send a file metadata message
download_session_file(session_id, file_id) Download a file from a session by file ID. Returns raw bytes
sync_messages() Receive messages from all sessions in real-time

All data is end-to-end encrypted. The network handles routing, key exchange, and delivery. You just send and receive.

Connecting to the network: Use async with Cell(network="testnet.neuronum.net") as cell to connect. This reads your Cell credentials from ~/.neuronum/.env and establishes a connection to the specified Neuronum network. Omitting the network parameter defaults to testnet.neuronum.net.


Quick Examples

List Cells

import asyncio
from neuronum import Cell

async def main():
    async with Cell(network="testnet.neuronum.net") as cell:
        cells = await cell.list_cells()
        print(cells)

asyncio.run(main())

List Sessions

import asyncio
from neuronum import Cell

async def main():
    async with Cell(network="testnet.neuronum.net") as cell:
        sessions = await cell.list_sessions()
        print(sessions)

asyncio.run(main())

Create a Secure Agent Session

import asyncio
from neuronum import Cell

async def main():
    async with Cell(network="testnet.neuronum.net") as cell:
        session = await cell.create_secure_agent_session(
            instruct="Set specific goals, conversation context or further instructions"
            email="your@email.com"  #or cell_id="acme.com::cell"
        )
        print(session)

asyncio.run(main())

Send a message to a session

import asyncio
from neuronum import Cell

async def main():
    async with Cell(network="testnet.neuronum.net") as cell:
        success = await cell.send_session_message(
            "session_id",
            {"msg": "Hello"}
        )
        print(success)

asyncio.run(main())

Fetch messages from a session

import asyncio
from neuronum import Cell

async def main():
    async with Cell(network="testnet.neuronum.net") as cell:
        messages = await cell.get_session_messages(session_id)
        print(messages)

asyncio.run(main())

Upload a file to a session

import asyncio
from neuronum import Cell

async def main():
    async with Cell(network="testnet.neuronum.net", host="your-host") as cell:
        success = await cell.upload_session_file(
            "session_id",
            "/path/to/file.pdf",
            mime_type="application/pdf"
        )
        print(success)

asyncio.run(main())

Download a file from a session

The file_id is available in the file metadata message sent automatically after a successful upload. Retrieve it via get_session_messages from the file_id field.

import asyncio
from neuronum import Cell

async def main():
    async with Cell(network="testnet.neuronum.net", host="your-host") as cell:
        file_bytes = await cell.download_session_file("session_id", "file_id")
        with open("output.pdf", "wb") as f:
            f.write(file_bytes)

asyncio.run(main())

Receive messages in real-time

import asyncio
from neuronum import Cell

async def main():
    async with Cell(network="testnet.neuronum.net") as cell:
        async for message in cell.sync_messages():
            print(message["session_id"], message["sender"], message["data"])

asyncio.run(main())

Elements

Elements are UI components rendered on the client's frontend. Pass an element key in any send_session_message call to trigger them.

Element Description
confirm Renders Accept / Decline buttons
choice Renders a set of option buttons
input Renders a single text input field
form Renders a multi-field form
table Renders a data table
card Renders a composite card combining multiple elements
file Renders a file upload prompt

Confirm

await cell.send_session_message(session_id, {
    "msg": "Do you accept the session terms?",
    "element": "confirm"
})

Choice

await cell.send_session_message(session_id, {
    "msg": "Which report format do you prefer?",
    "element": "choice",
    "choices": ["PDF", "CSV", "JSON"]
})

Input

await cell.send_session_message(session_id, {
    "msg": "What is your company name?",
    "element": "input",
    "placeholder": "e.g. Acme Corp"
})

Form

await cell.send_session_message(session_id, {
    "msg": "Tell us about yourself:",
    "element": "form",
    "fields": [
        {"name": "company",  "label": "Company",  "placeholder": "Acme Corp"},
        {"name": "role",     "label": "Role",      "placeholder": "CEO"},
        {"name": "teamsize", "label": "Team size", "placeholder": "50"}
    ]
})

Table

await cell.send_session_message(session_id, {
    "msg": "Here are the results:",
    "element": "table",
    "columns": ["Name", "Status", "Score"],
    "rows": [
        ["Alice", "Active", 92],
        ["Bob", "Inactive", 74],
        ["Carol", "Active", 88]
    ]
})

Card

A card combines multiple elements into a single message.

await cell.send_session_message(session_id, {
    "msg": "Review this proposal:",
    "element": "card",
    "components": [
        {"type": "table", "columns": ["Item", "Cost"], "rows": [["Dev", "$5k"], ["Design", "$2k"]]},
        {"type": "input", "name": "budget", "label": "Your budget", "placeholder": "$10,000"},
        {"type": "choice", "name": "timeline", "label": "Timeline", "choices": ["1 month", "3 months", "6 months"]},
        {"type": "confirm", "name": "approved", "label": "Do you approve?"}
    ]
})

File

Renders a file upload prompt on the client.

await cell.send_session_message(session_id, {
    "msg": "Please upload your contract:",
    "element": "file"
})

Neuronum MCP Server

neuronum neuronum start-mcp

Full Documentation

For the complete SDK reference including the E2EE protocol, visit the Neuronum Docs.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neuronum-2026.7.1.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neuronum-2026.7.1-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file neuronum-2026.7.1.tar.gz.

File metadata

  • Download URL: neuronum-2026.7.1.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for neuronum-2026.7.1.tar.gz
Algorithm Hash digest
SHA256 4ab1e872a4ce33da5cac9e039a1997964264118ed6a73b732e9cc3c7f569b94e
MD5 285cd39103256e3d5a1e123dcc643239
BLAKE2b-256 8afb30a8c63365b6217541392fc997208a5d8fadeb28d495708109a3e0422a2e

See more details on using hashes here.

File details

Details for the file neuronum-2026.7.1-py3-none-any.whl.

File metadata

  • Download URL: neuronum-2026.7.1-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for neuronum-2026.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3ce336161e67a0caf6eabde1741e2a9e09f1c56e3b3eb567450c4de5562940a
MD5 51ba27ac6abed6ef8e3670906d78e585
BLAKE2b-256 7b80adb8db31f1494725efdd82dce47c4bf911b32855f50d4c4e16a5836f239a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page