@alie.me/sdk
v0.1.0
Published
ALIE SDK — read + write your second brain from any Node.js / browser project. Memory layer for AI, model-neutral.
Maintainers
Readme
@alie.me/sdk — ALIE SDK
The TypeScript / JavaScript SDK for ALIE — the model-neutral AI memory layer. Save anything from anywhere; every AI you use can read your context.
npm install @alie.me/sdkRequires Node 18+ (uses native fetch).
Usage
import { Alie } from "@alie.me/sdk";
const alie = new Alie({ token: process.env.ALIE_TOKEN! });
// Capture
const saved = await alie.capture({
text: "Switching to DeepSeek-chat for capture extraction — 10x cheaper, comparable quality.",
userNote: "locking in our extraction model choice",
});
console.log(saved.thoughtId);
// Recall — hybrid retrieval (semantic + BM25 + entity boost)
const ctx = await alie.recall({ query: "model selection decisions" });
console.log(ctx.direct); // top matches
console.log(ctx.contradictions); // conflicts in your past thinking
// Morning brief
const latest = await alie.brief.latest();
const fresh = await alie.brief.generate({ lookbackDays: 7 });
// Ideation engine
const profiles = await alie.ideate.listProfiles();
const ideas = await alie.ideate.run({
profileName: "video_content",
seed: "clay",
fast: false,
});
await alie.ideate.rate({ outputId: ideas.outputs[0].id, rating: "winner" });Auth
Generate a token at alie.me/settings — the API tokens card. Each token has a label so you can identify which app is using it; revoke anytime.
const alie = new Alie({ token: "alie_xxxxx..." });For browser apps, never embed a long-lived token in client code. Have your backend mint per-session tokens or proxy through a secure server.
API surface
alie.capture({ text? | url, userNote?, ... }) // POST /api/capture
alie.recall({ query, mode? }) // POST /api/recall
alie.relate({ thoughtId, k? }) // GET /api/relate/:id
alie.brief.latest() // GET /api/brief
alie.brief.generate({ lookbackDays?, sourceFilter? }) // POST /api/brief/generate
alie.ideate.listProfiles() // GET /api/ideate/profiles
alie.ideate.run({ profileName, seed, fast?, nOutputs? }) // POST /api/ideate/run-by-name
alie.ideate.rate({ outputId, rating }) // POST /api/ideate/outputs/:id/rateEvery method returns a typed promise. Errors throw AlieError with .status (HTTP code) and .path (the route that failed).
TypeScript
Public types are exported alongside the client:
import { Alie, type RecallResult, type IdeationRunResult, AlieError } from "@alie.me/sdk";Self-hosting / dev
Pointing the SDK at a local ALIE instance:
const alie = new Alie({
token: "alie_localdev",
baseUrl: "http://localhost:3000",
});License
Apache 2.0. See LICENSE.
