Skip to content

SDKs and CLI

Use the SDKs when you want typed helpers and provider-friendly context builders. Use the CLI for local checks, scripted workflows, and integration smoke tests.

The public SDK source is Apache-2.0 licensed. Registry distribution is a separate release gate: npm, PyPI and crates.io did not offer the named distributions when checked on 27 October 2026. Do not assume an install command below is available until that registry shows a released version. The Python distribution is neutron-ai-sdk; its import remains neutron_ai.

Use the complete runnable REST examples now, with no Neutron registry package required. Start with account and token setup. The release guide records the publishing gates; package source and tags are linked below.

SurfaceSourceReadiness boundary
TypeScript/JavaScript and CLIsdk-jsnpm publication must be verified before registry install
Pythonsdk-pythonPyPI publication must be verified before pip install
Gosdk-goInstall a released VCS tag; newer intelligence operations use REST
PHPsdk-phpPackagist listing or explicit Composer VCS configuration required
Rustsdk-rustcrates.io publication must be verified before registry install

The TypeScript facade covers the newer knowledge/decision interfaces. Other typed clients differ; use authenticated REST for any operation absent from the client. REST compatibility does not imply framework-plugin or typed SDK parity.

Packages

EnvironmentPackagePrimary use
TypeScript / JavaScript@neutron-ai/sdkNode apps, web backends, agent runtimes, MCP helpers.
CLI@neutron-ai/climacOS, Windows, Linux, CI, and support workflows.
Pythonneutron-ai-sdkAI apps, notebooks, evaluation scripts, automation.
PHPneutron-ai/sdkLaravel, Symfony, WordPress, and custom PHP backends.
Gogithub.com/neutronai-dev/sdk-goServices, background jobs, and platform tools.
Rustneutron-aiTyped services and custom agent runtimes.

TypeScript

import { NeutronAIClient } from "@neutron-ai/sdk";

const client = new NeutronAIClient({
  baseUrl: process.env.NEUTRON_API_URL!,
  token: process.env.NEUTRON_API_TOKEN!,
  nucleusId: process.env.NEUTRON_NUCLEUS_ID!
});

await client.remember({
  scopeId: process.env.NEUTRON_SCOPE_ID!,
  type: "preference",
  text: "Prefers concise release notes with clear migration steps."
});

const context_pack = await client.agentContext({
  scopeIds: [process.env.NEUTRON_SCOPE_ID!],
  agentId: "agent_docs",
  task: "Draft an SDK migration note"
});

The TypeScript client also exposes typed intelligence facades:

await client.entities.upsert({
  scopeId: process.env.NEUTRON_SCOPE_ID!,
  id: "service_api",
  type: "service",
  name: "Decision API",
  attributes: { status: "operational" },
  confidence: 0.95,
  provenance: {
    sourceType: "database",
    sourceId: "service-catalogue",
    classification: "observed",
    recordedAt: Date.now(),
  },
});

const context = await client.context.build({
  scopeIds: [process.env.NEUTRON_SCOPE_ID!],
  task: "Assess the next API release",
  entities: [{ entityId: "service_api" }],
  tokenBudget: 4_000,
  includeContradictions: true,
  debug: true,
});

Available facades include memory, entities, graph, context, decisions, consequences, outcomes, learning, agents, snapshots, claims, contradictions, simulate, and search. To resolve a contradiction whose claims come from more than one Scope, pass scopeIds covering every one of them; pass scopeId when reading or tombstoning entities and relationships for one Scope.

Python, PHP, Go and Rust provide typed memory and MCP helpers; consequence and newer intelligence coverage varies by client. Use the authenticated REST routes for newer knowledge and decision operations until typed parity is documented.

CLI

npm install -g @neutron-ai/cli

export NEUTRON_API_URL="https://neutronai.dev/api"
export NEUTRON_API_TOKEN="<server-issued-token>"
export NEUTRON_NUCLEUS_ID="<nucleus-id>"
export NEUTRON_SCOPE_ID="<authorized-scope-id>"

neutron health
neutron remember --scope $NEUTRON_SCOPE_ID --type preference --text "Prefers short examples"
neutron recall --scope $NEUTRON_SCOPE_ID --query "documentation preferences"
neutron context --scope $NEUTRON_SCOPE_ID --task "Answer an SDK question"
neutron mcp-tools
neutron import-obsidian --vault ~/Documents/Obsidian/Product --scope kb:obsidian --privacy-class user_private --dry-run

PowerShell:

