Node, pnpm, the Memory repository, and a running Memory API.
Run the first project.
The SDK is private today. Run its checked-in example, or try hosted Memory here.
Run these commands.
- Prepare SDK
pnpm examples:prepare-sdkBuild the current private SDK package from the Memory repository.
- Install example
cd examples/sdk-quickstart && pnpm installInstall the checked-in model-aware example.
- Build Assembly
pnpm exec memory synth --entry memory.model.ts --out memory.outCreate the exact Assembly used by every later step.
- Check model
pnpm exec memory check --assembly memory.out --env local --yesCheck that exact Assembly against Memory.
- Deploy
pnpm exec memory deploy --assembly memory.out --env local --yesCheck once more, then apply that Assembly.
Start local. Move to hosted when needed.
About 10 minutes for the first model.
Not needed to run locally. Needed to keep hosted projects.
Starts only when you choose hosted Memory.
Use Memory from app code.
import { createMemoryModelClient, MemoryClient } from '@memory/sdk'
import { createMemoryClientOptionsFromEnvironment, resolveMemoryEnvironment } from '@memory/sdk/config'
import { model } from './memory.model.js'
const environment = await resolveMemoryEnvironment()
const client = new MemoryClient(createMemoryClientOptionsFromEnvironment(environment))
export const memory = createMemoryModelClient(client, model)Choose the smallest useful template.
Smallest model. Use it to see the parts.
First working app. Use it to query and deploy.
Sync example. Use it when outside data matters.