Skip to main content

Overview

The MemoryClient is the Room API for room-scoped structured memory. Use it to build shared context that agents can ingest, query, and recall across workflows.

CLI commands

Start with the CLI help, then use a few common commands:
bash

Why use the Memory API?

  • Preserve structured knowledge across tasks instead of reconstructing it from chat history each time.
  • Ingest text, files, images, tables, and room storage content into a shared memory.
  • Recall the most relevant entities and relationships when building prompts or workflows.

How it works

A memory is a named dataset inside a room. You can create it, ingest data into it, inspect or query it directly, and use recall to retrieve relevant context. Some operations work at the entity and relationship level so you can maintain graph-like memory over time.
Current implementation: MeshAgent room memory is currently backed by Lance Graph, which stores entities and relationships in a graph-oriented format. Lance Graph is a Cypher-capable graph query engine.

Permissions and grants

The Memory API is controlled by the memory grant on the participant token. In practice:
  • list controls whether the participant can list memories
  • memory entry grants can be scoped by name and namespace
  • each entry can narrow permissions such as create, drop, inspect, query, upsert, ingest, recall, and optimize
See API Scopes, Participant Tokens, and Service YAML.

API reference

Use the methods below to create memories, ingest content, query or recall context, and maintain memory datasets over time.

Python SDK signatures

The examples below show common workflows. The Python SDK exposes these parameters directly on room.memory:
Python

list(namespace=None)

  • Description: List memory names in a namespace.

create(name, ...)

  • Description: Create a memory.
  • Parameters: name, optional namespace, overwrite, ignore_exists.

drop(name, ...)

  • Description: Delete a memory.
  • Parameters: name, optional namespace, ignore_missing.

More methods

These examples use the Python MemoryClient API. The CLI, Dart SDK, TypeScript SDK, and .NET SDK expose matching room-memory operations for the same methods.

inspect(name, ...)

  • Description: Return MemoryDetails including the memory path and dataset summaries.

query(name, statement, ...)

  • Description: Run a graph query against a memory and return rows.

upsert_table(name, table, records, ...)

  • Description: Upsert arbitrary rows into a named memory dataset.

upsert_nodes(name, records, ...)

  • Description: Upsert entity nodes using MemoryEntityRecord.

upsert_relationships(name, records, ...)

  • Description: Upsert edges using MemoryRelationshipRecord.

ingest_text(name, text, ...)

  • Description: Extract memory from inline text.

ingest_image(name, data, ...)

  • Description: Extract memory from an image and optional caption.

ingest_file(name, path, ...)

  • Description: Extract memory from a file path visible to the room server, or from inline text.

ingest_from_table(name, table, ...)

  • Description: Extract memory from room dataset rows.

ingest_from_storage(name, paths, ...)

  • Description: Extract memory from one or more room storage paths.

recall(name, query, ...)

  • Description: Semantic recall using a natural-language query.

delete_entities(name, entity_ids, ...)

  • Description: Remove entities and their related edges.

delete_relationships(name, relationships, ...)

  • Description: Remove relationships using MemoryRelationshipSelector.

optimize(name, ...)

  • Description: Compact and clean up memory datasets.