> For the complete documentation index, see [llms.txt](https://kerno.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kerno.gitbook.io/docs/core-concepts/memory-and-learning.md).

# Memory and Learning

Memory and learning is how Kerno gets better as it works with your codebase and learns from your feedback.&#x20;

```mermaid
flowchart LR
    A[Kerno needs an analysis] --> C{In memory and<br/>still current?}
    C -->|Yes| F[Reuse it]
    C -->|No| E[Work it out]
    E --> G[Store it, stamped with<br/>the current revision]
    U[A finding you review] --> G
    G --> F
```

Kerno learns in three ways:

* **From your code** – Kerno works out how your app is structured, which files serve which routes, and how each endpoint authenticates. This analysis is slow, so Kerno does it once and reuses it, re-deriving only the parts a code change affects.
* **From running your tests** – While setting up and running tests, Kerno remembers what actually worked, like the steps needed to seed a user before a test can run. The next endpoint in the same service reuses that instead of working it out again.
* **From your feedback** – When you dismiss a flagged issue, or answer a question Kerno asks like where to find a schema, Kerno saves your answer and applies it on every later run.

### How Memory is Stored

Memory is kept as a git history alongside Kerno's working copy of your repository, on your machine. Each entry is a commit whose trailer records the code revision it was learned at:

```
kerno-scenarios | scenario memory: GET /users/me
---
refs/HEAD/d3e136b8ec06451739fe5428789268317b976472
```

Two consequences worth knowing:

* Memory persists across agent restarts, and across clearing and re-creating a workspace. It is not tied to a session.
* Because entries are commits, older versions remain — a memory that was recomputed still has its previous value in history.

Every memory is stamped with the exact code revision it came from, so Kerno knows when a memory has gone stale and re-derives it.
