La interfaz está localizada; las descripciones y documentos de las Skills se traducen automáticamente con IA a su idioma. El código, los comandos, rutas y términos técnicos se mantienen en el original, y prevalece el documento del autor.
Explorar Skills
Desarrollo · SKILL.md

typescript-rest-client

typescript-rest-client

Use the @memmachine/client TypeScript REST client for Node/TypeScript project and memory operations, client defaults, API errors, build/test workflows, and self-hosted/cloud base URL troubleshooting.

Independent GitHub snapshot · Automated classification · Original documentation governs

Documentación de la Skill

GitHub

name: typescript-rest-client description: "Use the @memmachine/client TypeScript REST client for Node/TypeScript project and memory operations, client defaults, API errors, build/test workflows, and self-hosted/cloud base URL troubleshooting." disable-model-invocation: true metadata: disco-role: operating license: Apache 2.0

TypeScript REST Client

Use this sub-skill when a task names @memmachine/client, TypeScript/Node, MemMachineClient, MemMachineProject, MemMachineMemory, Axios errors, Jest tests, npm build/lint/format, or a TypeScript app that adds/searches MemMachine memories.

Route Within This Sub-skill

  • Read typescript-client-reference.md for classes, methods, constructor options, defaults, and option names.
  • Read workflows.md for install, project/memory operations, live/self-hosted base URL selection, build/test, and Python-to-TS translation patterns.
  • Read troubleshooting.md for Node/npm, ESM/CJS, proxy, Axios/API, base URL, auth, and option-name failures.
  • Run ts_client_recipe.mjs to print a safe TypeScript recipe or optionally run a live health check when explicit live arguments are supplied.

Quick Pattern

import MemMachineClient from '@memmachine/client'

const client = new MemMachineClient({
  base_url: 'https://api.memmachine.ai/v2',
  api_key: process.env.MEMMACHINE_API_KEY
})

const project = client.project({ org_id: 'my-org', project_id: 'my-project' })
const memory = project.memory({ user_id: 'alice', agent_id: 'assistant' })
await memory.add('Alice prefers aisle seats.', {
  metadata: { category: 'travel' },
  types: ['episodic', 'semantic']
})
const result = await memory.search('What seating does Alice prefer?', { top_k: 5 })

Important Defaults

  • Package: @memmachine/client.
  • Node engine in the source baseline: >=20.19.0.
  • Constructor default base_url: https://api.memmachine.ai/v2.
  • Constructor default timeout: 60000 ms.
  • Constructor default max_retries: 3.
  • Proxy environment variables can make the client choose a fetch adapter.

For a self-hosted server, confirm the correct REST prefix. A self-hosted FastAPI server commonly exposes /api/v2, while the TS client's cloud default ends in /v2. Set base_url to the exact prefix that makes /health and /memories/search resolve correctly.

Cross-links

Skills guardadas