Overview

title: Line Memory

Line Memory

Prompt-first procedure: Describe the outcome you want in your agent conversation. The agent should select and load the appropriate AIWG assets, explain material changes, request any needed approval, and report verification evidence. Exact commands and flags appear only in the CLI reference.

Line Memory retains short project facts in one plain-text file. Each nonblank line is one memory. The oldest line is least recent; the last line is newest. Adding, listing, searching, or touching an entry can move it to the newest position, so frequently reused facts survive retention pruning.

Common Use Cases

  • Record a canonical tracker, deployment convention, or test command that agents should find quickly.
  • Keep a bounded set of current project facts without building a wiki.
  • Import reviewed session-intelligence candidates as concise facts.
  • Search or list only the needed slice during an AI session.

When to use it

Use `llm-wiki` or `semantic-memory` instead when you need multiple pages, citations, cross-references, contradiction handling, entity profiles, or semantic retrieval. Line memory has no embeddings, knowledge graph, or automatic ingestion.

Install and verify

Use AIWG to complete this documented outcome: Install and verify
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

The same manifest-declared CLI contract works for bundled addons and project-local addon/plugin payloads. A project-local bundle declares the `cli_commands` block in its manifest; a plugin wrapper can point at an addon payload whose manifest declares the block.

Bounded retrieval and recency

Use AIWG to complete this documented outcome: Bounded retrieval and recency
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

Results are newest-first. Only the selected slice is printed. Returned entries are moved to the end of the file while preserving their relative recency. Pass the no-touch option to inspect without changing order. Search is case-insensitive unless the case-sensitive option is supplied.

Pass the json option to receive machine-readable entries with stable handles, content digests, recency, access counts, lifecycle state, and provenance. JSON retrieval touches only the entries actually returned unless the no-touch option is also supplied.

Adding, touching, and pruning

Use AIWG to complete this documented outcome: Adding, touching, and pruning
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

With `dedupe: true`, adding an exact duplicate removes older identical entries and appends one newest copy. Pruning removes the oldest nonblank memories first. Adding and reducing `maxLines` prune automatically.

Reviewed imports and lifecycle

Use AIWG to complete this documented outcome: Reviewed imports and lifecycle
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

Reviewed imports require a source reference, reviewer, and explicit confirmation. Archive, remove, and supersede operations also require confirmation and remove the active fact from the text file while retaining a sidecar tombstone. Supersession additionally requires a replacement handle or reference. Repeating an already-applied lifecycle command is safe to detect through its JSON result and retained metadata.

Use `the dry-run option the json option` instead of the confirm option on import, archive, remove, or supersede to receive a non-mutating preview with the proposed mutation counts and confirmation requirement. Handles identify normalized logical facts; if a legacy `dedupe: false` store contains repeated physical lines, disposition by handle removes every occurrence and retains one audit tombstone.

Accepted session-intelligence candidates may target `the consumer option line-memory`. That route uses the same lock, transaction journal, text file, and provenance sidecar as the CLI; it does not create a wiki-style Markdown page. Candidate review and security acknowledgement remain mandatory in the sessions gateway. If the originating session is later purged, its explicit retain, revoke, supersede, origin-unavailable, or delete disposition is applied to the stable line-memory handle and recorded in both the session journal and sidecar.

Configuration

Configuration is stored in `.aiwg/memory/line-memory.config.json`:

{
  "path": ".aiwg/memory/line-memory.txt",
  "metadataPath": ".aiwg/memory/line-memory.meta.json",
  "maxLines": 200,
  "dedupe": true,
  "trimBlankLines": true
}
Use AIWG to complete this documented outcome: Configuration
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

Paths must remain inside the project. Missing or malformed configuration uses safe defaults and emits a diagnostic. `config set` writes a valid replacement.

Security and context discipline

Never store secrets, credentials, access tokens, private keys, authentication cookies, or sensitive personal data in line memory. It is ordinary project data and may be committed or inspected like any other project file.

The addon never adds the backing file to provider startup files. Agents and skills should use bounded `list the limit option` or `search the limit option` calls instead of reading the complete file.