SDK catalog / Memory

Memory

alpha 0.3.0-rc.3

Published preview for @wf/agent-memory@0.3.0-rc.3. Follow the registry guide and review compatibility before installing.

Join the alpha Sign in with Google, then add your name. We review alpha access requests.

import { createAgentMemory } from '@brightops/agent-memory'

const memory = createAgentMemory(process.argv[2] ?? './agent-memory.yaml', {
  // Example identity only: a real host obtains these values from its authenticated session.
  identity: { tenantId: 'example-company', userId: 'example-user', projectId: 'example-project' },
  admission: { name: 'app-policy', admit: async event => event },
})
try {
  const saved = memory.notes.write({ name: 'naming', description: 'Naming rule', scope: 'personal', body: 'Use clear names.' })
  if ('error' in saved) throw new Error(saved.error)
  await memory.preferences.observe({
    text: 'I prefer short replies.',
    source: { kind: 'user', sessionId: 'example-conversation', eventId: 'example-message' },
  })
  console.log(memory.notes.search('names'))
} finally {
  await memory.dispose()
}