$env:NEUTRON_API_URL="https://neutronai.dev/api"
$env:NEUTRON_API_TOKEN="<server-issued-token>"
$env:NEUTRON_NUCLEUS_ID="<nucleus-id>"
$env:NEUTRON_SCOPE_ID="<authorized-scope-id>"

neutron health

Obsidian Vaults

Use the Obsidian importer when a local vault should become scoped agent memory.

neutron import-obsidian \
  --vault ~/Documents/Obsidian/Product \
  --scope kb:obsidian \
  --privacy-class user_private \
  --dry-run

neutron import-obsidian \
  --vault ~/Documents/Obsidian/Product \
  --scope kb:obsidian \
  --privacy-class user_private

The importer supports Markdown notes, JSON Canvas files, and Bases. It skips .obsidian configuration and stores note paths, tags, wikilinks, embeds, Canvas structure, and Base view names as metadata.

Python

import os

from neutron_ai import NeutronAIClient

client = NeutronAIClient(
    base_url="https://neutronai.dev/api",
    token=os.environ["NEUTRON_API_TOKEN"],
    nucleus_id=os.environ["NEUTRON_NUCLEUS_ID"],
)

client.remember({
    "scopeId": os.environ["NEUTRON_SCOPE_ID"],
    "type": "preference",
    "text": "Prefers short examples",
})

context_pack = client.agent_context({
    "scopeIds": [os.environ["NEUTRON_SCOPE_ID"]],
    "agentId": "agent_docs",
    "task": "Draft an SDK migration note",
})

PHP

use NeutronAI\NeutronAIClient;

$client = new NeutronAIClient(
    base_url: 'https://neutronai.dev/api',
    token: getenv('NEUTRON_API_TOKEN'),
    nucleus_id: getenv('NEUTRON_NUCLEUS_ID'),
);

$client->remember([
    'scopeId' => getenv('NEUTRON_SCOPE_ID'),
    'type' => 'preference',
    'text' => 'Prefers short examples',
]);

$context_pack = $client->agentContext([
    'scopeIds' => [getenv('NEUTRON_SCOPE_ID')],
    'agentId' => 'agent_docs',
    'task' => 'Draft an SDK migration note',
]);

Go

client, err := neutron.NewClient(neutron.Options{
    BaseURL: "https://neutronai.dev/api",
    Token: os.Getenv("NEUTRON_API_TOKEN"),
    NucleusID: os.Getenv("NEUTRON_NUCLEUS_ID"),
})
if err != nil {
    return err
}

_, err = client.Remember(ctx, map[string]any{
    "scopeId": os.Getenv("NEUTRON_SCOPE_ID"),
    "type": "preference",
    "text": "Prefers short examples",
})
if err != nil {
    return err
}

contextPack, err := client.AgentContext(ctx, map[string]any{
    "scopeIds": []string{os.Getenv("NEUTRON_SCOPE_ID")},
    "agentId": "agent_docs",
    "task": "Draft an SDK migration note",
})
if err != nil {
    return err
}
_ = contextPack

Rust

use neutron_ai::{ClientOptions, NeutronAIClient};
use serde_json::json;

let client = NeutronAIClient::new(ClientOptions {
    base_url: "https://neutronai.dev/api".to_string(),
    token: Some(std::env::var("NEUTRON_API_TOKEN").expect("NEUTRON_API_TOKEN is required")),
    nucleus_id: Some(std::env::var("NEUTRON_NUCLEUS_ID").expect("NEUTRON_NUCLEUS_ID is required")),
    tenant_id: None,
})?;

client.remember(json!({
    "scopeId": std::env::var("NEUTRON_SCOPE_ID")?,
    "type": "preference",
    "text": "Prefers short examples"
})).await?;

let context_pack = client.agent_context(json!({
    "scopeIds": [std::env::var("NEUTRON_SCOPE_ID")?],
    "agentId": "agent_docs",
    "task": "Draft an SDK migration note"
})).await?;

MCP

Remote MCP lets compatible agent hosts call Neutron memory and intelligence tools directly.

import { createNeutronMcpServerUrl, createOpenAIMcpTool } from "@neutron-ai/sdk";

const neutron_memory = createOpenAIMcpTool({
  serverUrl: createNeutronMcpServerUrl("https://mcp.neutronai.dev"),
  serverLabel: "neutron_memory",
  allowedTools: ["memory_agent_context", "memory_recall"],
  requireApproval: "never"
});

Keep write-capable tools disabled unless the host is trusted to create, update, or delete knowledge, propose decisions, record outcomes, or run simulations within its authorised Scopes.