> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ngram.space/llms.txt
> Use this file to discover all available pages before exploring further.

# Retain what matters

> The stores and retrieval paths that give an Entity continuity beyond live context.

ngram uses several memory representations because a conversation, a durable fact, and a learned procedure serve different purposes. Retrieval selects relevant material for a turn; retention is not exhaustive or lossless.

## Episodic memory

Episodes record selected experiences with metadata and embeddings. Semantic retrieval compares a query with stored vectors, while significance and recall settings influence what is retained and returned.

Keep the embedding route stable for an existing store. Two models returning the same number of dimensions do not necessarily produce compatible vectors.

## Knowledge and journal

`knowledge.md` holds curated sections that can be retrieved into context. The journal records append-oriented reflections. Both are readable files, so operators can inspect them and include them in backups.

Use [knowledge and journal](/guides/knowledge-and-journal) for editing and tool behavior. Neither file is automatically encrypted, and neither substitutes for a database backup.

## Relationships

The relational layer maintains per-person records and prose portraits. It can derive scalar relationship state from reflection and write document mirrors to disk. Correct person mapping matters when several surfaces refer to the same human.

## World beliefs

Beliefs represent retained interpretations or claims with metadata and confidence. A confidence value is internal state, not a calibrated proof that the claim is true. Dream-derived or inferred beliefs need different treatment from directly verified facts.

## Procedural memory skills

Procedural memory stores reusable guidance as files and retrieves relevant procedures into later turns. Corrections and experience can contribute to this store. Review learned procedures when repeated behavior is unhelpful or outdated.

## Consolidation

Scheduled consolidation processes accumulated experience and can update higher-level memory. It runs through the daemon and can use inference even without a new user message. Global inference pause skips scheduled consolidation entry points.

## Experience distillation

Distillation extracts reusable material from recorded experience. Its settings and triggers are separate from the live conversation's context-window compaction.

Compaction reduces the prompt sent to a model. Consolidation and distillation work on retained experience. These mechanisms can complement each other without being interchangeable.

## Narrative identity

Narrative synthesis creates longer-form continuity from accumulated experience. It is generated interpretation and should remain distinguishable from the underlying records.

## Storage and portability

Conventional Entities use SQLite or Postgres for structured records plus a filesystem workspace. Open portable Entities use a canonical container and derived cache. See [persistence](/deployment/persistence) before moving or backing up either form.

Source: [`ngram/memory`](https://github.com/ngramspatial/ngram/tree/main/ngram/memory).
