Getting started
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.
Packages
| Environment | Package | Primary use |
|---|---|---|
| TypeScript / JavaScript | @neutron-ai/sdk | Node apps, web backends, agent runtimes, MCP helpers. |
| CLI | @neutron-ai/cli | macOS, Windows, Linux, CI, and support workflows. |
| Python | neutron-ai | AI apps, notebooks, evaluation scripts, automation. |
| PHP | neutron-ai/sdk | Laravel, Symfony, WordPress, and custom PHP backends. |
| Go | github.com/neutron-ai/sdk-go | Services, background jobs, and platform tools. |
| Rust | neutron-ai | Typed 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!,
tenantId: process.env.NEUTRON_TENANT_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"
});
CLI
npm install -g @neutron-ai/cli
export NEUTRON_API_URL="https://neutronai.dev/api"
export NEUTRON_API_TOKEN="<server-issued-token>"
export NEUTRON_TENANT_ID="<tenant-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_TENANT_ID="<tenant-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"],
tenant_id=os.environ["NEUTRON_TENANT_ID"],
)
client.remember({
"scopeId": os.environ["NEUTRON_SCOPE_ID"],
"type": "preference",
"text": "Prefers short examples",
})
PHP
use NeutronAI\NeutronAIClient;
$client = new NeutronAIClient(
base_url: 'https://neutronai.dev/api',
token: getenv('NEUTRON_API_TOKEN'),
tenant_id: getenv('NEUTRON_TENANT_ID'),
);
$client->remember([
'scopeId' => getenv('NEUTRON_SCOPE_ID'),
'type' => 'preference',
'text' => 'Prefers short examples',
]);
Go
client, err := neutron.NewClient(neutron.Options{
BaseURL: "https://neutronai.dev/api",
Token: os.Getenv("NEUTRON_API_TOKEN"),
TenantID: os.Getenv("NEUTRON_TENANT_ID"),
})
if err != nil {
return err
}
_, err = client.Remember(ctx, neutron.RememberRequest{
ScopeID: os.Getenv("NEUTRON_SCOPE_ID"),
Type: "preference",
Text: "Prefers short examples",
})
Rust
let client = neutron_ai::NeutronAIClient::new(neutron_ai::ClientOptions {
base_url: "https://neutronai.dev/api".to_string(),
token: std::env::var("NEUTRON_API_TOKEN").expect("NEUTRON_API_TOKEN is required"),
tenant_id: std::env::var("NEUTRON_TENANT_ID").expect("NEUTRON_TENANT_ID is required"),
});
MCP
Remote MCP lets compatible agent hosts call Neutron 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 memory.