# When learning is done

> Wait for a source to be learned, in one held call.

Learning usually takes a few seconds. To wait for it:

```python
source = mem.memories.add("Priya Nair signs the Lumen renewal.")
source = mem.sources.wait(source.id)          # returns the moment it is done
print(source.status, source.facts)            # learned 1
```

```ts
let source = await mem.memories.add("Priya Nair signs the Lumen renewal.");
source = await mem.sources.wait(source.id);
```

```bash
curl "https://api.geniffy.com/v1/sources/SOURCE_ID?wait=30" \
  -H "Authorization: Bearer $GENIFFY_API_KEY" \
  -H "X-Geniffy-Space: customer_1042"
```

`status` is `reading`, then `learned` or `failed`; `facts` is how many memories it taught, and `error`
says in plain words why a source failed. Over HTTP, `wait` holds the answer open until the source is
done, up to 60 seconds, so there is no polling loop to write.

You do not have to wait before asking. A question asked while a source is still being read is answered
from what has already been learned.

Source: https://docs.geniffy.com/add-memories/when-learning-is-done
