Skip to content
Quickstart — developer guide

From first access to deployment.

Default model: Claude (Anthropic). The brain pipeline requires the builder’s own model key (BYOK); key deposit is not open yet, so the pipeline is not yet open to builders.Zero ethical rules to code, zero crisis orientation to maintain.

Decision-maker or CTO? Design objectives → · Pricing → · Reference →

What you will not need to do

  • — Host the generation model yourself (default model: Claude, Anthropic)
  • — Write ethical rules or security prompts
  • — Implement crisis detection or crisis orientation (emergency services)
  • — Code user memory persistence
  • — Build the ethical pipeline — it is included in every call

The steps

Get your builder access

Sandbox: sk_test_ key issued when the developer portal opens — no credit card, capped at 500 interactions per month. The brain pipeline requires the builder’s own model key (BYOK); key deposit is not open yet, so the pipeline is not yet open to builders. You will receive: ELYSEA_API_KEY, ELYSEA_API_SECRET, ELYSEA_APP_ID, ELYSEA_BASE_URL and the onboarding documentation.

Production (sk_live_): individual review of your use case. That is what protects ecosystem integrity.

Developer portal →

Installation

JavaScript / TypeScript — Node.js 18+ or browser.

bash
npm install @elysea/core
# sk_test_ key required — developer portal

Configuration

Three parameters. EU region is required — regions and providers: Hosting page.

typescript
import { createElyseaClient } from '@elysea/core';

const elysea = createElyseaClient({
  baseUrl:     process.env.ELYSEA_BASE_URL!,
  auth: {
    apiKey:    process.env.ELYSEA_API_KEY!,
    apiSecret: process.env.ELYSEA_API_SECRET!,
  },
  appId:       process.env.ELYSEA_APP_ID!,
  countryCode: 'GB',
  region:      'EU',
});

Resolve user identity

ELYSÉA resolves a pseudonymised coreUserId from your JWT. You do not transmit email or personal data.

typescript
// userJwt = the JWT from your own authentication system
// This token comes from your auth middleware — plain JWT, Supabase, Auth0, NextAuth, etc.
// ELYSÉA does not impose an auth system: pass whatever you already have.
// Expected format: the raw Authorization header value (e.g. "Bearer eyJ0eXAi...")
const { coreUserId } = await elysea.identity.resolve({
  userJwt: req.headers.authorization,  // Bearer token from your auth
});
// coreUserId → pseudonymised ELYSÉA internal identifier
// Never the email nor real user data

First cognitive pipeline call

The complete pipeline — signal interpretation, canon verification, generation, ethical post-processing. No model to select.

typescript
// conversationHistory — expected format:
//   Array<{ role: 'user' | 'assistant', content: string }>
//   Example: [{ role: 'user', content: 'Hi' }, { role: 'assistant', content: 'Hello!' }]
//   Max 20 entries. You manage this array server-side — ELYSÉA reads it as-is.
const result = await elysea.pipeline.run({
  userInput:           userMessage,
  coreUserId,
  conversationHistory: previousMessages,  // optional, max 20 entries
});

// result.response         → canon-compliant response
// result.posture          → applied posture (e.g. 'present_neutral')
// result.guardianAction   → 'pass'|'warn'|'block' (if block: errorCode + errorMessage)
// result.canonConformance → true if compliant with ELYSÉA canons

Memory write — optional

If your app enriches the user's context, you can write to ELYSÉA memory — with a builder consent proof (see below) and mandatory TTL. Direct memory read is blocked by the pipeline (P2).

typescript
import { createConsentToken } from '@elysea/core';

// The consent token is generated server-side after the user has explicitly consented.
// It is HMAC-SHA256 signed with your apiSecret and valid for 24 hours.
// Never generate it client-side (apiSecret must stay server-only).
const consentToken = createConsentToken(
  process.env.ELYSEA_API_SECRET!,  // your HMAC secret — never expose it
  process.env.ELYSEA_APP_ID!,
  coreUserId,
);

await elysea.memory.write(
  coreUserId,
  {
    type:       'useful_context',            // one of the 5 permitted types
    content:    'Prefers short responses.',
    expires_at: '2027-01-01T00:00:00Z',    // mandatory TTL
  },
  consentToken,
  proof, // builder consent proof — required (see "Memory: proven consent required")
);

Memory: proven consent required

Effective in the deployed brain: without a proof, the write is refused. The SDK enforces it too: without a proof, nothing is sent.

ELYSÉA writes no memory without a consent proof supplied by you, the builder. The consentToken authenticates the operation (P7); it is not consent.

What you must show — an explicit, separate memory consent text (not buried in terms and conditions), accepted by a positive action of the user.

What you must keep — the exact text shown, its version, the time of consent and the user concerned, so you can prove the consent.

What you must send — with every memory.write, a MemoryConsentProof. Every field is required and non-empty; the SDK never fills one in for you.

