Skip to content

Your first useful memory

Carry one support preference into the next task while keeping your model calls in your application. Start with synthetic data and the Free plan. You need a backend, a terminal with curl, or developer help; this is a code integration rather than a native no-code connector.

1. Create the account and workspace

Open Create a Free account. The email screen handles both registration and sign-in. Verify the code sent to your inbox. An organisation's SSO policy may redirect an existing user to its identity provider.

For a new account, activate the Free sandbox in onboarding, then finish setup. No payment checkout, invitation or beta code is needed for Free. A demo request or support conversation does not create this account.

2. Create a Nucleus and copy its credentials

Open Nuclei → Create Nucleus, name it Evaluation and keep Global placement for a Free workspace. On the new Nucleus's Connect card, copy its Nucleus ID and the full access token shown once. Store the token in your server's secret manager. A masked token containing asterisks cannot authenticate. If you lose it, rotate that Nucleus token; rotation invalidates the old token immediately.

A Nucleus is the memory boundary. A Scope is a named partition inside it. For these invented records, choose evaluation:sample-a; its first memory write creates the Scope. Your backend must map each authenticated user to permitted Scopes. A Nucleus token is not a separate authorisation credential for every end user.

export NEUTRON_API_URL="https://neutronai.dev/api"
export NEUTRON_API_TOKEN="<full Nucleus access token from Connect>"
export NEUTRON_NUCLEUS_ID="<Nucleus ID from Connect>"
export NEUTRON_SCOPE_ID="evaluation:sample-a"

Do not put these credentials in browser JavaScript, a public automation URL, logs or a source repository. Use a Nucleus access token for agent calls; keep workspace keys for trusted control-plane setup.

3. Remember an invented preference

curl --fail-with-body -sS "$NEUTRON_API_URL/v1/memory/remember" \
  -H "Authorization: Bearer $NEUTRON_API_TOKEN" -H "Content-Type: application/json" \
  -d "{\"nucleusId\":\"$NEUTRON_NUCLEUS_ID\",\"scopeId\":\"$NEUTRON_SCOPE_ID\",\"type\":\"preference\",\"text\":\"Aster support preference: send weekly email updates.\",\"privacyClass\":\"tenant\"}"

Expect HTTP 200 with accepted: true, a generated memoryId, your Nucleus and Scope IDs, and any warnings. Save the memoryId if you want to forget this example later. The queued field describes background indexing; the durable memory write is the source of truth.

4. Read the preference back

curl --fail-with-body -sS "$NEUTRON_API_URL/v1/memory/recall" \
  -H "Authorization: Bearer $NEUTRON_API_TOKEN" -H "Content-Type: application/json" \
  -d "{\"nucleusId\":\"$NEUTRON_NUCLEUS_ID\",\"scopeIds\":[\"$NEUTRON_SCOPE_ID\"],\"query\":\"support preference\",\"privacyClasses\":[\"tenant\"]}"

Expect HTTP 200 and a memories array containing the generated ID with a bounded summary. An empty array is not a successful first recall: check the Nucleus, requested Scope, privacy class and warnings. Recall is not a raw private-text export.

5. Add bounded context to your existing model call

curl --fail-with-body -sS "$NEUTRON_API_URL/v1/memory/agent-context" \
  -H "Authorization: Bearer $NEUTRON_API_TOKEN" -H "Content-Type: application/json" \
  -d "{\"nucleusId\":\"$NEUTRON_NUCLEUS_ID\",\"scopeIds\":[\"$NEUTRON_SCOPE_ID\"],\"agentId\":\"evaluation_support\",\"task\":\"Find the support preference\",\"privacyClasses\":[\"tenant\"],\"include\":[\"preferences\"],\"tokenBudget\":400}"

The explicit include: ["preferences"] selects preference memory for this task; intent-based defaults can select other memory types. Expect preferences and promptContext. Your server adds eligible promptContext to its existing model request. Neutron AI does not make that model call for you. This walkthrough makes three billable memory requests; retries also consume allowance when authorised. See costs and exhaustion.

Verify and clean up

Run the repeatable evaluation to check two requested Scopes, fresh context and post-deletion recall. It cleans up its own synthetic records and never calls a model. Or forget the memory from this walkthrough explicitly:

export NEUTRON_MEMORY_ID="<memoryId from step 3>"
curl --fail-with-body -sS "$NEUTRON_API_URL/v1/memory/forget" \
  -H "Authorization: Bearer $NEUTRON_API_TOKEN" -H "Content-Type: application/json" \
  -d "{\"nucleusId\":\"$NEUTRON_NUCLEUS_ID\",\"scopeId\":\"$NEUTRON_SCOPE_ID\",\"memoryId\":\"$NEUTRON_MEMORY_ID\",\"reason\":\"evaluation_cleanup\"}"

Expect forgotten: true and tombstoned: true. Repeat recall and context checks before relying on deletion. Already-issued prompts and copies in your own systems require your own invalidation.

Choose your next step

HTTP 401 usually means missing, invalid or rotated credentials. HTTP 403 means the token, Nucleus or policy does not allow the request. HTTP 402 means a self-serve billable request exhausted its allowance and available prepaid credit. Fix the boundary rather than retrying blindly.