# now, episodes, lessons, intentions

> Each part on its own: where a project stands, what happened, what was learned and what was promised.

The [briefing](https://docs.geniffy.com/recall/briefing) reads every part at once. Each part can also be read on its own, for a
dashboard, a status page or an agent that needs one thing.

## now: where things stand

```python
for state in mem.now("checkout"):
    print(state["goal"], state["focus"], [x["text"] for x in state["open"]])
```

```ts
for (const s of await mem.now("checkout")) console.log(s.goal, s.focus, s.open.map((x) => x.text));
```

One state per project: its `goal`, its `focus`, what is `open` (each with `since`), the `decisions` made (each
with `why` and `when`), `next_steps`, `blockers`, and what is `done`. It moves as each new stretch of work is
read: an open item closes when something later finishes it, and a goal stays until a later one replaces it.
Leave the project out for every project, most recent first.

## episodes: what happened

```python
for e in mem.episodes("checkout", limit=10):
    print(e["title"], "->", e["outcome"])
```

```ts
for (const e of await mem.episodes({ project: "checkout", limit: 10 })) console.log(e.title, "->", e.outcome);
```

Stories, newest first: `what_happened`, how it ended (`outcome`), what it `led_to`, the `people` in it, the
`decisions` made with their reasons, when it started and ended, and the `source` it came from. A session is cut
into episodes where its story turns (a new task, a failure, a decision), not into chunks of a fixed size.

## lessons: what was learned

```python
for lesson in mem.lessons("checkout"):
    print(lesson["statement"], "| when:", lesson["applies_when"], "| why:", lesson["why"])
```

```ts
for (const l of await mem.lessons({ project: "checkout" })) console.log(l.statement, l.applies_when, l.why);
```

Rules, how-tos and lessons, each with the situation it applies to and the reason behind it. Learned again in a
later session, a lesson grows stronger (`strength`) instead of repeating, and keeps every source it came from.

## intentions: what was promised

```python
for i in mem.intentions():
    print(i["what"], i["owner"], i["at"] or i["when"])
mem.set_intention(7, "done")
```

```ts
for (const i of await mem.intentions()) console.log(i.what, i.owner, i.at ?? i.when);
await mem.setIntention(7, "done");
```

Promises and plans, the person's own and those made to them, with their trigger: a time (`at`), or words such
as "when testing ends" (`when`). `status` is `open`, `done` or `dropped`; pass `status` to list the others, and
`set_intention()` to mark one kept.

## memory health: how well it answers about its own work

```python
h = mem.memory_health()
print(h["health"], h["tested_at"])     # 0.9, the night it last tested itself
```

```ts
const { health, items } = await mem.memoryHealth();
```

Each night, once a memory has taken in something new and gone quiet, it writes questions from what it read, answers
them the way your questions are answered, and marks the answers. `health` is the share it got right (a partly right
answer counts half), and `items` are the questions, what was expected, its answers and their marks. It is `null`
before the first night.

## Forgetting reaches every part

Deleting a source takes the episodes read from it with it, and the lessons and promises that rested only on it.
Forgetting a person removes them from every part. [Correct and forget](https://docs.geniffy.com/correct-and-forget) works the same way
it does for memories.

Source: https://docs.geniffy.com/recall/state