FieldContent
grantedtrue
consent_text_versionversion of the text shown
libelle_sha256libelleSha256(text) — hex SHA-256 of the UTF-8 bytes of the exact text shown, with no normalisation
consent_granted_atISO 8601 time of consent, recorded by you
constructor_legal_entityyour legal entity
app_idyour application
typescript
import { libelleSha256, ElyseaSDKError, ElyseaNetworkError, type MemoryConsentProof } from '@elysea/core';

// Your record of the consent (exact text shown, version, time)
const proof: MemoryConsentProof = {
  granted: true,
  consent_text_version: consent.version,
  libelle_sha256: libelleSha256(consent.textShown),
  consent_granted_at: consent.grantedAt,
  constructor_legal_entity: 'Your Company Ltd',
  app_id: 'your-app',
};

try {
  await elysea.memory.write(
    coreUserId,
    { type: 'preferences_communication', content: 'Short answers.', expires_at: '2027-01-01T00:00:00Z' },
    consentToken,
    proof,
  );
} catch (e) {
  if ((e instanceof ElyseaSDKError || e instanceof ElyseaNetworkError) && e.errorCode === 'CONSENT_PROOF_REQUIRED') {
    // Memory disabled for this user: do not retry without a complete proof.
  }
}

Without a proof, memory stays disabled

  • missing or incomplete proof → ElyseaSDKError CONSENT_PROOF_REQUIRED, before anything is sent;
  • refusal by the brain (HTTP 403 CONSENT_PROOF_REQUIRED) → ElyseaNetworkError with errorCode 'CONSENT_PROOF_REQUIRED' — never silent, never mistaken for an authentication error.

Withdrawal — as soon as the user withdraws consent, stop sending the proof (no new write is then possible) and erase items already written with memory.delete(coreUserId, itemId, consentToken). The brain does not yet expose an SDK route to withdraw the recorded consent itself.


Full example — integration in 30 lines

Copy this file into your project — it is a complete functional integration.

typescript
// elysea.ts — complete ELYSEA CERVEAU integration
import { createElyseaClient, type PipelineResult } from '@elysea/core';

const elysea = createElyseaClient({
  baseUrl:     process.env.ELYSEA_BASE_URL!,
  auth: {
    apiKey:    process.env.ELYSEA_API_KEY!,
    apiSecret: process.env.ELYSEA_API_SECRET!,
  },
  appId:       process.env.ELYSEA_APP_ID!,
  countryCode: 'GB',
  region:      'EU',
});

type Message = { role: 'user' | 'assistant'; content: string };

export async function chat(
  userJwt:  string,
  message:  string,
  history:  Message[] = [],
): Promise<PipelineResult> {
  // 1. Resolve identity — never the email, never real data
  const { coreUserId } = await elysea.identity.resolve({ userJwt });

  // 2. Cognitive pipeline call — ethics applied by the pipeline, not configured
  const result = await elysea.pipeline.run({
    userInput:           message,
    coreUserId,
    conversationHistory: history,
  });

  // result.response         → canon-compliant response, ready to display
  // result.posture          → runtime posture (present_neutral, firm_safety…)
  // result.guardianAction   → 'pass'|'warn'|'block' (if block: errorCode + errorMessage)
  // result.canonConformance → true if compliant with ELYSÉA canons
  return result;
}

// Usage in your API handler:
// const result = await chat(req.headers.authorization, req.body.message, history);
// res.json({ reply: result.response });

What you receive in the result

result.response

The response

Response generated by the ELYSÉA cognitive pipeline — canon-compliant, post-processed, validated by the Guardian SDK.

result.posture

The posture

Applied runtime posture (e.g.: present_neutral, firm_safety, containment_soft). Read-only — the builder cannot force it.

result.guardianAction

The Guardian action

'pass', 'warn' or 'block'. If 'block': errorCode + errorMessage available. Final decision of the ethical pipeline.

result.canonConformance

Canon conformance

true if the response is compliant with ELYSÉA canons. Useful for your internal audit.


The 7 runtime postures

The pipeline selects the posture automatically based on the interpreted signal. The builder can suggest an initial posture — ELYSÉA retains the final decision.

present_neutralSober presence, grounding
clarifierA single raw question
direct_no_bsDirect, firm, no moralising
silent_holdMicro-exits / silence
firm_safetyEmergency orientation (emergency services) — non-deactivatable
containment_softSoft de-escalation
meta_repairDirect relational reframing

Source: ELYSEA.SDK.ELYSEAID.v1 §2 (Component 3 — Canon postures)

sk_test_ via the portal — no credit card. Production on individual review.

sk_test_ via the developer portal — no credit card, capped at 500 interactions per month. sk_live_: individual review of your use case.

Developer portal →SDK Docs →PDF Documentation →