CubeLoop — a Pythonic, async-native agent harness core designed for high performance, readability, and production-grade persistence.
Python agent-frameworkagent-harnessagent-runtimeagentic-aiai-agentsai-frameworkanthropicharnessharness-engineeringharness-frameworklanggraphlanggraph-alternativellmmcpopenaipi-agentpi-agent-corepythonpython-agent
---
id: cubepi-checkpointer
title: cubepi.checkpointer
sidebar_position: 3
hide_table_of_contents: false
---
# `cubepi.checkpointer`
### Checkpointer {#checkpointer}
_class_
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/base.py#L13)
**Methods**
#### `load` {#checkpointer-load}
```python
load(thread_id: str) -> CheckpointData | None
```
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/base.py#L15)
#### `append` {#checkpointer-append}
```python
append(thread_id: str, messages: list[Any]) -> None
```
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/base.py#L16)
#### `save_extra` {#checkpointer-save-extra}
```python
save_extra(thread_id: str, extra: dict[str, Any]) -> None
```
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/base.py#L17)
### CheckpointData {#checkpointdata}
_class_
```python
CheckpointData(self, messages: list[Any] = list(), extra: dict[str, Any] = dict())
```
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/base.py#L7)
**Attributes**
- `messages`: `list[Any]`
- `extra`: `dict[str, Any]`
### MemoryCheckpointer {#memorycheckpointer}
_class_
```python
MemoryCheckpointer(self)
```
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/memory.py#L8)
**Methods**
#### `load` {#memorycheckpointer-load}
```python
load(thread_id: str) -> CheckpointData | None
```
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/memory.py#L12)
#### `append` {#memorycheckpointer-append}
```python
append(thread_id: str, messages: list[Any]) -> None
```
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/memory.py#L15)
#### `save_extra` {#memorycheckpointer-save-extra}
```python
save_extra(thread_id: str, extra: dict[str, Any]) -> None
```
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/memory.py#L20)
### PostgresCheckpointer {#postgrescheckpointer}
_class_
```python
PostgresCheckpointer(self, dsn: str, *, min_pool_size: int = 1, max_pool_size: int = 10)
```
Checkpointer backed by PostgreSQL.
**Usage**
```python
cp = PostgresCheckpointer(dsn="postgresql://...")
async with cp:
await cp.append(thread_id, [msg1, msg2])
data = await cp.load(thread_id)
await cp.save_extra(thread_id, {"k": "v"})
```
Raises CubepiSchemaUninitialized / CubepiSchemaMismatch at __aenter__
if the DB schema isn't compatible with this cubepi version.
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/postgres/checkpointer.py#L46)
**Methods**
#### `load` {#postgrescheckpointer-load}
```python
load(thread_id: str) -> CheckpointData | None
```
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/postgres/checkpointer.py#L110)
#### `append` {#postgrescheckpointer-append}
```python
append(thread_id: str, messages: list[Message]) -> None
```
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/postgres/checkpointer.py#L152)
#### `save_extra` {#postgrescheckpointer-save-extra}
```python
save_extra(thread_id: str, extra: dict[str, Any]) -> None
```
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/postgres/checkpointer.py#L200)
### SQLiteCheckpointer {#sqlitecheckpointer}
_class_
```python
SQLiteCheckpointer(self, db_path: str)
```
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/sqlite.py#L12)
**Methods**
#### `load` {#sqlitecheckpointer-load}
```python
load(thread_id: str) -> CheckpointData | None
```
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/sqlite.py#L42)
#### `append` {#sqlitecheckpointer-append}
```python
append(thread_id: str, messages: list[Any]) -> None
```
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/sqlite.py#L68)
#### `save_extra` {#sqlitecheckpointer-save-extra}
```python
save_extra(thread_id: str, extra: dict[str, Any]) -> None
```
[source](https://github.com/cubeplexai/cubepi/blob/main/cubepi/cubepi/checkpointer/sqlite.py#L79)
<!-- GENERATED by build_api_reference.py — DO NOT EDIT -->