> For the complete documentation index, see [llms.txt](https://0x29a.gitbook.io/0x29a-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://0x29a.gitbook.io/0x29a-docs/introduction/persistence.md).

# Persistence (save)

Two distinct ways to store data across sessions — don't mix them up:

| API                                             | Where it's stored                              | Format                   | Typical use                      |
| ----------------------------------------------- | ---------------------------------------------- | ------------------------ | -------------------------------- |
| [`save`](/0x29a-docs/data-and-platform/save.md) | `%LOCALAPPDATA%\29a\saves\<program>.json`      | key → bool/number/string | script config (toggles, sliders) |
| [`db`](/0x29a-docs/data-and-platform/db.md)     | a file you choose (`29a_names.dat` by default) | address → name/comment   | reverse-engineering notes        |

## Script configuration with `save`

```lua
-- read with a default value in case the key was never set
local esp_enabled = save.get("esp_enabled", true)

ui.checkbox_esp = function()
    local changed
    esp_enabled, changed = ui.checkbox("ESP", esp_enabled)
    if changed then save.set("esp_enabled", esp_enabled) end
end
```

* Every key is isolated **per target program** (`save.program()` identifies which one) — the same script running against two different games doesn't mix saves.
* Writes to disk are automatically debounced (at most once every 2s); call `save.flush()` if you need to guarantee persistence immediately (e.g. right before the process closes).

## Reverse-engineering notes with `db`

```lua
db.set_name(0x7FF6A1B2C3D4, "CBaseEntity::GetHealth")
db.set_comment(0x7FF6A1B2C3D4, "confirmed via sig.create + xref analysis")

for _, e in ipairs(db.names()) do
    print(string.format("0x%X  %s", e.addr, e.name))
end

db.save()   -- writes to 29a_names.dat (process basedir)
```

This is the same kind of name database that tools like Ghidra/IDA keep — think of it as persistent notes about addresses you've already identified, not as user configuration.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://0x29a.gitbook.io/0x29a-docs/introduction/persistence.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
