Skip to content

Memory Tree

Ported from legacy upstream docs/memory/MEMORY_TREE_VISUALIZATION.md. Concepts preserved verbatim; CLI invocations are unchanged because amplihack memory tree is a CLI surface shared between the Python and Rust implementations.

See also: Memory Backend Architecture · Agent Memory Quickstart · Memory Backend Reference

This page documents the current amplihack memory tree command.

Overview

amplihack memory tree renders the repo's top-level session memory graph using the amplihack memory database — a SQLite store at ~/.amplihack/memory.db by default, or a LadybugDB graph store when the graph backend is selected (see Memory Backend Architecture).

It is a graph view over the top-level CLI/session memory store. It is not a live view into a generated goal-agent's local ./memory/ directory.

Mental Model

The memory tree is a hierarchy with three levels:

  1. Root — the memory database itself (one per ~/.amplihack/ install, plus per-bundle databases when amplihack new --enable-memory is used).
  2. Sessions — each top-level session (CLI run, recipe execution, or long-lived agent loop) is a node under the root.
  3. Memory items — individual entries (learnings, decisions, patterns, conversations, contexts, artifacts) attached to a session.

Edges between memory items express provenance and relationships (for example, a learning derived from a pattern, or an artifact produced by a decision). The tree view collapses these edges into a parent/child view suitable for human inspection.

Usage

Basic command

amplihack memory tree

Filter by session

amplihack memory tree --session Session-2026-01-12

Filter by memory-item type

amplihack memory tree --type learning
amplihack memory tree --type pattern

The current parser accepts these legacy type names:

  • conversation
  • decision
  • pattern
  • context
  • learning
  • artifact

Limit depth

amplihack memory tree --depth 3

Supported Options

amplihack memory tree [--session SESSION] [--type TYPE] [--depth N]

There is no supported top-level --backend flag on memory tree in the current parser. The backend is selected by the same environment variables and config that drive every other amplihack memory subcommand — see Memory Backend Reference.

Output Shape

The command renders a tree of the current session graph, grouped by session and memory item metadata. The exact styling may change, but the current command is intended for human inspection rather than machine parsing. For machine-readable output, use amplihack memory export.

  • amplihack memory export / amplihack memory import — agent-local hierarchical memory transfer.
  • amplihack new --enable-memory — generated agent scaffolds with a local ./memory/ directory.