Get a specific memory by ID. Examples: mem0 get abc-123-def-456 mem0 get abc-123-def-456 -o json
(
memory_id: str = typer.Argument(..., help="Memory ID to retrieve."),
output: str = typer.Option(
"text", "--output", "-o", help="Output: text, json.", rich_help_panel="Output"
),
api_key: str | None = typer.Option(
None,
"--api-key",
help="Override API key.",
envvar="MEM0_API_KEY",
rich_help_panel="Connection",
),
base_url: str | None = typer.Option(
None, "--base-url", help="Override API base URL.", rich_help_panel="Connection"
),
)
| 407 | |
| 408 | @app.command(rich_help_panel="Memory") |
| 409 | def get( |
| 410 | memory_id: str = typer.Argument(..., help="Memory ID to retrieve."), |
| 411 | output: str = typer.Option( |
| 412 | "text", "--output", "-o", help="Output: text, json.", rich_help_panel="Output" |
| 413 | ), |
| 414 | api_key: str | None = typer.Option( |
| 415 | None, |
| 416 | "--api-key", |
| 417 | help="Override API key.", |
| 418 | envvar="MEM0_API_KEY", |
| 419 | rich_help_panel="Connection", |
| 420 | ), |
| 421 | base_url: str | None = typer.Option( |
| 422 | None, "--base-url", help="Override API base URL.", rich_help_panel="Connection" |
| 423 | ), |
| 424 | ) -> None: |
| 425 | """Get a specific memory by ID. |
| 426 | |
| 427 | Examples: |
| 428 | mem0 get abc-123-def-456 |
| 429 | mem0 get abc-123-def-456 -o json |
| 430 | """ |
| 431 | from mem0_cli.commands.memory import cmd_get |
| 432 | |
| 433 | backend = _get_backend(api_key, base_url) |
| 434 | cmd_get(backend, memory_id, output=output) |
| 435 | |
| 436 | |
| 437 | # ── Memory: list ────────────────────────────────────────────────────────── |
nothing calls this directly
no test coverage detected