Start
SDK and CLI
@getera/brain for memory alone, era.brain in @getera/sdk next to the business API, and era brain in the terminal.
@getera/brain
The memory client on its own — about 5 KB, no dependencies; Node 18+, Bun, Deno and edge runtimes.
npm install @getera/brainimport { createBrain, EraError } from '@getera/brain'
const brain = createBrain({ apiKey: process.env.ERA_API_KEY }) // baseUrl defaults to https://app.getera.io
// Remember — a sentence, a conversation, ready-made facts or a record
await brain.add('Kerem Aydın at Mavi Tekstil wants order updates by WhatsApp.')
await brain.add({ messages: [{ role: 'user', content: 'I am vegetarian and I hate early meetings.' }] })
await brain.add({
facts: [{ statement: 'Kuzey Lojistik renews its contract on 1 March 2027.', kind: 'commitment', about: [{ name: 'Kuzey Lojistik', type: 'company' }] }],
})
await brain.add({ record: { type: 'ticket', id: 'T-1042', title: 'Late delivery', fields: { customer: 'Kuzey Lojistik', status: 'open' } } })
await brain.add('My parking spot is B-14.', { private: true })
// Recall
const { results, paths } = await brain.search('How should I update Kerem about orders?', { limit: 5, graph: true })
// Browse and explain
for await (const m of brain.listAll({ kind: 'preference' })) console.log(m.content)
const why = await brain.explain('How should I update Kerem about orders?', results[0].id)
// The graph
await brain.entities({ q: 'Kuzey' })
await brain.graph('Who supplies the company Ada works at?')
await brain.paths('Ada Lovelace', 'Babbage Parts')
// Change
await brain.update(results[0].id, { content: 'Kerem Aydın at Mavi Tekstil wants order updates by WhatsApp or SMS.' })
await brain.forget(results[0].id)
try {
await brain.add({ text: 'too short' })
} catch (e) {
if (e instanceof EraError) console.log(e.status, e.code, e.problems) // 422 invalid_input [{ field: 'text', … }]
}add with the same record.type and record.id again replaces what that record said before. Pass { idempotencyKey } to make a retry safe: the first answer is replayed for 24 hours.
era.brain in @getera/sdk
The full Era API client has the same namespace, next to orders, customers and every other module:
import { createEra } from '@getera/sdk'
const era = createEra({ apiKey: process.env.ERA_API_KEY })
await era.brain.add({ text: 'Ada Lovelace prefers invoices in EUR, sent on the 1st.' })
const { results } = await era.brain.search('invoice currency for Ada')era brain
npm install -g @getera/cli
era login # once: your browser opens Era's sign-in
era brain add "Ada prefers invoices in EUR" --wait
era brain add --file call-notes.md --label "Call with Ada"
era brain search "How does Ada want to be invoiced?" --graph
era brain list --kind preference
era brain get <id>
era brain correct <id> "Ada prefers invoices in GBP since October"
era brain forget <id>
era brain graph "Who supplies the company Ada works at?"
era brain path "Ada Lovelace" "Babbage Parts"
era brain explain "How does Ada want to be invoiced?" <id>
era brain setup claude --apply # or: codexEvery command takes --json for scripts. In CI, set ERA_API_KEY instead of era login.