Skip to content
Documentation

Remember & reuse

Remember what will matter next.

Keep selected findings and decisions separate from transient reads and conversation history.

AvailableReviewed September 2026
Save useful evidence, then verify it against the current source when you reuse it.

Choose the right store

Session state describes the current work: task, progress, findings and decisions. Project knowledge stores facts intended to be useful across tasks. Read caches hold prior source representations.

None of these is a promise to retain every conversation indefinitely. Capacity, lifecycle, retention and project boundaries apply.

Record a useful decision

{"name":"ctx_knowledge","arguments":{"action":"remember","category":"decision","content":"Use the existing authentication middleware for new protected routes. Verify against the current routing configuration before implementation."}}

Prefer a specific, reviewable fact over a large transcript. Include its source or rationale. Avoid storing secrets merely because the knowledge store is local.

Recall, then verify

{"name":"ctx_knowledge","arguments":{"action":"recall","query":"authentication middleware"}}

Recall returns candidates, not a freshness guarantee. Compare the finding with current source, update obsolete knowledge and resolve contradictions deliberately.

Session continuity can include a compact startup briefing. Its placement and contents depend on integration and configuration; it is not unrestricted access to previous host conversations. The briefing comes only from the agent’s own session or an explicit handoff; see session tools.

Share conventions across linked checkouts

Every fact has a validity class. A convention says how things are done here: facts in the categories convention and decision, or facts recorded with validity: "convention". Content is bound to its sources, such as a finding about a specific file.

Link the checkouts of one team project with lean-ctx project link --project <team-project-id>. Recall in a linked checkout then also answers from the other checkouts of that project:

  • Conventions apply in every linked checkout, whatever its branch.
  • A code-bound fact applies only while every file it is bound to is identical in your checkout. Otherwise it is withheld as stale.

Recall shows the class of each fact. lean-ctx project status shows the link, lean-ctx project unlink removes it, and lean-ctx project use <path> picks which workspace root sessions bind to when several are open.

Understand restore limits

A backup of the data directory, lean-ctx knowledge restore and lean-ctx cloud pull bring back facts, history, patterns and procedures. They never bring back:

  • Access you have lost. Revoked plans, seats and grants stay revoked. A restored entitlement file grants nothing paid until your account confirms it, and then only what the account grants today.
  • Sources you can no longer read. Archived items are checked again before they return.
  • Newer values. knowledge restore never puts an older value on a key that a current fact owns. cloud pull keeps every local fact, never writes to the cloud and lists the keys where the cloud value differs, so you decide which one is right.

lean-ctx sync keeps facts that only the cloud holds, such as another device’s knowledge. It refuses to replace a cloud value that is newer than yours or that this machine never saw, and names the keys. To take a cloud value, remember it locally and sync again. To keep your local values, lean-ctx sync --force replaces them in the cloud copy; keys only the cloud holds are still kept.

Pro includes one storage quota of 2 GiB per account for synchronized knowledge and the hosted index together. A write that would exceed it is refused and nothing is stored.

See what your team shares

On a team plan, facts shared with the team appear in the Cockpit under Memory → Team. Each one says who receives it: one team project, or the whole team. A team-wide fact also says why it is team-wide:

Label Meaning
Team-wide The writer chose the whole team.
Team-wide (legacy client) An older LeanCTX client wrote it without naming an audience, so the team service shares it with everyone.
Team-wide (audience not recorded) It was shared before LeanCTX 3.11.5 recorded the audience.

Keep knowledge portable

The CLI supports JSON export/import and Open Knowledge Format bundles. OKF represents facts as Markdown with metadata and relationships. Inspect an export before sharing it and preserve project boundaries when importing.

See protocols and formats for the distinction between knowledge exports, runtime packages and versioned SDK checkpoints.

Operate within limits

The memory lifecycle can consolidate, age and archive entries according to the configured capacity. Check configuration for effective limits. Local archives are subject to their own retention and availability.

Sources & versions6 references Reviewed
  • mod.rsrust/src/tools/ctx_knowledge/mod.rsReviewed checkout
  • remember.rsrust/src/tools/ctx_knowledge/remember.rsReviewed checkout
  • linked.rsrust/src/tools/ctx_knowledge/linked.rsReviewed checkout
  • project_cmd.rsrust/src/cli/project_cmd.rsReviewed checkout
  • state.rsrust/src/core/session/state.rsReviewed checkout
  • 03-memory-and-knowledge.mddocs/reference/03-memory-and-knowledge.mdReviewed checkout
Core checkout
1897b31c2d
Reviewed runtime
3.10.2
SDK release
1.1.0

Separate baselines for source, CLI/configuration and SDK contracts. Review does not certify every platform or integration.

Versions & compatibility