AI memory playbook¶
This page is the recommended operating pattern for using liel[mcp] as durable
graph memory from AI tools.
Which file should I use?¶
| File | Purpose |
|---|---|
| This page | Recommended operating pattern for any LLM |
| Claude setup | Claude-specific setup pointer |
Sample CLAUDE.md |
Copyable Claude project-instructions sample |
If you only add one rule to an agent prompt, use this:
Always check existing memory before asking the user to repeat context.
Start small¶
For most projects, begin with this policy:
- Save only durable, high-signal information: decisions, preferences, tasks, sources, and important project facts.
- Do not save temporary reasoning, speculative notes, noisy logs, or every tool result.
- Read existing memory at the start of a task.
- Write at meaningful checkpoints, not every turn.
- Use nodes for entities and edges for relationships.
Useful starter labels:
TaskDecisionPreferenceIssueModuleSource
Official MCP surface¶
The official tool surface is fixed to these ten tools:
liel_overviewliel_findliel_exploreliel_traceliel_mapliel_diffliel_merge_previewliel_manifestliel_appendliel_merge
Default operating pattern¶
Use this flow unless the project has a stronger local convention:
- Start with
liel_overviewto understand what kind of memory already exists. - Use
liel_findto narrow to relevant nodes by label or exact property. - Use
liel_exploreto inspect neighbourhood structure around an important node. - Use
liel_tracewhen the question is about impact, dependency, or propagation. - Use
liel_mapwhen a Mermaid diagram will help explain the subgraph. - Use
liel_appendwhen the AI is intentionally recording new nodes and edges. - Use
liel_mergewhen the AI wants to reuse existing nodes, update known nodes, or add idempotent edges.
Write discipline¶
- Save only durable information: confirmed decisions, stable preferences, important facts, open questions worth revisiting, and tasks that should survive the session.
- Do not save chain-of-thought, speculative ideas, verbose logs, or every intermediate tool result.
- Prefer a few well-linked nodes over many tiny writes.
- Batch writes at natural checkpoints instead of committing every conversational turn.
Stable keys for merge¶
liel_merge works best when each important label has a stable lookup key. This
is not a Claude-specific rule; it is a general AI operating rule for any MCP
client.
Good examples:
Module->pathDocument->urlIssue->issue_idPerson->emailorexternal_id
Recommended behavior:
- If you know a stable key, call
liel_mergewithmatch. - If you already know the node ID, call
liel_mergewithid. - If no stable key exists, use
liel_findfirst and then merge byid. - Avoid weak keys such as
namealone unless uniqueness is guaranteed.
Prompt snippets¶
Claude (CLAUDE.md)¶
## Project Memory
- Use `liel[mcp]` as the long-term memory store for this project when the MCP server is available.
- At the start of a task, use `liel_overview`, then `liel_find`, then `liel_explore` before asking the user to repeat known context.
- Use `liel_trace` when the user asks about impact, dependency, or what a change ripples into.
- Save only durable information: confirmed decisions, stable preferences, important facts, open questions, and tasks that should survive the session.
- Use `liel_append` for guaranteed new records and `liel_merge` when reusing existing nodes or adding idempotent edges.
- Do not save temporary reasoning, speculative ideas, or verbose logs.
Codex¶
## Durable Memory
- Use the repository-root `codex-session-memory.liel` as the canonical project memory file for this repo (see `AGENTS.md`). Do not substitute another `.liel` as the default unless the user says so.
- If the `liel` MCP server is available, use it as the default durable memory layer for the workspace.
- Restore context in this order: `liel_overview` -> `liel_find` -> `liel_explore`.
- Use `liel_trace` when estimating blast radius, ownership paths, or dependency chains.
- Save only durable project knowledge. Prefer grouped writes at meaningful checkpoints.
- Use `liel_append` when records are intentionally new. Use `liel_merge` when duplicates are possible or existing nodes should be reused.
Cursor¶
## Memory Rules
- Use `liel[mcp]` as persistent project memory when available.
- Before asking the human to restate context, check memory with `liel_overview`, `liel_find`, and `liel_explore`.
- Use `liel_map` or `liel_trace` when graph structure will clarify an answer.
- Save only durable, high-signal knowledge.
- Prefer `liel_append` for clearly new records and `liel_merge` for checkpointed updates around existing graph structure.