My App

Memory

Long-term memory — add, search, and manage memories for users and agents.

Memory extracts durable facts from conversations and makes them searchable, scoped to an entity (userId, agentId, or runId).

Add

import { createMemoryClient } from "@libra-memory/sdk";
const memory = createMemoryClient({ apiKey: process.env.LIBRA_API_KEY });

await memory.add(
  [{ role: "user", content: "I'm vegetarian and allergic to peanuts." }],
  { userId: "u_123" },
);

The engine runs LLM fact-extraction by default. Pass infer: false to store text verbatim.

const hits = await memory.search("what can I eat?", { userId: "u_123" });
curl https://libra.rivastudio.ai/v3/memories/search/ \
  -H "Authorization: Token $LIBRA_API_KEY" -H "Content-Type: application/json" \
  -d '{"query":"what can I eat?","filters":{"user_id":"u_123"}}'

Manage

  • List memories for an entity scope.
  • Get / update / delete individual memories by id.
  • Delete all memories for an entity.

See the API reference for the full surface (/v3/memories/*, /v1/memories/{id}/).

On this page